From: cristy Date: Wed, 21 Mar 2012 23:15:56 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5996 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b4a93a2a2e359a2432f4ddd04b3548054b8c695;p=imagemagick --- diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 111a33978..f01f11d13 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -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) {