]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 17 Apr 2012 12:20:23 +0000 (12:20 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 17 Apr 2012 12:20:23 +0000 (12:20 +0000)
MagickCore/colorspace.c

index 48bfb5896addf795ab593d25afb3315ef4695491..e56c9bb11bce56c2444abc52dfe5e484506bc33e 100644 (file)
@@ -214,8 +214,11 @@ MagickExport MagickBooleanType RGBTransformImage(Image *image,
   assert(colorspace != sRGBColorspace);
   assert(colorspace != TransparentColorspace);
   assert(colorspace != UndefinedColorspace);
-  if (SetImageColorspace(image,colorspace,exception) == MagickFalse)
-    return(MagickFalse);
+  if (IsGrayColorspace(colorspace) != MagickFalse)
+    (void) SetImageColorspace(image,sRGBColorspace,exception);
+  else
+    if (SetImageColorspace(image,colorspace,exception) == MagickFalse)
+      return(MagickFalse);
   status=MagickTrue;
   progress=0;
   switch (colorspace)