diff --git a/ANNOUNCE b/ANNOUNCE index 191a07c4d..d15a0f63f 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ -Libpng 1.6.19beta03 - September 24, 2015 +Libpng 1.6.19beta03 - September 25, 2015 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,7 +64,7 @@ Version 1.6.19beta02 [August 19, 2015] in ANSI-C (unlike 0x80000000 in the signed case) the checking that occurs later can catch them (John Bowler). -Version 1.6.19beta03 [September 24, 2015] +Version 1.6.19beta03 [September 25, 2015] Fixed png_save_int_32 when int is not 2's complement (John Bowler). Updated libpng16 with all the recent test changes from libpng17, including changes to pngvalid.c to ensure that the original, @@ -83,11 +83,6 @@ Version 1.6.19beta03 [September 24, 2015] slightly different error limits this simplifies maintenance. The makepngs.sh script has also been updated to more accurately reflect current problems in libpng 1.7 (John Bowler). - Reverted the fix of byte order in png_do_read_filler() with 16-bit - input that was made in version 1.6.17beta01, to preserve legacy - behavior even though it was incorrect. Instead, added new API - png_set_filter_16() and png_set_add_alpha_16() that set a flag to - make png_do_read_filter() interpret the filler bytes properly. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 36c3bcddc..ef6ce394a 100644 --- a/CHANGES +++ b/CHANGES @@ -5347,7 +5347,7 @@ Version 1.6.19beta02 [August 19, 2015] in ANSI-C (unlike 0x80000000 in the signed case) the checking that occurs later can catch them (John Bowler). -Version 1.6.19beta03 [September 24, 2015] +Version 1.6.19beta03 [September 25, 2015] Fixed png_save_int_32 when int is not 2's complement (John Bowler). Updated libpng16 with all the recent test changes from libpng17, including changes to pngvalid.c to ensure that the original, @@ -5366,11 +5366,6 @@ Version 1.6.19beta03 [September 24, 2015] slightly different error limits this simplifies maintenance. The makepngs.sh script has also been updated to more accurately reflect current problems in libpng 1.7 (John Bowler). - Reverted the fix of byte order in png_do_read_filler() with 16-bit - input that was made in version 1.6.17beta01, to preserve legacy - behavior even though it was incorrect. Instead, added new API - png_set_filter_16() and png_set_add_alpha_16() that set a flag to - make png_do_read_filter() interpret the filler bytes properly. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 37f508363..2e463787d 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -8039,7 +8039,7 @@ image_transform_png_set_filler_set(const image_transform *this, RANDOMIZE(data.filler); data.flags = random_choice(); - png_set_filler_16(pp, data.filler, data.flags); + png_set_filler(pp, data.filler, data.flags); /* The standard display handling stuff also needs to know that * there is a filler, so set that here. @@ -8112,7 +8112,7 @@ image_transform_png_set_add_alpha_set(const image_transform *this, RANDOMIZE(data.filler); data.flags = random_choice(); - png_set_add_alpha_16(pp, data.filler, data.flags); + png_set_add_alpha(pp, data.filler, data.flags); this->next->set(this->next, that, pp, pi); } diff --git a/example.c b/example.c index 902b6c584..f8591e668 100644 --- a/example.c +++ b/example.c @@ -522,7 +522,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ png_set_swap(png_ptr); /* Add filler (or alpha) byte (before/after each RGB triplet) */ - png_set_filler_16(png_ptr, 0xffff, PNG_FILLER_AFTER); + png_set_filler(png_ptr, 0xffff, PNG_FILLER_AFTER); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Turn on interlace handling. REQUIRED if you are not using @@ -958,7 +958,7 @@ void write_png(char *file_name /* , ... other image information ... */) /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels). The second parameter is not used. */ - png_set_filler_16(png_ptr, 0, PNG_FILLER_BEFORE); + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); /* Flip BGR pixels to RGB */ png_set_bgr(png_ptr); diff --git a/libpng-manual.txt b/libpng-manual.txt index 41e0b9600..523eab730 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.19beta03 - September 24, 2015 + libpng version 1.6.19beta03 - September 25, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.19beta03 - September 24, 2015 + libpng versions 0.97, January 1998, through 1.6.19beta03 - September 25, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -1687,19 +1687,16 @@ unless the library has been told to transform it into another format. For example, 4 bit/pixel paletted or grayscale data will be returned 2 pixels/byte with the leftmost pixel in the high-order bits of the byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler_16() or png_set_add_alpha_16() +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() is called to insert filler bytes, either before or after each RGB triplet. 16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant byte of the color value first, unless png_set_scale_16() is called to -transform it to regular RGB RGB triplets, or png_set_filler_16() or -png_set_add alpha_16() is called to insert two filler bytes, either before -or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data -can be modified with png_set_filler_16(), png_set_add_alpha_16(), -png_set_strip_16(), or png_set_scale_16(). Note that png_set_filler_16() -and png_set_add_alpha_16(), which can be used with either 8-bit or 16-bit -images have replaced the png_set_filler() and png_set_add_alpha() functions, -which only work properly with 8-bit data. +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert two filler bytes, either before +or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with png_set_filler(), png_set_add_alpha(), png_set_strip_16(), +or png_set_scale_16(). The following code transforms grayscale images of less than 8 to 8 bits, changes paletted images to RGB, and adds a full alpha channel if there is @@ -1789,7 +1786,7 @@ Within the matrix, "-" means the transformation is not supported. "." means nothing is necessary (a tRNS chunk can just be ignored). "t" means the transformation is obtained by png_set_tRNS. - "A" means the transformation is obtained by png_set_add_alpha_16(). + "A" means the transformation is obtained by png_set_add_alpha(). "X" means the transformation is obtained by png_set_expand(). "1" means the transformation is obtained by png_set_expand_gray_1_2_4_to_8() (and by png_set_expand() @@ -1852,26 +1849,25 @@ PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them into 4 or 8 bytes for windowing systems that need them in this format: if (color_type == PNG_COLOR_TYPE_RGB) - png_set_filler_16(png_ptr, filler, PNG_FILLER_BEFORE); + png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); where "filler" is the 8-bit or 16-bit number to fill with, and the location is either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether -you want the filler before the RGB or after. This transformation -does not affect images that already have full alpha channels. To add an -opaque alpha channel, use filler=0xffff and PNG_FILLER_AFTER which -will generate RGBA pixels. +you want the filler before the RGB or after. When filling an 8-bit pixel, +the least significant 8 bits of the number are used, if a 16-bit number is +supplied. This transformation does not affect images that already have full +alpha channels. To add an opaque alpha channel, use filler=0xffff and +PNG_FILLER_AFTER which will generate RGBA pixels. -Note that png_set_filler_16() does not change the color type. If you want +Note that png_set_filler() does not change the color type. If you want to do that, you can add a true alpha channel with if (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_GRAY) - png_set_add_alpha_16(png_ptr, filler, PNG_FILLER_AFTER); + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); where "filler" contains the alpha value to assign to each pixel. -The png_set_alpha() function was added in libpng-1.2.7 and the -png_set_alpha_16() function, which can be used for either 8-bit or -16-bit images, was added in libpng-1.5.24. +The png_set_add_alpha() function was added in libpng-1.2.7. If you are reading an image with an alpha channel, and you need the data as ARGB instead of the normal PNG format RGBA: @@ -4912,12 +4908,6 @@ limits are now The png_set_option() function (and the "options" member of the png struct) was added to libpng-1.5.15, with option PNG_ARM_NEON. -The png_set_filler_16() and png_set_add_alpha_16() functions were added -at libpng-1.5.24 and libpng-1.6.19. These replace the png_set_filler(() and -the png_set_add_alpha() functions, which did not work properly with 16-bit -images. The new functions can be used with either 8-bit or 16-bit images, -while the old functions are still available for use only with 8-bit images. - The library now supports a complete fixed point implementation and can thus be used on systems that have no floating point support or very limited or slow support. Previously gamma correction, an essential part @@ -5324,7 +5314,7 @@ Other rules can be inferred by inspecting the libpng source. XVI. Y2K Compliance in libpng -September 24, 2015 +September 25, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. diff --git a/libpng.3 b/libpng.3 index ae1e2bcf1..a0cffd892 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "September 24, 2015" +.TH LIBPNG 3 "September 25, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03 .SH SYNOPSIS @@ -277,8 +277,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03 \fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP -\fBvoid png_set_add_alpha_16 (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP - \fBvoid png_set_alpha_mode (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, double \fIoutput_gamma\fP\fB);\fP \fBvoid png_set_alpha_mode_fixed (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, png_fixed_point \fIoutput_gamma\fP\fB);\fP @@ -327,8 +325,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03 \fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP -\fBvoid png_set_filler_16 (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP - \fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP \fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP @@ -512,7 +508,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.19beta03 - September 24, 2015 + libpng version 1.6.19beta03 - September 25, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -523,7 +519,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.19beta03 - September 24, 2015 + libpng versions 0.97, January 1998, through 1.6.19beta03 - September 25, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -2199,19 +2195,16 @@ unless the library has been told to transform it into another format. For example, 4 bit/pixel paletted or grayscale data will be returned 2 pixels/byte with the leftmost pixel in the high-order bits of the byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler_16() or png_set_add_alpha_16() +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() is called to insert filler bytes, either before or after each RGB triplet. 16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant byte of the color value first, unless png_set_scale_16() is called to -transform it to regular RGB RGB triplets, or png_set_filler_16() or -png_set_add alpha_16() is called to insert two filler bytes, either before -or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data -can be modified with png_set_filler_16(), png_set_add_alpha_16(), -png_set_strip_16(), or png_set_scale_16(). Note that png_set_filler_16() -and png_set_add_alpha_16(), which can be used with either 8-bit or 16-bit -images have replaced the png_set_filler() and png_set_add_alpha() functions, -which only work properly with 8-bit data. +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert two filler bytes, either before +or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with png_set_filler(), png_set_add_alpha(), png_set_strip_16(), +or png_set_scale_16(). The following code transforms grayscale images of less than 8 to 8 bits, changes paletted images to RGB, and adds a full alpha channel if there is @@ -2301,7 +2294,7 @@ Within the matrix, "-" means the transformation is not supported. "." means nothing is necessary (a tRNS chunk can just be ignored). "t" means the transformation is obtained by png_set_tRNS. - "A" means the transformation is obtained by png_set_add_alpha_16(). + "A" means the transformation is obtained by png_set_add_alpha(). "X" means the transformation is obtained by png_set_expand(). "1" means the transformation is obtained by png_set_expand_gray_1_2_4_to_8() (and by png_set_expand() @@ -2364,26 +2357,25 @@ PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them into 4 or 8 bytes for windowing systems that need them in this format: if (color_type == PNG_COLOR_TYPE_RGB) - png_set_filler_16(png_ptr, filler, PNG_FILLER_BEFORE); + png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); where "filler" is the 8-bit or 16-bit number to fill with, and the location is either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether -you want the filler before the RGB or after. This transformation -does not affect images that already have full alpha channels. To add an -opaque alpha channel, use filler=0xffff and PNG_FILLER_AFTER which -will generate RGBA pixels. +you want the filler before the RGB or after. When filling an 8-bit pixel, +the least significant 8 bits of the number are used, if a 16-bit number is +supplied. This transformation does not affect images that already have full +alpha channels. To add an opaque alpha channel, use filler=0xffff and +PNG_FILLER_AFTER which will generate RGBA pixels. -Note that png_set_filler_16() does not change the color type. If you want +Note that png_set_filler() does not change the color type. If you want to do that, you can add a true alpha channel with if (color_type == PNG_COLOR_TYPE_RGB || color_type == PNG_COLOR_TYPE_GRAY) - png_set_add_alpha_16(png_ptr, filler, PNG_FILLER_AFTER); + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); where "filler" contains the alpha value to assign to each pixel. -The png_set_alpha() function was added in libpng-1.2.7 and the -png_set_alpha_16() function, which can be used for either 8-bit or -16-bit images, was added in libpng-1.5.24. +The png_set_add_alpha() function was added in libpng-1.2.7. If you are reading an image with an alpha channel, and you need the data as ARGB instead of the normal PNG format RGBA: @@ -5424,12 +5416,6 @@ limits are now The png_set_option() function (and the "options" member of the png struct) was added to libpng-1.5.15, with option PNG_ARM_NEON. -The png_set_filler_16() and png_set_add_alpha_16() functions were added -at libpng-1.5.24 and libpng-1.6.19. These replace the png_set_filler(() and -the png_set_add_alpha() functions, which did not work properly with 16-bit -images. The new functions can be used with either 8-bit or 16-bit images, -while the old functions are still available for use only with 8-bit images. - The library now supports a complete fixed point implementation and can thus be used on systems that have no floating point support or very limited or slow support. Previously gamma correction, an essential part @@ -5836,7 +5822,7 @@ Other rules can be inferred by inspecting the libpng source. .SH XVI. Y2K Compliance in libpng -September 24, 2015 +September 25, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. @@ -6157,7 +6143,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.6.19beta03 - September 24, 2015: +Libpng version 1.6.19beta03 - September 25, 2015: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6180,7 +6166,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 24, 2015, are +libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 25, 2015, are Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: @@ -6274,7 +6260,7 @@ the additional disclaimers inserted at version 1.0.7. Glenn Randers-Pehrson glennrp at users.sourceforge.net -September 24, 2015 +September 25, 2015 .\" end of man page diff --git a/png.h b/png.h index 34fa0254c..b7a284124 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.19beta03, September 24, 2015 + * libpng version 1.6.19beta03, September 25, 2015 * * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -12,7 +12,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.19beta03, September 24, 2015: Glenn + * libpng versions 0.97, January 1998, through 1.6.19beta03, September 25, 2015: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -251,7 +251,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 24, 2015, are + * libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 25, 2015, are * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.0.6 * with the following individuals added to the list of Contributing Authors: @@ -360,7 +360,7 @@ * Y2K compliance in libpng: * ========================= * - * September 24, 2015 + * September 25, 2015 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -430,7 +430,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.6.19beta03" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.6.19beta03 - September 24, 2015\n" + " libpng version 1.6.19beta03 - September 25, 2015\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -1393,20 +1393,14 @@ PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) -/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ +/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); -/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ -PNG_EXPORT(245, void, png_set_filler_16, (png_structrp png_ptr, - png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 -/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ -PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, - png_uint_32 filler, int flags)); /* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ -PNG_EXPORT(246, void, png_set_add_alpha_16, (png_structrp png_ptr, +PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* READ_FILLER || WRITE_FILLER */ @@ -3270,7 +3264,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, * one to use is one more than this.) */ #ifdef PNG_EXPORT_LAST_ORDINAL - PNG_EXPORT_LAST_ORDINAL(246); + PNG_EXPORT_LAST_ORDINAL(244); #endif #ifdef __cplusplus diff --git a/pngpriv.h b/pngpriv.h index 7a549140c..c466d4bfe 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -599,7 +599,6 @@ #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ -#define PNG_FLAG_FILLER_16 0x800000 /* old filler byte order */ /* 0x800000 unused */ /* 0x1000000 unused */ /* 0x2000000 unused */ diff --git a/pngread.c b/pngread.c index 1b1bdbfe5..48aae8488 100644 --- a/pngread.c +++ b/pngread.c @@ -3860,7 +3860,7 @@ png_image_read_direct(png_voidp argument) # endif where = PNG_FILLER_AFTER; - png_set_add_alpha_16(png_ptr, filler, where); + png_set_add_alpha(png_ptr, filler, where); } /* This stops the (irrelevant) call to swap_alpha below. */ diff --git a/pngrtran.c b/pngrtran.c index 208f4ceab..284226aeb 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -2660,17 +2660,10 @@ png_do_read_filler(png_row_infop row_info, png_bytep row, png_uint_32 i; png_uint_32 row_width = row_info->width; - png_byte lo_filler = (png_byte)filler; - #ifdef PNG_READ_16BIT_SUPPORTED png_byte hi_filler = (png_byte)(filler>>8); - if (((flags & PNG_FLAG_FILLER_16) == 0) && row_info->bit_depth == 16) - { - /* filler bytes were read in the wrong order prior to libpng-1.5.24 */ - lo_filler = hi_filler; - hi_filler = (png_byte)filler; - } #endif + png_byte lo_filler = (png_byte)filler; png_debug(1, "in png_do_read_filler"); diff --git a/pngtrans.c b/pngtrans.c index 4e184067d..0c0d92d8f 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -119,17 +119,7 @@ png_set_interlace_handling(png_structrp png_ptr) void PNGAPI png_set_filler(png_structrp png_ptr, png_uint_32 filler, int filler_loc) { - if (png_ptr == NULL) - return; - png_set_filler_16(png_ptr, filler, filler_loc); - png_ptr->flags &= ~PNG_FLAG_FILLER_16; /* Wrong byte order */ -} - -/* Added to libpng-1.5.24 */ -void PNGAPI -png_set_filler_16(png_structrp png_ptr, png_uint_32 filler, int filler_loc) -{ - png_debug(1, "in png_set_filler_16"); + png_debug(1, "in png_set_filler"); if (png_ptr == NULL) return; @@ -149,7 +139,6 @@ png_set_filler_16(png_structrp png_ptr, png_uint_32 filler, int filler_loc) * confusion in the past.) The filler is only used in the read code. */ png_ptr->filler = (png_uint_16)filler; - png_ptr->flags |= PNG_FLAG_FILLER_16; /* Correct byte order */ # else png_app_error(png_ptr, "png_set_filler not supported on read"); PNG_UNUSED(filler) /* not used in the write case */ @@ -213,24 +202,13 @@ png_set_filler_16(png_structrp png_ptr, png_uint_32 filler, int filler_loc) /* Added to libpng-1.2.7 */ void PNGAPI png_set_add_alpha(png_structrp png_ptr, png_uint_32 filler, int filler_loc) -{ - if (png_ptr == NULL) - return; - - png_set_add_alpha_16(png_ptr, filler, filler_loc); - png_ptr->flags &= ~PNG_FLAG_FILLER_16; /* Wrong byte order */ -} - -/* Added to libpng-1.5.24 */ -void PNGAPI -png_set_add_alpha_16(png_structrp png_ptr, png_uint_32 filler, int filler_loc) { png_debug(1, "in png_set_add_alpha"); if (png_ptr == NULL) return; - png_set_filler_16(png_ptr, filler, filler_loc); + png_set_filler(png_ptr, filler, filler_loc); /* The above may fail to do anything. */ if ((png_ptr->transformations & PNG_FILLER) != 0) png_ptr->transformations |= PNG_ADD_ALPHA; diff --git a/pngwrite.c b/pngwrite.c index 992f48b77..2da3f01f3 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -1396,11 +1396,11 @@ png_write_png(png_structrp png_ptr, png_inforp info_ptr, "PNG_TRANSFORM_STRIP_FILLER: BEFORE+AFTER not supported"); /* Continue if ignored - this is the pre-1.6.10 behavior */ - png_set_filler_16(png_ptr, 0, PNG_FILLER_AFTER); + png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); } else if ((transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) != 0) - png_set_filler_16(png_ptr, 0, PNG_FILLER_BEFORE); + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); #else png_app_error(png_ptr, "PNG_TRANSFORM_STRIP_FILLER not supported"); #endif diff --git a/scripts/symbols.def b/scripts/symbols.def index f4e90092f..d36b59035 100644 --- a/scripts/symbols.def +++ b/scripts/symbols.def @@ -249,5 +249,3 @@ EXPORTS png_set_check_for_invalid_index @242 png_get_palette_max @243 png_set_option @244 - png_set_filler_16 @245 - png_set_add_alpha_16 @246