]> granicus.if.org Git - imagemagick/commitdiff
Fixed writing incorrect number of channels for PseudoClass images.
authordirk <dirk@git.imagemagick.org>
Sun, 16 Oct 2016 09:49:08 +0000 (11:49 +0200)
committerdirk <dirk@git.imagemagick.org>
Sun, 16 Oct 2016 09:49:08 +0000 (11:49 +0200)
coders/psd.c

index cdcbe63ea660c38c594eab7f7865064b297f96ca..71cdfedcb1001f8849914bdcb459860c28b0dd55 100644 (file)
@@ -3203,7 +3203,8 @@ static MagickBooleanType WritePSDImage(const ImageInfo *image_info,
     size+=WriteBlobMSBLong(image,(unsigned int) (next_image->page.x+
       next_image->columns));
     channels=1U;
-    if (IsImageGray(next_image) == MagickFalse)
+    if ((next_image->storage_class != PseudoClass) &&
+        (IsImageGray(next_image) == MagickFalse))
       channels=next_image->colorspace == CMYKColorspace ? 4U : 3U;
     total_channels=channels;
     if (next_image->alpha_trait != UndefinedPixelTrait)