]> granicus.if.org Git - imagemagick/commitdiff
PNG, accept EXIF without magic header
authorCristy <urban-warrior@imagemagick.org>
Sat, 25 Nov 2017 22:55:43 +0000 (17:55 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 25 Nov 2017 22:55:43 +0000 (17:55 -0500)
coders/png.c
configure

index 1089ff001d00c022123c1129c5973ac1e5f60b23..68aa0a934226aa518917a315095f02e0897f3cf4 100644 (file)
@@ -11744,15 +11744,20 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
                     break;  /* otherwise crashes */
                   }
 
-                /* skip the "Exif\0\0" JFIF Exif Header ID */
-                length -= 6;
+                if (*data == 'E' && *(data+1) == 'x' && *(data+2) == 'i' &&
+                    *(data+3) == 'f' && *(data+4) == '\0' && *(data+5) == '\0')
+                  {
+                    /* skip the "Exif\0\0" JFIF Exif Header ID */
+                    length -= 6;
+                    data += 6;
+                  }
 
                 LogPNGChunk(logging,chunk,length);
                 (void) WriteBlobMSBULong(image,length);
                 (void) WriteBlob(image,4,chunk);
-                (void) WriteBlob(image,length,data+6);
-                (void) WriteBlobMSBULong(image,crc32(crc32(0,chunk,4),
-                  data+6, (uInt) length));
+                (void) WriteBlob(image,length,data);
+                (void) WriteBlobMSBULong(image,crc32(crc32(0,chunk,4), data,
+                  (uInt) length));
                 ping_profile=DestroyStringInfo(ping_profile);
                 break;
              }
index 0767330cfbbb1e97551db706f2f77163c05ee090..c1794fd1f64831ae13ca3344abdb71f6dedaf760 100755 (executable)
--- a/configure
+++ b/configure
@@ -4559,7 +4559,7 @@ MAGICK_PATCHLEVEL_VERSION=12
 
 MAGICK_VERSION=7.0.7-12
 
-MAGICK_GIT_REVISION=21775:a886ad39e:20171124
+MAGICK_GIT_REVISION=21786:0ee44fcdb:20171125
 
 
 # Substitute library versioning