]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 21 Mar 2012 23:15:56 +0000 (23:15 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 21 Mar 2012 23:15:56 +0000 (23:15 +0000)
MagickCore/channel.c

index 111a33978a751291253a2e2ba40c62793844d439..f01f11d139243a8b849c8cc84cffcfab0aed2916 100644 (file)
@@ -269,11 +269,6 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
         Image
           *canvas;
 
-        if ((channel_op == ExtractChannelOp) && (channels == 1))
-          {
-            destination_image->colorspace=GRAYColorspace;
-            InitializePixelChannelMap(destination_image);
-          }
         status=SetImageStorageClass(destination_image,DirectClass,exception);
         if (status == MagickFalse)
           {
@@ -342,6 +337,8 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
             return(destination_image);
           }
         destination_channel=(PixelChannel) i;
+        if (LocaleCompare(token,"gray") == 0)
+          (void) SetImageAlpha(destination_image,GrayColorspace,exception);
         if ((LocaleCompare(token,"black") == 0) ||
             (LocaleCompare(token,"c") == 0) ||
             (LocaleCompare(token,"cyan") == 0) ||
@@ -393,11 +390,6 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
     if (status == MagickFalse)
       break;
   }
-  if ((channel_op == ExtractChannelOp) && (channels == 1))
-    {
-      destination_image->colorspace=GRAYColorspace;
-      InitializePixelChannelMap(destination_image);
-    }
   status=SetImageStorageClass(destination_image,DirectClass,exception);
   if (status == MagickFalse)
     {