]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 7 Apr 2013 01:19:28 +0000 (01:19 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 7 Apr 2013 01:19:28 +0000 (01:19 +0000)
coders/miff.c

index a05e736e9b646c6eaf8918009f83f85e6da15cfb..38a8b10538e43d2f22ba30800c49a2d7b9b7ca56 100644 (file)
@@ -1951,8 +1951,11 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
     /*
       Allocate image pixels.
     */
-    image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL :
-      image->depth <= 32 ? 32UL : 64UL;
+    if ((image->storage_class == PseudoClass) &&
+        (image->colors > (size_t) (GetQuantumRange(image->depth)+1)))
+      (void) SetImageStorageClass(image,DirectClass,exception);
+    if (IsImageGray(image,exception) != MagickFalse)
+      (void) SetImageColorspace(image,GRAYColorspace,exception);
     image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL :
       image->depth <= 32 ? 32UL : 64UL;
     quantum_info=AcquireQuantumInfo(image_info,image);