]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 29 Mar 2014 13:37:01 +0000 (13:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 29 Mar 2014 13:37:01 +0000 (13:37 +0000)
MagickCore/colorspace.c

index 1a3c49ae4a34ea05b4ef5c82535c2a9d4660e381..3304eebc58c5e73764885805a7f7a68f3dd67ea5 100644 (file)
@@ -1137,10 +1137,13 @@ MagickExport MagickBooleanType TransformImageColorspace(Image *image,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if (colorspace == UndefinedColorspace)
-    return(SetImageColorspace(image,colorspace,exception));
   if (image->colorspace == colorspace)
     return(MagickTrue);
+  if ((IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) &&
+      (colorspace == sRGBColorspace))
+    return(MagickTrue);
+  if (colorspace == UndefinedColorspace)
+    return(SetImageColorspace(image,colorspace,exception));
   /*
     Convert the reference image from an alternate colorspace to sRGB.
   */