From 3d57708c9166419b7f5e0bbda2f7a2149112c844 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Wed, 14 Sep 2022 22:00:42 +0300 Subject: 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. --- pngwrite.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pngwrite.c b/pngwrite.c index abbca558f..06c45d16a 100644 --- a/pngwrite.c +++ b/pngwrite.c @@ -438,6 +438,11 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr) } #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 -- cgit v1.2.1