]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 23 Jun 2012 17:44:57 +0000 (17:44 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 23 Jun 2012 17:44:57 +0000 (17:44 +0000)
MagickCore/cache.c
MagickCore/distort.c
MagickCore/enhance.c

index 669e7d66ce3dde26b27009d82a0f67d382d3f237..75d5da1ba5401a201cbffab0d9c8ba053be3c4d1 100644 (file)
@@ -4969,6 +4969,9 @@ MagickPrivate VirtualPixelMethod SetPixelCacheVirtualMethod(Image *image,
         if ((image->background_color.matte != MagickFalse) &&
             (image->matte == MagickFalse))
           (void) SetCacheAlphaChannel(image,OpaqueAlpha,exception);
+        if ((IsPixelInfoGray(&image->background_color) == MagickFalse) &&
+            (IsGrayColorspace(image->colorspace) != MagickFalse))
+          (void) TransformImageColorspace(image,sRGBColorspace,exception);
         break;
       }
       case TransparentVirtualPixelMethod:
index 6909de444400f29658bf880afb0f831bb4742089..037717720801b361f601d2a7e12c7dc8bc33be57 100644 (file)
@@ -2280,10 +2280,13 @@ MagickExport Image *DistortImage(const Image *image,DistortImageMethod method,
       distort_image=DestroyImage(distort_image);
       return((Image *) NULL);
     }
-  distort_image->page.x=geometry.x;
-  distort_image->page.y=geometry.y;
+  if ((IsPixelInfoGray(&distort_image->background_color) == MagickFalse) &&
+      (IsGrayColorspace(distort_image->colorspace) != MagickFalse))
+    (void) TransformImageColorspace(distort_image,sRGBColorspace,exception);
   if (distort_image->background_color.matte != MagickFalse)
     distort_image->matte=MagickTrue;
+  distort_image->page.x=geometry.x;
+  distort_image->page.y=geometry.y;
 
   { /* ----- MAIN CODE -----
        Sample the source image to each pixel in the distort image.
@@ -2832,8 +2835,6 @@ MagickExport Image *RotateImage(const Image *image,const double degrees,
   distort_image=CloneImage(image,0,0,MagickTrue,exception);
   if (distort_image == (Image *) NULL)
     return((Image *) NULL);
-  if (IsGrayColorspace(image->colorspace) != MagickFalse)
-    (void) TransformImageColorspace(distort_image,sRGBColorspace,exception);
   (void) SetImageVirtualPixelMethod(distort_image,BackgroundVirtualPixelMethod,
     exception);
   rotate_image=DistortImage(distort_image,ScaleRotateTranslateDistortion,1,
index 9710b529c61edc56b6b3123ebfb592c567970799..d09c0ab9ffa644717b4671ec05883b64587fbabe 100644 (file)
@@ -2218,8 +2218,6 @@ MagickExport MagickBooleanType LevelImage(Image *image,const double black_point,
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  if (IsGrayColorspace(image->colorspace) != MagickFalse)
-    (void) SetImageColorspace(image,sRGBColorspace,exception);
   if (image->storage_class == PseudoClass)
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
     #pragma omp parallel for schedule(static,4) shared(progress,status) \