From: cristy Date: Sun, 11 Mar 2012 23:33:15 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6052 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc68ef52f1f970316ad6dcff28d05c11f92df428;p=imagemagick --- diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 28ae9b27c..b0f13a685 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -232,6 +232,8 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, destination_image=CloneImage(source_image,0,0,MagickTrue,exception); if (destination_image == (Image *) NULL) return((Image *) NULL); + if (destination_image->colorspace == GRAYColorspace) + destination_image->colorspace=RGBColorspace; if (expression == (const char *) NULL) return(destination_image); destination_channel=RedPixelChannel; @@ -268,8 +270,8 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, status=SetImageStorageClass(destination_image,DirectClass,exception); if (status == MagickFalse) { - destination_image=GetLastImageInList(destination_image); - return((Image *) NULL); + destination_image=DestroyImageList(destination_image); + return(destination_image); } if ((channel_op == ExtractChannelOp) && (channels == 1)) { @@ -279,9 +281,11 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, canvas=CloneImage(source_image,0,0,MagickTrue,exception); if (canvas == (Image *) NULL) { - destination_image=GetLastImageInList(destination_image); - return((Image *) NULL); + destination_image=DestroyImageList(destination_image); + return(destination_image); } + if (canvas->colorspace == GRAYColorspace) + canvas->colorspace=RGBColorspace; AppendImageToList(&destination_image,canvas); destination_image=GetLastImageInList(destination_image); GetMagickToken(p,&p,token); @@ -294,7 +298,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, (void) ThrowMagickException(exception,GetMagickModule(),OptionError, "UnrecognizedChannelType","`%s'",token); destination_image=DestroyImageList(destination_image); - break; + return(destination_image); } source_channel=(PixelChannel) i; channel_op=ExtractChannelOp; @@ -333,7 +337,7 @@ MagickExport Image *ChannelFxImage(const Image *image,const char *expression, (void) ThrowMagickException(exception,GetMagickModule(),OptionError, "UnrecognizedChannelType","`%s'",token); destination_image=DestroyImageList(destination_image); - break; + return(destination_image); } destination_channel=(PixelChannel) i; GetMagickToken(p,&p,token); diff --git a/MagickCore/token.c b/MagickCore/token.c index e84c5dc69..c32ec6368 100644 --- a/MagickCore/token.c +++ b/MagickCore/token.c @@ -249,7 +249,8 @@ MagickExport void GetMagickToken(const char *start,const char **end,char *token) for ( ; *p != '\0'; p++) { if (((isspace((int) ((unsigned char) *p)) != 0) || (*p == '=') || - (*p == ',') || (*p == ':') || (*p == ';')) && (*(p-1) != '\\')) + (*p == ':') || (*p == ',') || (*p == '|') || (*p == ';')) && + (*(p-1) != '\\')) break; if ((i > 0) && (*p == '<')) break;