[libpng15] De-configured build fixes to make a range of deconfiguration options

(such as switching off read or write support) work in more cases.  Also
upgraded pngtest and pngvalid to the libpng 1.6 versions (with some
modifications) which provide more extensive testing.  Replaced pngtest.png
because pngtest writes the ancillary chunks in a different order.
This commit is contained in:
John Bowler 2013-01-06 12:38:39 -06:00 committed by Glenn Randers-Pehrson
parent 8e4a89f0f9
commit 84dc479108
8 changed files with 565 additions and 357 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.14beta07 - January 3, 2013
Libpng 1.5.14beta07 - January 6, 2013
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@ -64,9 +64,14 @@ Version 1.5.14beta06 [January 1, 2013]
Discontinued distributing libpng-1.5.14-1.5.13-diff.txt and similar.
Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
Version 1.5.14beta07 [January 3, 2013]
Version 1.5.14beta07 [January 6, 2013]
Replaced AM_CONFIG_HEADER(config.h) with AC_CONFIG_HEADERS([config.h])
in configure.ac
De-configured build fixes to make a range of deconfiguration options (such
as switching off read or write support) work in more cases. Also upgraded
pngtest and pngvalid to the libpng 1.6 versions (with some modifications)
which provide more extensive testing. Replaced pngtest.png because pngtest
writes the ancillary chunks in a different order.
===========================================================================
NOTICE November 17, 2012:

View File

@ -3957,9 +3957,14 @@ Version 1.5.14beta06 [January 1, 2013]
Discontinued distributing libpng-1.5.14-1.5.13-diff.txt and similar.
Fixed 'make distcheck' on SUN OS - libpng.so was not being removed
Version 1.5.14beta07 [January 3, 2013]
Version 1.5.14beta07 [January 6, 2013]
Replaced AM_CONFIG_HEADER(config.h) with AC_CONFIG_HEADERS([config.h])
in configure.ac
De-configured build fixes to make a range of deconfiguration options (such
as switching off read or write support) work in more cases. Also upgraded
pngtest and pngvalid to the libpng 1.6 versions (with some modifications)
which provide more extensive testing. Replaced pngtest.png because pngtest
writes the ancillary chunks in a different order.
===========================================================================
NOTICE November 17, 2012:

13
png.c
View File

@ -658,13 +658,13 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.14beta07 - January 1, 2013" PNG_STRING_NEWLINE \
"libpng version 1.5.14beta07 - January 6, 2013" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.14beta07 - January 1, 2013\
return "libpng version 1.5.14beta07 - January 6, 2013\
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@ -1461,7 +1461,7 @@ png_check_fp_string(png_const_charp string, png_size_t size)
}
#endif /* pCAL or sCAL */
#ifdef PNG_READ_sCAL_SUPPORTED
#ifdef PNG_sCAL_SUPPORTED
# ifdef PNG_FLOATING_POINT_SUPPORTED
/* Utility used below - a simple accurate power of ten from an integral
* exponent.
@ -2047,7 +2047,8 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times,
}
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gamma */
#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
/* more fixed point functions for gamma and cHRM (xy/XYZ) suport. */
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
png_fixed_point
png_reciprocal(png_fixed_point a)
@ -2067,6 +2068,7 @@ png_reciprocal(png_fixed_point a)
return 0; /* error/overflow */
}
#ifdef PNG_READ_GAMMA_SUPPORTED
/* A local convenience routine. */
static png_fixed_point
png_product2(png_fixed_point a, png_fixed_point b)
@ -2088,6 +2090,7 @@ png_product2(png_fixed_point a, png_fixed_point b)
return 0; /* overflow */
}
#endif /* READ_GAMMA */
/* The inverse of the above. */
png_fixed_point
@ -2115,7 +2118,7 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b)
return 0; /* overflow */
}
#endif /* READ_GAMMA */
#endif /* READ_GAMMA || cHRM */
#ifdef PNG_CHECK_cHRM_SUPPORTED
/* Added at libpng version 1.2.34 (Dec 8, 2008) and 1.4.0 (Jan 2,

View File

@ -175,6 +175,9 @@ png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
return ((float)((float)info_ptr->y_pixels_per_unit
/(float)info_ptr->x_pixels_per_unit));
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return ((float)0.0);
@ -203,6 +206,9 @@ png_get_pixel_aspect_ratio_fixed(png_const_structp png_ptr,
(png_int_32)info_ptr->x_pixels_per_unit))
return res;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
return 0;

View File

@ -416,7 +416,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE
/* This is used because in some compiler implementations non-aligned
* structure members are supported, so the offsetof approach below fails.
* Set PNG_ALIGN_TO_SIZE=0 for compiler combinations where unaligned access
* Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access
* is good for performance. Do not do this unless you have tested the result
* and understand it.
*/
@ -823,11 +823,9 @@ PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
# ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
# endif
# ifdef PNG_FIXED_POINT_SUPPORTED
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr,
png_fixed_point file_gamma));
#endif
#endif
#ifdef PNG_WRITE_sBIT_SUPPORTED
PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr,
@ -1491,14 +1489,16 @@ PNG_EXTERN void png_formatted_warning(png_structp png_ptr,
/* ASCII to FP interfaces, currently only implemented if sCAL
* support is required.
*/
#if defined(PNG_READ_sCAL_SUPPORTED)
#ifdef PNG_sCAL_SUPPORTED
/* MAX_DIGITS is actually the maximum number of characters in an sCAL
* width or height, derived from the precision (number of significant
* digits - a build time settable option) and assumpitions about the
* maximum ridiculous exponent.
*/
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
#endif
#ifdef PNG_sCAL_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_EXTERN void png_ascii_from_fp PNGARG((png_structp png_ptr, png_charp ascii,
png_size_t size, double fp, unsigned int precision));
@ -1629,7 +1629,7 @@ PNG_EXTERN png_fixed_point png_muldiv_warn PNGARG((png_structp png_ptr,
png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by));
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
#if (defined PNG_READ_GAMMA_SUPPORTED) || (defined PNG_cHRM_SUPPORTED)
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value,
* there are no warnings.
@ -1664,6 +1664,62 @@ PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
int bit_depth));
#endif
/* Missing declarations if FIXED_POINT is *not* supported - fixed properly
* in libpng 1.6
*/
#ifndef PNG_FIXED_POINT_SUPPORTED
#ifdef PNG_cHRM_SUPPORTED
PNG_EXTERN png_uint_32 png_get_cHRM_XYZ_fixed PNGARG(
(png_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z));
PNG_EXTERN void png_set_cHRM_XYZ_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
png_fixed_point int_red_Z, png_fixed_point int_green_X,
png_fixed_point int_green_Y, png_fixed_point int_green_Z,
png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
png_fixed_point int_blue_Z));
PNG_EXTERN void png_set_cHRM_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_white_x,
png_fixed_point int_white_y, png_fixed_point int_red_x,
png_fixed_point int_red_y, png_fixed_point int_green_x,
png_fixed_point int_green_y, png_fixed_point int_blue_x,
png_fixed_point int_blue_y));
#endif
#ifdef PNG_gAMA_SUPPORTED
PNG_EXTERN png_uint_32 png_get_gAMA_fixed PNGARG(
(png_const_structp png_ptr, png_const_infop info_ptr,
png_fixed_point *int_file_gamma));
PNG_EXTERN void png_set_gAMA_fixed PNGARG((png_structp png_ptr,
png_infop info_ptr, png_fixed_point int_file_gamma));
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
PNG_EXTERN void png_set_background_fixed PNGARG((png_structp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, png_fixed_point background_gamma));
#endif
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
PNG_EXTERN void png_set_alpha_mode_fixed PNGARG((png_structp png_ptr,
int mode, png_fixed_point output_gamma));
#endif
#ifdef PNG_READ_GAMMA_SUPPORTED
PNG_EXTERN void png_set_gamma_fixed PNGARG((png_structp png_ptr,
png_fixed_point screen_gamma, png_fixed_point override_file_gamma));
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
PNG_EXTERN void png_set_rgb_to_gray_fixed PNGARG((png_structp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green));
#endif
#endif /* FIX MISSING !FIXED_POINT DECLARATIONS */
#ifdef PNG_FILTER_OPTIMIZATIONS
PNG_EXTERN void PNG_FILTER_OPTIMIZATIONS(png_structp png_ptr, unsigned int bpp);
/* This is the initialization function for hardware specific optimizations,

View File

@ -4746,7 +4746,9 @@ png_do_expand(png_row_infop row_info, png_bytep row,
{
if (row_info->bit_depth == 8)
{
gray = gray & 0xff;
/* NOTE: prior to libpng 1.5.14 this cleared out the top bits of
* 'gray', however if those are set it is an error.
*/
sp = row + (png_size_t)row_width - 1;
dp = row + (png_size_t)(row_width << 1) - 1;

705
pngtest.c

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB