GraphicsMagick: PNG: Fixes for writing/reading EXIF. Especially...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.5155.1679181376.1409.graphicsmagick-commit@lists.sourceforge.net>
changeset 60b132017fce in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=60b132017fce
summary: PNG: Fixes for writing/reading EXIF.  Especially for libpng 1.6.31 or later.

diffstat:

 ChangeLog          |  5 +++++
 coders/png.c       |  9 ++++++---
 www/Changelog.html |  7 +++++++
 3 files changed, 18 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r ce1d625ff845 -r 60b132017fce ChangeLog
--- a/ChangeLog	Sat Mar 18 10:12:16 2023 -0500
+++ b/ChangeLog	Sat Mar 18 18:16:06 2023 -0500
@@ -1,3 +1,8 @@
+2023-03-18  Fojtik Jaroslav  <[email protected]>
+
+	* coders/png.c There were 2 defects that prevented eXIf chunk
+        to be read.
+
 2023-03-18  Fojtik Jaroslav  <[email protected]>
 
 	* coders/png.c Variable "png_byte unused_chunks" should be const
diff -r ce1d625ff845 -r 60b132017fce coders/png.c
--- a/coders/png.c	Sat Mar 18 10:12:16 2023 -0500
+++ b/coders/png.c	Sat Mar 18 18:16:06 2023 -0500
@@ -1396,8 +1396,8 @@
       s=chunk->data;
 
       if (chunk->size > 6 &&
-          (s[0] == 'E' || s[1] == 'x' || s[2] == 'i' ||
-           s[3] == 'f' || s[4] == '\0' || s[5] == '\0'))
+          (s[0] == 'E' && s[1] == 'x' && s[2] == 'i' &&
+           s[3] == 'f' && s[4] == '\0' && s[5] == '\0'))
         {
           /*
             Skip over "Exif\0\0" if already present
@@ -1577,6 +1577,9 @@
       115,  67,  65,  76, '\0',   /* sCAL */
       115,  80,  76,  84, '\0',   /* sPLT */
       116,  73,  77,  69, '\0',   /* tIME */
+#ifdef PNG_READ_eXIf_SUPPORTED /* Enforce custom eXIf processing to override default one. */
+      101,  88,  73, 102, '\0',   /* eXIf*/
+#endif
 #ifdef PNG_APNG_SUPPORTED /* libpng was built with APNG patch; */
                           /* ignore the APNG chunks */
        97,  99,  84,  76, '\0',   /* acTL */
@@ -1959,7 +1962,7 @@
                                 intent+1);
       }
   }
-#endif
+#endif /* if defined(PNG_READ_sRGB_SUPPORTED) */
   {
     double
       file_gamma;
diff -r ce1d625ff845 -r 60b132017fce www/Changelog.html
--- a/www/Changelog.html	Sat Mar 18 10:12:16 2023 -0500
+++ b/www/Changelog.html	Sat Mar 18 18:16:06 2023 -0500
@@ -40,6 +40,13 @@
 <p>2023-03-18  Fojtik Jaroslav  &lt;<a class="reference external" href="mailto:JaFojtik&#37;&#52;&#48;yandex&#46;com">JaFojtik<span>&#64;</span>yandex<span>&#46;</span>com</a>&gt;</p>
 <blockquote>
 <ul class="simple">
+<li><p>coders/png.c There were 2 defects that prevented eXIf chunk
+to be read.</p></li>
+</ul>
+</blockquote>
+<p>2023-03-18  Fojtik Jaroslav  &lt;<a class="reference external" href="mailto:JaFojtik&#37;&#52;&#48;yandex&#46;com">JaFojtik<span>&#64;</span>yandex<span>&#46;</span>com</a>&gt;</p>
+<blockquote>
+<ul class="simple">
 <li><p>coders/png.c Variable &quot;png_byte unused_chunks&quot; should be const
 and not be placed on a stack.</p></li>
 </ul>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.