From: Cristy Date: Wed, 31 May 2017 11:21:04 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/503 X-Git-Tag: 7.0.5-10~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1f7510b6b6500d6ae23b4e9f327907e50f369ff5;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/503 --- diff --git a/MagickCore/image.c b/MagickCore/image.c index 88adbecd0..a5d37b0de 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -3225,6 +3225,8 @@ MagickExport MagickBooleanType SetImageRegionMask(Image *image, } if (SyncImagePixelCache(image,exception) == MagickFalse) return(MagickFalse); + if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) + return(MagickFalse); status=MagickTrue; image_view=AcquireAuthenticCacheView(image,exception); #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index d26589c11..cbf6ef95e 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -2600,12 +2600,13 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) SyncImageSettings(mogrify_info,*image,exception); if (*option == '+') { - (void) SetImageRegionMask(*image,ReadPixelMask, + (void) SetImageRegionMask(*image,WritePixelMask, (const RectangleInfo *) NULL,exception); break; } (void) ParseGravityGeometry(*image,argv[i+1],&geometry,exception); - (void) SetImageRegionMask(*image,ReadPixelMask,&geometry,exception); + (void) SetImageRegionMask(*image,WritePixelMask,&geometry, + exception); break; } if (LocaleCompare("render",option+1) == 0) diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 6baf672e6..4e7b4e030 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -3109,12 +3109,12 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg1); if (*option == '+') { - (void) SetImageRegionMask(_image,ReadPixelMask, + (void) SetImageRegionMask(_image,WritePixelMask, (const RectangleInfo *) NULL,_exception); break; } (void) ParseGravityGeometry(_image,arg1,&geometry,_exception); - (void) SetImageRegionMask(_image,ReadPixelMask,&geometry,_exception); + (void) SetImageRegionMask(_image,WritePixelMask,&geometry,_exception); break; } if (LocaleCompare("remap",option+1) == 0)