[libpng16] Added sPLT support to pngtest.c

This commit is contained in:
Glenn Randers-Pehrson 2015-10-10 12:05:55 -05:00
parent 5bd9d66098
commit 59e655b020
3 changed files with 41 additions and 10 deletions

View File

@ -1,4 +1,4 @@
Libpng 1.6.19beta04 - October 3, 2015 Libpng 1.6.19beta04 - October 10, 2015
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.
@ -92,7 +92,7 @@ Version 1.6.19beta03 [September 26, 2015]
warning, updated pngstest-errors.h for the errors detected with the warning, updated pngstest-errors.h for the errors detected with the
new contrib/testspngs PNG test files (John Bowler). new contrib/testspngs PNG test files (John Bowler).
Version 1.6.19beta04 [October 3, 2015] Version 1.6.19beta04 [October 10, 2015]
Worked around rgb-to-gray issues in libpng 1.6. The previous Worked around rgb-to-gray issues in libpng 1.6. The previous
attempts to ignore the errors in the code aren't quite enough to attempts to ignore the errors in the code aren't quite enough to
deal with the 'channel selection' encoding added to libpng 1.7; abort. deal with the 'channel selection' encoding added to libpng 1.7; abort.
@ -101,6 +101,7 @@ Version 1.6.19beta04 [October 3, 2015]
directives. Make sure pow is a function where this happens. This is directives. Make sure pow is a function where this happens. This is
a minimal safe fix, the issue only arises in non-performance-critical a minimal safe fix, the issue only arises in non-performance-critical
code (bug report by Curtis Leach, fix by John Bowler). code (bug report by Curtis Leach, fix by John Bowler).
Added sPLT support to pngtest.c
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

@ -5375,7 +5375,7 @@ Version 1.6.19beta03 [September 26, 2015]
warning, updated pngstest-errors.h for the errors detected with the warning, updated pngstest-errors.h for the errors detected with the
new contrib/testspngs PNG test files (John Bowler). new contrib/testspngs PNG test files (John Bowler).
Version 1.6.19beta04 [October 3, 2015] Version 1.6.19beta04 [October 10, 2015]
Worked around rgb-to-gray issues in libpng 1.6. The previous Worked around rgb-to-gray issues in libpng 1.6. The previous
attempts to ignore the errors in the code aren't quite enough to attempts to ignore the errors in the code aren't quite enough to
deal with the 'channel selection' encoding added to libpng 1.7; abort. deal with the 'channel selection' encoding added to libpng 1.7; abort.
@ -5385,6 +5385,7 @@ Version 1.6.19beta04 [October 3, 2015]
directives. Make sure pow is a function where this happens. This is directives. Make sure pow is a function where this happens. This is
a minimal safe fix, the issue only arises in non-performance-critical a minimal safe fix, the issue only arises in non-performance-critical
code (bug report by Curtis Leach, fix by John Bowler). code (bug report by Curtis Leach, fix by John Bowler).
Added sPLT support to pngtest.c
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 @@
/* pngtest.c - a simple test program to test libpng /* pngtest.c - a simple test program to test libpng
* *
* Last changed in libpng 1.6.18 [July 23, 2015] * Last changed in libpng 1.6.19 [(PENDING RELEASE)]
* Copyright (c) 1998-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2015 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.)
@ -60,6 +60,7 @@
defined PNG_READ_pHYs_SUPPORTED &&\ defined PNG_READ_pHYs_SUPPORTED &&\
defined PNG_READ_sBIT_SUPPORTED &&\ defined PNG_READ_sBIT_SUPPORTED &&\
defined PNG_READ_sCAL_SUPPORTED &&\ defined PNG_READ_sCAL_SUPPORTED &&\
defined PNG_READ_sPLT_SUPPORTED &&\
defined PNG_READ_sRGB_SUPPORTED &&\ defined PNG_READ_sRGB_SUPPORTED &&\
defined PNG_READ_tEXt_SUPPORTED &&\ defined PNG_READ_tEXt_SUPPORTED &&\
defined PNG_READ_tIME_SUPPORTED &&\ defined PNG_READ_tIME_SUPPORTED &&\
@ -1076,6 +1077,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
} }
} }
#ifdef PNG_FIXED_POINT_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED
#ifdef PNG_cHRM_SUPPORTED #ifdef PNG_cHRM_SUPPORTED
{ {
@ -1090,6 +1092,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
} }
#endif #endif
#ifdef PNG_gAMA_SUPPORTED #ifdef PNG_gAMA_SUPPORTED
{ {
png_fixed_point gamma; png_fixed_point gamma;
@ -1123,6 +1126,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#endif /* Floating point */ #endif /* Floating point */
#endif /* Fixed point */ #endif /* Fixed point */
#ifdef PNG_iCCP_SUPPORTED #ifdef PNG_iCCP_SUPPORTED
{ {
png_charp name; png_charp name;
@ -1138,6 +1142,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
} }
#endif #endif
#ifdef PNG_sRGB_SUPPORTED #ifdef PNG_sRGB_SUPPORTED
{ {
int intent; int intent;
@ -1146,6 +1151,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_set_sRGB(write_ptr, write_info_ptr, intent); png_set_sRGB(write_ptr, write_info_ptr, intent);
} }
#endif #endif
{ {
png_colorp palette; png_colorp palette;
int num_palette; int num_palette;
@ -1153,6 +1159,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette) != 0) if (png_get_PLTE(read_ptr, read_info_ptr, &palette, &num_palette) != 0)
png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette); png_set_PLTE(write_ptr, write_info_ptr, palette, num_palette);
} }
#ifdef PNG_bKGD_SUPPORTED #ifdef PNG_bKGD_SUPPORTED
{ {
png_color_16p background; png_color_16p background;
@ -1163,6 +1170,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
} }
#endif #endif
#ifdef PNG_hIST_SUPPORTED #ifdef PNG_hIST_SUPPORTED
{ {
png_uint_16p hist; png_uint_16p hist;
@ -1171,6 +1179,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_set_hIST(write_ptr, write_info_ptr, hist); png_set_hIST(write_ptr, write_info_ptr, hist);
} }
#endif #endif
#ifdef PNG_oFFs_SUPPORTED #ifdef PNG_oFFs_SUPPORTED
{ {
png_int_32 offset_x, offset_y; png_int_32 offset_x, offset_y;
@ -1183,6 +1192,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
} }
#endif #endif
#ifdef PNG_pCAL_SUPPORTED #ifdef PNG_pCAL_SUPPORTED
{ {
png_charp purpose, units; png_charp purpose, units;
@ -1198,6 +1208,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
} }
#endif #endif
#ifdef PNG_pHYs_SUPPORTED #ifdef PNG_pHYs_SUPPORTED
{ {
png_uint_32 res_x, res_y; png_uint_32 res_x, res_y;
@ -1208,6 +1219,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type); png_set_pHYs(write_ptr, write_info_ptr, res_x, res_y, unit_type);
} }
#endif #endif
#ifdef PNG_sBIT_SUPPORTED #ifdef PNG_sBIT_SUPPORTED
{ {
png_color_8p sig_bit; png_color_8p sig_bit;
@ -1216,6 +1228,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_set_sBIT(write_ptr, write_info_ptr, sig_bit); png_set_sBIT(write_ptr, write_info_ptr, sig_bit);
} }
#endif #endif
#ifdef PNG_sCAL_SUPPORTED #ifdef PNG_sCAL_SUPPORTED
#if defined(PNG_FLOATING_POINT_SUPPORTED) && \ #if defined(PNG_FLOATING_POINT_SUPPORTED) && \
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
@ -1242,9 +1255,22 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
scal_height); scal_height);
} }
} }
#endif #endif /* FIXED_POINT */
#endif #endif /* FLOATING_POINT */
#endif #endif /* sCAL */
#ifdef PNG_sPLT_SUPPORTED
{
png_sPLT_tp entries;
int num_entries = (int) png_get_sPLT(read_ptr, read_info_ptr, &entries);
if (num_entries)
{
png_set_sPLT(write_ptr, write_info_ptr, entries, num_entries);
}
}
#endif /* sPLT */
#ifdef PNG_TEXT_SUPPORTED #ifdef PNG_TEXT_SUPPORTED
{ {
png_textp text_ptr; png_textp text_ptr;
@ -1271,7 +1297,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); png_set_text(write_ptr, write_info_ptr, text_ptr, num_text);
} }
} }
#endif #endif /* TEXT */
#ifdef PNG_tIME_SUPPORTED #ifdef PNG_tIME_SUPPORTED
{ {
png_timep mod_time; png_timep mod_time;
@ -1293,7 +1320,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif /* TIME_RFC1123 */ #endif /* TIME_RFC1123 */
} }
} }
#endif #endif /* tIME */
#ifdef PNG_tRNS_SUPPORTED #ifdef PNG_tRNS_SUPPORTED
{ {
png_bytep trans_alpha; png_bytep trans_alpha;
@ -1315,7 +1343,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
trans_color); trans_color);
} }
} }
#endif #endif /* tRNS */
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
{ {
png_unknown_chunkp unknowns; png_unknown_chunkp unknowns;