diff --git a/ANNOUNCE b/ANNOUNCE index b39087333..1c70fa847 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -321,6 +321,7 @@ version 1.5.0beta38 [July 31, 2010] safe but uncast assignments to shorter integers. Also added a zlib VStudio release library project because the latest zlib Official Windows build does not include such a thing. + Revised png_get_int_16() to be similar to png_get_int_32(). Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 2fe021501..c28332feb 100644 --- a/CHANGES +++ b/CHANGES @@ -2803,6 +2803,7 @@ version 1.5.0beta38 [July 31, 2010] safe but uncast assignments to shorter integers. Also added a zlib VStudio release library project because the latest zlib Official Windows build does not include such a thing. + Revised png_get_int_16() to be similar to png_get_int_32(). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/png.h b/png.h index cddb6926d..d91c335d4 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.0beta38 - July 30, 2010 + * libpng version 1.5.0beta38 - July 31, 2010 * Copyright (c) 1998-2010 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.5.0beta38 - July 30, 2010: Glenn + * libpng versions 0.97, January 1998, through 1.5.0beta38 - July 31, 2010: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -172,7 +172,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta38, July 30, 2010, are + * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta38, July 31, 2010, are * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: @@ -284,7 +284,7 @@ * Y2K compliance in libpng: * ========================= * - * July 30, 2010 + * July 31, 2010 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -348,7 +348,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.5.0beta38" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.0beta38 - July 30, 2010\n" + " libpng version 1.5.0beta38 - July 31, 2010\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 @@ -1295,11 +1295,9 @@ PNG_EXPORT(void,png_set_filter,(png_structp png_ptr, int method, int filters),, PNG_FP_EXPORT(void,png_set_filter_heuristics,(png_structp png_ptr, int heuristic_method, int num_weights, png_doublep filter_weights, png_doublep filter_costs),,68); -#if 0 /* TO DO */ PNG_FIXED_EXPORT(void,png_set_filter_heuristics_fixed,(png_structp png_ptr, int heuristic_method, int num_weights, png_fixed_point_p filter_weights, png_fixed_point_p filter_costs),,209); -#endif #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be @@ -1607,10 +1605,8 @@ PNG_EXPORT(png_uint_32,png_get_y_pixels_per_meter,(png_structp png_ptr, /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(float,png_get_pixel_aspect_ratio,(png_structp png_ptr, png_infop info_ptr),,125); -#if 0 /* TO DO */ PNG_FIXED_EXPORT(png_fixed_point,png_get_pixel_aspect_ratio_fixed, (png_structp png_ptr, png_infop info_ptr),,210); -#endif /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(png_int_32,png_get_x_offset_pixels,(png_structp png_ptr, @@ -1820,19 +1816,24 @@ PNG_EXPORT(void,png_set_tRNS,(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(png_uint_32,png_get_sCAL,(png_structp png_ptr, png_infop info_ptr, int *unit, double *width, double *height),,168); +#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED +/* NOTE: this API is currently implemented using floating point arithmetic, + * consequently it can only be used on systems with floating point support. + * In any case the range of values supported by png_fixed_point is small and it + * is highly recommended that png_get_sCAL_s be used instead. + */ PNG_FIXED_EXPORT(png_uint_32,png_get_sCAL_fixed,(png_structp png_ptr, png_infop info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height),,214); +#endif PNG_EXPORT(png_uint_32,png_get_sCAL_s,(png_structp png_ptr, png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight),,169); PNG_FP_EXPORT(void,png_set_sCAL,(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height),,170); -#if 0 /* TO DO */ PNG_FIXED_EXPORT(void,png_set_sCAL_fixed,(png_structp png_ptr, png_infop info_ptr, int unit, png_fixed_point width, png_fixed_point height), ,213); -#endif PNG_EXPORT(void,png_set_sCAL_s,(png_structp png_ptr, png_infop info_ptr, int unit, png_charp swidth, png_charp sheight),,171); #endif /* PNG_sCAL_SUPPORTED */ diff --git a/pngconf.h b/pngconf.h index 29d9935f0..f886e4fbb 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.5.0beta38 - July 30, 2010 + * libpng version 1.5.0beta38 - July 31, 2010 * * Copyright (c) 1998-2010 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/pngdebug.h b/pngdebug.h index 10c7f14a2..b7bbd2b51 100644 --- a/pngdebug.h +++ b/pngdebug.h @@ -5,7 +5,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng version 1.5.0 - July 30, 2010 + * Last changed in libpng version 1.5.0 - July 31, 2010 * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/pnginfo.h b/pnginfo.h index a32d78d06..a79746e36 100644 --- a/pnginfo.h +++ b/pnginfo.h @@ -5,7 +5,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng version 1.5.0 - July 30, 2010 + * Last changed in libpng version 1.5.0 - July 31, 2010 * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer diff --git a/pngpriv.h b/pngpriv.h index df032fed1..b5c9546f0 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -1,7 +1,7 @@ /* pngpriv.h - private declarations for use inside libpng * - * libpng version 1.5.0beta38 - July 30, 2010 + * libpng version 1.5.0beta38 - July 31, 2010 * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2010 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -87,7 +87,7 @@ #ifndef PNG_ERROR_TEXT_SUPPORTED # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) -# define png_fixed_error(s1,s2,s3) png_err(s1) +# define png_fixed_error(s1,s2) png_err(s1) #endif #ifndef PNG_EXTERN @@ -392,7 +392,7 @@ */ #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ - ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s, fp),0)) + ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) #else PNG_EXTERN png_fixed_point png_fixed PNGARG((png_structp png_ptr, double fp, png_const_charp text)); @@ -1029,22 +1029,30 @@ PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr, png_voidp ptr, #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_EXTERN void png_fixed_error PNGARG((png_structp png_ptr, - png_const_charp name, double value)); + png_const_charp name)) PNG_NORETURN; #endif /* ASCII to FP interfaces, currently only implemented if sCAL * support is required. */ -#if defined(PNG_READ_sCAL_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(PNG_READ_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*/) + +#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 precision)); -#endif /* READ_sCAL && FLOATING_POINT */ +#endif /* FLOATING_POINT */ + +#ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr, + png_charp ascii, png_size_t size, png_fixed_point fp)); +#endif /* FIXED_POINT */ +#endif /* READ_sCAL */ #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) /* An internal API to validate the format of a floating point number. @@ -1119,7 +1127,8 @@ PNG_EXTERN int png_check_fp_number PNGARG((png_charp string, png_size_t size, PNG_EXTERN int png_check_fp_string PNGARG((png_charp string, png_size_t size)); #endif /* pCAL || sCAL */ -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) +#if defined(PNG_READ_GAMMA_SUPPORTED) ||\ + defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) /* Added at libpng version 1.5.0 */ /* This is a utility to provide a*times/div (rounded) and indicate * if there is an overflow. The result is a boolean - false (0) diff --git a/pngrutil.c b/pngrutil.c index c0da7e12b..c910751a6 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -88,8 +88,9 @@ png_get_int_32)(png_bytep buf) png_uint_16 (PNGAPI png_get_uint_16)(png_bytep buf) { - png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + - (png_uint_16)(*(buf + 1))); + png_uint_16 i = + ((png_uint_32)(*buf) << 8) + + ((png_uint_32)(*(buf + 1))); return (i); } diff --git a/pngstruct.h b/pngstruct.h index 6f3b57cec..e513c80d0 100644 --- a/pngstruct.h +++ b/pngstruct.h @@ -5,7 +5,7 @@ * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng version 1.5.0 - July 30, 2010 + * Last changed in libpng version 1.5.0 - July 31, 2010 * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer