]> granicus.if.org Git - imagemagick/commitdiff
Added a note to coders/png.c explaining that ancillary colorspace chunks
authorglennrp <glennrp@git.imagemagick.org>
Mon, 14 May 2012 13:21:17 +0000 (13:21 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Mon, 14 May 2012 13:21:17 +0000 (13:21 +0000)
are now ignored for grayscale images.

coders/png.c

index 2ebc89e4414ceb34d2e0b0c7b5cc7eca74c575c9..37fd9efe10b7ebac3d2fa3a45c1a27a97119cce6 100644 (file)
@@ -2722,9 +2722,15 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
   image->compression=ZipCompression;
   image->columns=ping_width;
   image->rows=ping_height;
+
+  /* Note that the following sets image->gamma to 1.0, image->rendering_intent
+     to Undefined, and resets image->chromaticity, overriding any ancillary
+     chunk data from the PNG file.
+   */
   if (((int) ping_color_type == PNG_COLOR_TYPE_GRAY) ||
       ((int) ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
     SetImageColorspace(image,GRAYColorspace,exception);
+
   if (((int) ping_color_type == PNG_COLOR_TYPE_PALETTE) ||
       ((int) ping_color_type == PNG_COLOR_TYPE_GRAY))
     {