From: dirk Date: Mon, 26 Sep 2016 18:22:31 +0000 (+0200) Subject: Fixed incorrect channel count when writing PseudoClass images. X-Git-Tag: 7.0.3-2~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e138aaf8ed8ad69bc11a009571780aebe474cb98;p=imagemagick Fixed incorrect channel count when writing PseudoClass images. --- diff --git a/coders/psd.c b/coders/psd.c index b425a5a35..4cf7548a3 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -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));