From: cristy Date: Thu, 1 Sep 2011 01:43:15 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a30e1843b1bd833e6ea8487d2fb176e79c14535;p=imagemagick --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index caf9d99f9..5c11862d9 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -2079,8 +2079,6 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone, */ image->taint=MagickTrue; image->type=UndefinedType; - if (1 && image->colorspace == GRAYColorspace) - image->colorspace=RGBColorspace; if (ValidatePixelCacheMorphology(image) == MagickFalse) status=OpenPixelCache(image,IOMode,exception); } diff --git a/coders/miff.c b/coders/miff.c index b4dbd1e9c..4830bc563 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -1205,6 +1205,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info, packet_size=(size_t) (quantum_info->depth/8); if (image->storage_class == DirectClass) packet_size=(size_t) (3*quantum_info->depth/8); + if (image->colorspace == GRAYColorspace) + packet_size=quantum_info->depth/8; if (image->matte != MagickFalse) packet_size+=quantum_info->depth/8; if (image->colorspace == CMYKColorspace) @@ -1921,6 +1923,9 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, packet_size=(size_t) (quantum_info->depth/8); if (image->storage_class == DirectClass) packet_size=(size_t) (3*quantum_info->depth/8); + if ((image->colorspace != sRGBColorspace) && + (IsImageGray(image,exception) != MagickFalse)) + packet_size=(size_t) (quantum_info->depth/8); if (image->matte != MagickFalse) packet_size+=quantum_info->depth/8; if (image->colorspace == CMYKColorspace) @@ -2056,9 +2061,8 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info, } if (image->rendering_intent != UndefinedIntent) { - (void) FormatLocaleString(buffer,MaxTextExtent, - "rendering-intent=%s\n", - CommandOptionToMnemonic(MagickIntentOptions,image->rendering_intent)); + (void) FormatLocaleString(buffer,MaxTextExtent,"rendering-intent=%s\n", + CommandOptionToMnemonic(MagickIntentOptions,image->rendering_intent)); (void) WriteBlobString(image,buffer); } if (image->gamma != 0.0)