]> granicus.if.org Git - imagemagick/commitdiff
Set attribute when the image contains an acTL chunk to make it possible to detect...
authorDirk Lemstra <dirk@lemstra.org>
Fri, 7 Dec 2018 19:45:16 +0000 (20:45 +0100)
committerDirk Lemstra <dirk@lemstra.org>
Fri, 7 Dec 2018 19:45:37 +0000 (20:45 +0100)
coders/png.c

index d89e85296ce427f279655794915e767ad1134bcc..59c7057ccf56cef80f44b0669ee5d338db794a4a 100644 (file)
@@ -1969,6 +1969,8 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk)
   Image
     *image;
 
+  PNGErrorInfo
+    *error_info;
 
   /* The unknown chunk structure contains the chunk data:
      png_byte name[5];
@@ -1994,9 +1996,6 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk)
     {
       /* process eXIf or exIf chunk */
 
-      PNGErrorInfo
-        *error_info;
-
       (void) LogMagickEvent(CoderEvent,GetMagickModule(),
         " recognized eXIf chunk");
 
@@ -2069,6 +2068,19 @@ static int read_user_chunk_callback(png_struct *ping, png_unknown_chunkp chunk)
       return(1);
     }
 
+  /* acTL */
+  if ((chunk->name[0]  == 97) && (chunk->name[1]  == 99) &&
+      (chunk->name[2]  == 84) && (chunk->name[3]  == 76))
+    {
+      image=(Image *) png_get_user_chunk_ptr(ping);
+      error_info=(PNGErrorInfo *) png_get_error_ptr(ping);
+
+      (void) SetImageProperty(image,"png:acTL","chunk was found",
+        error_info->exception);
+
+      return(1);
+    }
+
   return(0); /* Did not recognize */
 }
 #endif /* PNG_UNKNOWN_CHUNKS_SUPPORTED */