]> granicus.if.org Git - imagemagick/commitdiff
Fixed incorrect channel count when writing PseudoClass images.
authordirk <dirk@git.imagemagick.org>
Mon, 26 Sep 2016 18:22:31 +0000 (20:22 +0200)
committerdirk <dirk@git.imagemagick.org>
Mon, 26 Sep 2016 18:22:31 +0000 (20:22 +0200)
coders/psd.c

index b425a5a356949e3018010c5864b15080bf04bbbe..4cf7548a3ebb6d8cb6e65209ea6d23864e5e5cbd 100644 (file)
@@ -2563,10 +2563,13 @@ static MagickBooleanType WriteImageChannels(const PSDInfo *psd_info,
   channels=1;
   if (separate == MagickFalse)
     {
-      if (IsImageGray(next_image) == MagickFalse)
-        channels=next_image->colorspace == CMYKColorspace ? 4 : 3;
-      if (next_image->alpha_trait != UndefinedPixelTrait)
-        channels++;
+      if (image->storage_class != PseudoClass)
+        {
+          if (IsImageGray(next_image) == MagickFalse)
+            channels=next_image->colorspace == CMYKColorspace ? 4 : 3;
+          if (next_image->alpha_trait != UndefinedPixelTrait)
+            channels++;
+        }
       rows_offset=TellBlob(image)+2;
       count+=WriteCompressionStart(psd_info,image,next_image,channels);
       offset_length=(next_image->rows*(psd_info->version == 1 ? 2 : 4));