]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 10 Jul 2012 13:52:23 +0000 (13:52 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 10 Jul 2012 13:52:23 +0000 (13:52 +0000)
coders/gradient.c

index 814341891dc93c396ae59863425619a704ca3359..678762b6f3237f08687431a57f60cf077a09bc26 100644 (file)
@@ -40,6 +40,7 @@
   Include declarations.
 */
 #include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
 #include "MagickCore/blob.h"
 #include "MagickCore/blob-private.h"
 #include "MagickCore/color.h"
@@ -146,6 +147,7 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
         start_color.green);
       start_color.blue=QuantumRange*DecompandsRGB(QuantumScale*
         start_color.blue);
+      start_color.colorspace=RGBColorspace;
     }
   if (IssRGBColorspace(stop_color.colorspace) != MagickFalse)
     {
@@ -155,6 +157,7 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
         stop_color.green);
       stop_color.blue=QuantumRange*DecompandsRGB(QuantumScale*
         stop_color.blue);
+      stop_color.colorspace=RGBColorspace;
     }
   status=GradientImage(image,LocaleCompare(image_info->magick,"GRADIENT") == 0 ?
     LinearGradient : RadialGradient,PadSpread,&start_color,&stop_color,
@@ -165,8 +168,8 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
       return((Image *) NULL);
     }
   (void) SetImageColorspace(image,start_color.colorspace,exception);
-  if (IssRGBColorspace(start_color.colorspace) != MagickFalse)
-    (void) SetImageColorspace(image,RGBColorspace,exception);
+  if (IsImageGray(image,exception) != MagickFalse)
+    (void) SetImageColorspace(image,GRAYColorspace,exception);
   if ((start_color.matte == MagickFalse) && (stop_color.matte == MagickFalse))
     (void) SetImageAlphaChannel(image,DeactivateAlphaChannel,exception);
   return(GetFirstImageInList(image));