]> granicus.if.org Git - imagemagick/commitdiff
Don't write ancillary chunks in PNG-encoded ICO files.
authorglennrp <glennrp@git.imagemagick.org>
Tue, 17 Jan 2012 21:35:21 +0000 (21:35 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Tue, 17 Jan 2012 21:35:21 +0000 (21:35 +0000)
coders/icon.c
coders/png.c

index 3fdc256909781c184032228268d0ee844a98202e..9dd025ea17ac6a06d76adc875f3dbd9aef9a0c64 100644 (file)
@@ -40,6 +40,7 @@
   Include declarations.
 */
 #include "MagickCore/studio.h"
+#include "MagickCore/artifact.h"
 #include "MagickCore/blob.h"
 #include "MagickCore/blob-private.h"
 #include "MagickCore/cache.h"
@@ -883,6 +884,11 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info,
           return(MagickFalse);
         write_info=CloneImageInfo(image_info);
         (void) CopyMagickString(write_info->filename,"PNG:",MaxTextExtent);
+
+        /* Don't write any ancillary chunks except for gAMA and tRNS */
+        (void) SetImageArtifact(write_image,"png:include-chunk",
+           "none,trns,gama");
+
         png=(unsigned char *) ImageToBlob(write_info,write_image,&length,
           exception);
         write_image=DestroyImage(write_image);
index 6c728063dd73e0f8993b10015ffa60ec25fd60da..28afe940075afc540e4aa7314a447aad238a0633 100644 (file)
@@ -11113,7 +11113,9 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info,
    * well as a comma-separated list.  Chunks that are unknown to
    * ImageMagick are always excluded, regardless of their "copy-safe"
    * status according to the PNG specification, and even if they
-   * appear in the "include-chunk" list.
+   * appear in the "include-chunk" list. Such defines appearing among
+   * the image options take priority over those found among the image
+   * artifacts.
    *
    * Finally, all chunks listed in the "unused_chunks" array are
    * automatically excluded, regardless of the other instructions