]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 1 Sep 2011 01:43:15 +0000 (01:43 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 1 Sep 2011 01:43:15 +0000 (01:43 +0000)
MagickCore/cache.c
coders/miff.c

index caf9d99f9ac930f6565e2e6431ba0e8626f4629f..5c11862d9364947d2ea4ad40e50bc54f6a374778 100644 (file)
@@ -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);
     }
index b4dbd1e9c1b137084aa2c22dcd469402409f69e2..4830bc563140b605327198637a58637625335280 100644 (file)
@@ -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)