[libpng17] Completed full working pngimage test program and added two test

scripts.  Fixed combination of ~alpha with shift. On read invert alpha,
processing occurred after shift processing, which causes the final values to be
outside the range that should be produced by the shift. Reversing the
order on read makes the two transforms work together correctly and mirrors
the order used on write.
This commit is contained in:
John Bowler 2014-02-05 11:39:59 -06:00 committed by Glenn Randers-Pehrson
parent cf354c2c82
commit dc63b03da1
7 changed files with 1509 additions and 184 deletions

View File

@ -509,6 +509,12 @@ Version 1.7.0beta31 [February 5, 2014]
upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling
png_set_packing() in png_read_png().
Completed full working pngimage test program and added two test scripts.
Fixed combination of ~alpha with shift. On read invert alpha, processing
occurred after shift processing, which causes the final values to be
outside the range that should be produced by the shift. Reversing the
order on read makes the two transforms work together correctly and mirrors
the order used on write.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -4798,6 +4798,12 @@ Version 1.7.0beta31 [February 5, 2014]
upon PNG_READ_SUPPORTED and PNG_WRITE_SUPPORTED.
Removed dependence on !PNG_READ_EXPAND_SUPPORTED for calling
png_set_packing() in png_read_png().
Completed full working pngimage test program and added two test scripts.
Fixed combination of ~alpha with shift. On read invert alpha, processing
occurred after shift processing, which causes the final values to be
outside the range that should be produced by the shift. Reversing the
order on read makes the two transforms work together correctly and mirrors
the order used on write.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -62,7 +62,8 @@ TESTS =\
tests/pngstest-4a16 tests/pngstest-6a08 tests/pngstest-6a16\
tests/pngstest-error tests/pngunknown-IDAT\
tests/pngunknown-discard tests/pngunknown-if-safe tests/pngunknown-sAPI\
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg
tests/pngunknown-sTER tests/pngunknown-save tests/pngunknown-vpAg\
tests/pngimage-quick tests/pngimage-full
# These tests are expected, and required, to fail:
XFAIL_TESTS = tests/pngstest-error

File diff suppressed because it is too large Load Diff

View File

@ -1506,12 +1506,12 @@ png_init_read_transformations(png_structrp png_ptr)
* 12) PNG_EXPAND_16
* 13) PNG_GRAY_TO_RGB iff PNG_FLAG_BACKGROUND_IS_GRAY
* 14) PNG_INVERT_MONO
* 15) PNG_SHIFT
* 16) PNG_PACK
* 17) PNG_BGR
* 18) PNG_PACKSWAP
* 19) PNG_FILLER (includes PNG_ADD_ALPHA)
* 20) PNG_INVERT_ALPHA
* 15) PNG_INVERT_ALPHA
* 16) PNG_SHIFT
* 17) PNG_PACK
* 18) PNG_BGR
* 19) PNG_PACKSWAP
* 20) PNG_FILLER (includes PNG_ADD_ALPHA)
* 21) PNG_SWAP_ALPHA
* 22) PNG_SWAP_BYTES
* 23) PNG_USER_TRANSFORM [must be last]
@ -4802,6 +4802,11 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
png_do_invert(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
if (png_ptr->transformations & PNG_INVERT_ALPHA)
png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_READ_SHIFT_SUPPORTED
if (png_ptr->transformations & PNG_SHIFT)
png_do_unshift(row_info, png_ptr->row_buf + 1,
@ -4836,11 +4841,6 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
(png_uint_32)png_ptr->filler, png_ptr->flags);
#endif
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
if (png_ptr->transformations & PNG_INVERT_ALPHA)
png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
#endif
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
if (png_ptr->transformations & PNG_SWAP_ALPHA)
png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1);

2
tests/pngimage-full Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec ./pngimage --exhaustive --log "${srcdir}/contrib/pngsuite/"*.png

2
tests/pngimage-quick Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec ./pngimage --log "${srcdir}/contrib/pngsuite/"*.png