]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 20 May 2013 17:24:07 +0000 (17:24 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 20 May 2013 17:24:07 +0000 (17:24 +0000)
MagickCore/channel.c

index 0f90f10de5c78bcff1a314c42130ff9e6c70e260..9fd2eda21a49f79505612a18fe2ed26099421708 100644 (file)
@@ -363,6 +363,12 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
         destination_channel=(PixelChannel) i;
         switch (destination_channel)
         {
+          case RedPixelChannel:
+          case GreenPixelChannel:
+          case BluePixelChannel:
+          case BlackPixelChannel:
+          case IndexPixelChannel:
+            break;
           case AlphaPixelChannel:
           {
             destination_image->alpha_trait=BlendPixelTrait;
@@ -378,16 +384,18 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression,
             destination_image->write_mask=MagickTrue;
             break;
           }
+          case MetaPixelChannel:
           default:
+          {
+            (void) SetPixelMetaChannels(destination_image,(size_t) (i-
+              GetPixelChannels(destination_image)+1),exception);
             break;
+          }
         }
         channel_mask=(ChannelType) (channel_mask | ParseChannelOption(token));
         if (((channels >= 1)  || (destination_channel >= 1)) &&
             (IsGrayColorspace(destination_image->colorspace) != MagickFalse))
           (void) SetImageColorspace(destination_image,sRGBColorspace,exception);
-        if (i >= (ssize_t) GetPixelChannels(destination_image))
-          (void) SetPixelMetaChannels(destination_image,(size_t) (i-
-            GetPixelChannels(destination_image)+1),exception);
         GetMagickToken(p,&p,token);
         break;
       }