From: Cristy Date: Tue, 29 Dec 2015 19:08:57 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/66 X-Git-Tag: 7.0.1-0~393 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a648c5afc44deeb1b7efdf880c128e015b537932;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/66 --- diff --git a/coders/tiff.c b/coders/tiff.c index 3937e8502..e2dfcee36 100755 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -3361,15 +3361,9 @@ static MagickBooleanType WriteTIFFImage(const ImageInfo *image_info, MagickFalse ? PHOTOMETRIC_MINISWHITE : PHOTOMETRIC_MINISBLACK); (void) TIFFSetField(tiff,TIFFTAG_SAMPLESPERPIXEL,1); - if ((image_info->depth == 0) && - (image->alpha_trait == UndefinedPixelTrait) && - (SetImageMonochrome(image,exception) != MagickFalse)) - { - status=SetQuantumDepth(image,quantum_info,1); - if (status == MagickFalse) - ThrowWriterException(ResourceLimitError, - "MemoryAllocationFailed"); - } + if ((image->depth == 1) && + (image->alpha_trait == UndefinedPixelTrait)) + SetImageMonochrome(image,exception); } else if (image->storage_class == PseudoClass)