Revert "Remove second call to write_eXIf"
The second call to png_write_eXIf should not have been removed.
The first call to png_write_eXIf is for writing the eXIf chunk that is
positioned before IDAT, while the second call is for writing the eXIf
chunk that is positioned after IDAT.
TODO:
Implement a correct fix which consists in ensuring that there are no
eXIf chunks simultaneously before and after IDAT.
This reverts commit cd03aaf7bf0e0c748b8c6cb34a56b402b40d61d0.
diff --git a/pngwrite.c b/pngwrite.c
index abbca55..06c45d1 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -438,6 +438,11 @@
}
#endif
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+ if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+ png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+#endif
+
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT);
#endif