]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 8 Aug 2012 13:41:59 +0000 (13:41 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 8 Aug 2012 13:41:59 +0000 (13:41 +0000)
MagickCore/quantize.c

index 0a2621b1addfd585d02c84f31a45eb98acf019f3..87d08d502a9babb3f265d2a99f3dd9009a327663 100644 (file)
@@ -2737,11 +2737,13 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info,
     maximum_colors=MaxColormapSize;
   if (maximum_colors > MaxColormapSize)
     maximum_colors=MaxColormapSize;
-  if ((image->columns*image->rows) <= maximum_colors)
-    (void) DirectToColormapImage(image,exception);
-  if ((IsImageGray(image,exception) != MagickFalse) &&
-      (image->matte == MagickFalse))
-    (void) SetGrayscaleImage(image,exception);
+  if (image->matte == MagickFalse)
+    {
+      if ((image->columns*image->rows) <= maximum_colors)
+        (void) DirectToColormapImage(image,exception);
+      if (IsImageGray(image,exception) != MagickFalse) 
+        (void) SetGrayscaleImage(image,exception);
+    }
   if ((image->storage_class == PseudoClass) &&
       (image->colors <= maximum_colors))
     return(MagickTrue);