]> granicus.if.org Git - imagemagick/commitdiff
https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=30043
authorCristy <urban-warrior@imagemagick.org>
Sat, 9 Jul 2016 20:46:48 +0000 (16:46 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 9 Jul 2016 20:46:48 +0000 (16:46 -0400)
coders/png.c

index 97c05a26319a9276ba9c8ee3c93cc3012772798e..3043a8419bb472a0730ad728d5e9d893a35e0a9f 100644 (file)
@@ -3119,6 +3119,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
       /* This happens later in non-ping decodes */
       if (png_get_valid(ping,ping_info,PNG_INFO_tRNS))
         image->storage_class=DirectClass;
+      image->alpha_trait=
+        (((int) ping_color_type == PNG_COLOR_TYPE_RGB_ALPHA) ||
+         ((int) ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ||
+         (png_get_valid(ping,ping_info,PNG_INFO_tRNS))) ?
+        BlendPixelTrait : UndefinedPixelTrait;
 
       if (logging != MagickFalse)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),