]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 21 Jun 2012 01:15:29 +0000 (01:15 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 21 Jun 2012 01:15:29 +0000 (01:15 +0000)
coders/gradient.c

index 5682ab30460d0192d12b438c249302a716bb0121..6365de0907796e064ccc1c2b299abfb77c91a3f1 100644 (file)
@@ -145,7 +145,6 @@ 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,7 +154,6 @@ 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,
@@ -168,6 +166,11 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info,
   (void) SetImageColorspace(image,start_color.colorspace,exception);
   if ((start_color.matte == MagickFalse) && (stop_color.matte == MagickFalse))
     (void) SetImageAlphaChannel(image,DeactivateAlphaChannel,exception);
+  if (IssRGBColorspace(start_color.colorspace) != MagickFalse)
+    {
+      (void) SetImageColorspace(image,RGBColorspace,exception);
+      (void) TransformImageColorspace(image,sRGBColorspace,exception);
+    }
   return(GetFirstImageInList(image));
 }
 \f