]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Tue, 2 Aug 2016 19:23:45 +0000 (15:23 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 2 Aug 2016 19:23:45 +0000 (15:23 -0400)
coders/psd.c

index f243cb588832a5cb37ace2a4275a481fba8fb8f9..3681b17d29ab781a137f2465eb17eae8d18e4a43 100644 (file)
@@ -1847,8 +1847,8 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if (psd_info.mode == CMYKMode)
     {
       SetImageColorspace(image,CMYKColorspace,exception);
-      image->alpha_trait=psd_info.channels > 4 ? BlendPixelTrait :
-        UndefinedPixelTrait;
+      if (psd_info.channels > 4)
+        SetImageAlphaChannel(image,ActivateAlphaChannel,exception);
     }
   else if ((psd_info.mode == BitmapMode) || (psd_info.mode == GrayscaleMode) ||
       (psd_info.mode == DuotoneMode))
@@ -1861,12 +1861,12 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
         (void) LogMagickEvent(CoderEvent,GetMagickModule(),
           "  Image colormap allocated");
       SetImageColorspace(image,GRAYColorspace,exception);
-      image->alpha_trait=psd_info.channels > 1 ? BlendPixelTrait :
-        UndefinedPixelTrait;
+      if (psd_info.channels > 1)
+        SetImageAlphaChannel(image,ActivateAlphaChannel,exception);
     }
   else
-    image->alpha_trait=psd_info.channels > 3 ? BlendPixelTrait :
-      UndefinedPixelTrait;
+    if (psd_info.channels > 3)
+      SetImageAlphaChannel(image,ActivateAlphaChannel,exception);
   /*
     Read PSD raster colormap only present for indexed and duotone images.
   */