summaryrefslogtreecommitdiff
path: root/pngtest.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-07-31 14:20:40 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-07-31 14:21:46 -0500
commit40afb685704f1a5bf8d9edc0b5c7ec7f25e94b77 (patch)
treefd230ed1d47cdb8bde8055284494bda7f8256484 /pngtest.c
parent4ab78af90a0f54665a8c1aca16745d2f641c7efb (diff)
[libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf()
in pngwrite.c, and made various other fixes to png_write_eXIf(). Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif to arguments for png_get_eXIf() and png_set_eXIf().
Diffstat (limited to 'pngtest.c')
-rw-r--r--pngtest.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/pngtest.c b/pngtest.c
index 68b5895d2..0b091fa51 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1195,9 +1195,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#ifdef PNG_eXIf_SUPPORTED
{
png_bytep exif;
+ png_uint_32 exif_length;
- if (png_get_eXIf(read_ptr, read_info_ptr, &exif) != 0)
- png_set_eXIf(write_ptr, write_info_ptr, exif);
+ if (png_get_eXIf(read_ptr, read_info_ptr, &exif_length, &exif) != 0)
+ {
+ printf(" eXIf type %c%c, %d bytes\n",exif[0],exif[1],
+ (int)exif_length);
+ png_set_eXIf(write_ptr, write_info_ptr, exif_length, exif);
+ }
}
#endif
#ifdef PNG_hIST_SUPPORTED
@@ -1406,6 +1411,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
write_chunks(write_ptr, before_IDAT); /* after PLTE */
+ png_write_info(write_ptr, write_end_info_ptr);
+
+ write_chunks(write_ptr, after_IDAT); /* after IDAT */
+
#ifdef PNG_COMPRESSION_COMPAT
/* Test the 'compatibility' setting here, if it is available. */
png_set_compression(write_ptr, PNG_COMPRESSION_COMPAT);
@@ -1541,9 +1550,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#ifdef PNG_eXIf_SUPPORTED
{
png_bytep exif;
+ png_uint_32 exif_length;
- if (png_get_eXIf(read_ptr, end_info_ptr, &exif) != 0)
- png_set_eXIf(write_ptr, write_end_info_ptr, exif);
+ if (png_get_eXIf(read_ptr, end_info_ptr, &exif_length, &exif) != 0)
+ {
+ printf(" eXIf type %c%c, %d bytes\n",exif[0],exif[1],
+ (int)exif_length);
+ png_set_eXIf(write_ptr, write_end_info_ptr, exif_length, exif);
+ }
}
#endif
#ifdef PNG_tIME_SUPPORTED