[devel] Fixed bug with stripping the filler or alpha channel when writing,

that was introduced in libpng-1.5.2beta01.
This commit is contained in:
Glenn Randers-Pehrson 2011-04-16 19:27:34 -05:00
parent 8d4ce1fed5
commit cb1aee2506
4 changed files with 38 additions and 6 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.5.3beta03 - April 3, 2011 Libpng 1.5.3beta03 - April 17, 2011
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -38,7 +38,21 @@ Version 1.5.3beta02 [April 3, 2011]
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03). Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
Optimize the zlib CMF byte in non-IDAT compressed chunks Optimize the zlib CMF byte in non-IDAT compressed chunks
Version 1.5.3beta03 [April 3, 2011] Version 1.5.3beta03 [April 17, 2011]
Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have
snprintf, and the "__STRICT_ANSI__" detects that condition more reliably
than __STDC__ (John Bowler).
Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells
the compiler that a user supplied callback (the error handler) does not
return, yet there is no guarantee in practice that the application code
will correctly implement the error handler because the compiler only
issues a warning if there is a mistake (John Bowler).
Removed the no-longer-used PNG_DEPSTRUCT macro.
Updated the zlib version to 1.2.5 in the VStudio project.
Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in
pngwutil.c (John Bowler).
Fixed bug with stripping the filler or alpha channel when writing, that
was introduced in libpng-1.5.2beta01.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net: Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit (subscription required; visit

16
CHANGES
View File

@ -3299,7 +3299,21 @@ Version 1.5.3beta02 [April 3, 2011]
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03). Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
Optimize the zlib CMF byte in non-IDAT compressed chunks Optimize the zlib CMF byte in non-IDAT compressed chunks
Version 1.5.3beta03 [April 3, 2011] Version 1.5.3beta03 [April 17, 2011]
Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have
snprintf, and the "__STRICT_ANSI__" detects that condition more reliably
than __STDC__ (John Bowler).
Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells
the compiler that a user supplied callback (the error handler) does not
return, yet there is no guarantee in practice that the application code
will correctly implement the error handler because the compiler only
issues a warning if there is a mistake (John Bowler).
Removed the no-longer-used PNG_DEPSTRUCT macro.
Updated the zlib version to 1.2.5 in the VStudio project.
Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in
pngwutil.c (John Bowler).
Fixed bug with stripping the filler or alpha channel when writing, that
was introduced in libpng-1.5.2beta01.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers) /* pngtrans.c - transforms the data in a row (used by both readers and writers)
* *
* Last changed in libpng 1.5.2 [March 31, 2011] * Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -442,7 +442,11 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
/* At the start sp will point to the first byte to copy and dp to where /* At the start sp will point to the first byte to copy and dp to where
* it is copied to. ep always points just beyond the end of the row, so * it is copied to. ep always points just beyond the end of the row, so
* the loop simply copies (channels-1) channels until sp reaches ep. * the loop simply copies (channels-1) channels until sp reaches ep.
*
* at_start: 0 -- convert AG, XG, ARGB, XRGB, AAGG, XXGG, etc.
* : nonzero -- convert GA, GX, RGBA, RGBX, GGAA, RRGGBBXX, etc.
*/ */
/* GA, GX, XG cases */ /* GA, GX, XG cases */
if (row_info->channels == 2) if (row_info->channels == 2)
{ {

View File

@ -1,7 +1,7 @@
/* pngwtran.c - transforms the data in a row for PNG writers /* pngwtran.c - transforms the data in a row for PNG writers
* *
* Last changed in libpng 1.5.2 [March 31, 2011] * Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -45,7 +45,7 @@ png_do_write_transformations(png_structp png_ptr)
#ifdef PNG_WRITE_FILLER_SUPPORTED #ifdef PNG_WRITE_FILLER_SUPPORTED
if (png_ptr->transformations & PNG_FILLER) if (png_ptr->transformations & PNG_FILLER)
png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1, png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FILLER_AFTER)); !(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
#endif #endif
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED #ifdef PNG_WRITE_PACKSWAP_SUPPORTED