From 87cd4acd6b133b5664f6c0bf3bfc7acca7f2ff75 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 29 Jan 2017 08:41:53 -0500 Subject: [PATCH] ... --- MagickCore/channel.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 066073616..56816ca5f 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -331,24 +331,23 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, switch (channel_op) { case AssignChannelOp: - { - destination_channel=(PixelChannel) i; - pixel=StringToDoubleInterval(token,(double) QuantumRange+1.0); - GetNextToken(p,&p,MagickPathExtent,token); - break; - } case ExchangeChannelOp: case TransferChannelOp: { - i=ParsePixelChannelOption(token); - if (i < 0) + destination_channel=(PixelChannel) i; + if (channel_op == AssignChannelOp) + pixel=StringToDoubleInterval(token,(double) QuantumRange+1.0); + else { - (void) ThrowMagickException(exception,GetMagickModule(),OptionError, - "UnrecognizedChannelType","`%s'",token); - destination_image=DestroyImageList(destination_image); - return(destination_image); + i=ParsePixelChannelOption(token); + if (i < 0) + { + (void) ThrowMagickException(exception,GetMagickModule(), + OptionError,"UnrecognizedChannelType","`%s'",token); + destination_image=DestroyImageList(destination_image); + return(destination_image); + } } - destination_channel=(PixelChannel) i; switch (destination_channel) { case RedPixelChannel: @@ -375,8 +374,9 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, case MetaPixelChannel: default: { - (void) SetPixelMetaChannels(destination_image,(size_t) (i- - GetPixelChannels(destination_image)+1),exception); + (void) SetPixelMetaChannels(destination_image,(size_t) ( + destination_channel-GetPixelChannels(destination_image)+1), + exception); break; } } @@ -512,7 +512,7 @@ MagickExport Image *CombineImages(const Image *image, { case UndefinedColorspace: case sRGBColorspace: - { + { if (GetImageListLength(image) > 3) combine_image->alpha_trait=BlendPixelTrait; break; @@ -524,7 +524,7 @@ MagickExport Image *CombineImages(const Image *image, break; } case CMYKColorspace: - { + { if (GetImageListLength(image) > 4) combine_image->alpha_trait=BlendPixelTrait; break; @@ -1006,10 +1006,10 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, { double gamma; - + register ssize_t i; - + if (GetPixelWriteMask(image,q) == 0) { q+=GetPixelChannels(image); @@ -1137,7 +1137,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, for (x=0; x < (ssize_t) image->columns; x++) { double - gamma, + gamma, Sa; register ssize_t -- 2.40.0