File ImageMagick-fix-Clear-method.patch of Package ImageMagick.30356
From 575fa71be97c38c12fab4c7fa7a9de4b13785a65 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Sun, 8 Jul 2018 12:02:07 -0400
Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1157
---
MagickWand/composite.c | 22 +++++++++++++++++-----
MagickWand/mogrify.c | 14 +++++---------
MagickWand/operation.c | 14 +++++---------
3 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/MagickWand/composite.c b/MagickWand/composite.c
index 0671b67911..7bb8fda316 100644
--- a/MagickWand/composite.c
+++ b/MagickWand/composite.c
@@ -70,6 +70,7 @@ typedef struct _CompositeOptions
offset;
MagickBooleanType
+ clip_to_self,
stereo,
tile;
} CompositeOptions;
@@ -197,7 +198,8 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image,
for (y=0; y < (ssize_t) (*image)->rows; y+=(ssize_t) composite_image->rows)
for (x=0; x < (ssize_t) (*image)->columns; x+=(ssize_t) columns)
status&=CompositeImage(*image,composite_image,
- composite_options->compose,MagickTrue,x,y,exception);
+ composite_options->compose,composite_options->clip_to_self,
+ x,y,exception);
}
else
{
@@ -219,8 +221,8 @@ static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image,
Digitally composite image.
*/
status&=CompositeImage(*image,composite_image,
- composite_options->compose,MagickTrue,geometry.x,geometry.y,
- exception);
+ composite_options->compose,composite_options->clip_to_self,
+ geometry.x,geometry.y,exception);
}
(void) SetPixelChannelMask(composite_image,channel_mask);
}
@@ -370,11 +372,21 @@ static MagickBooleanType CompositeUsage(void)
return(MagickFalse);
}
-static void GetCompositeOptions(CompositeOptions *composite_options)
+static void GetCompositeOptions(const ImageInfo *image_info,
+ CompositeOptions *composite_options)
{
+ const char
+ *value;
+
(void) memset(composite_options,0,sizeof(*composite_options));
composite_options->channel=DefaultChannels;
composite_options->compose=OverCompositeOp;
+ value=GetImageOption(image_info,"compose:clip-to-self");
+ if (value != (const char *) NULL)
+ composite_options->clip_to_self=IsStringTrue(value);
+ value=GetImageOption(image_info,"compose:outside-overlay");
+ if (value != (const char *) NULL)
+ composite_options->clip_to_self=IsStringFalse(value); /* deprecated */
}
static void RelinquishCompositeOptions(CompositeOptions *composite_options)
@@ -468,7 +480,7 @@ WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
}
if (argc < 4)
return(CompositeUsage());
- GetCompositeOptions(&composite_options);
+ GetCompositeOptions(image_info,&composite_options);
filename=(char *) NULL;
format="%w,%h,%m";
j=1;
diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c
index 92c4815f0e..ff00e130bf 100644
--- a/MagickWand/mogrify.c
+++ b/MagickWand/mogrify.c
@@ -7926,17 +7926,13 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
MagickComposeOptions,MagickFalse,value);
/* Get "clip-to-self" expert setting (false is normal) */
+ clip_to_self=MagickFalse;
value=GetImageOption(mogrify_info,"compose:clip-to-self");
- if (value == (const char *) NULL)
- clip_to_self=MagickTrue;
- else
- clip_to_self=IsStringTrue(GetImageOption(mogrify_info,
- "compose:clip-to-self")); /* if this is true */
+ if (value != (const char *) NULL)
+ clip_to_self=IsStringTrue(value);
value=GetImageOption(mogrify_info,"compose:outside-overlay");
- if (value != (const char *) NULL) { /* or this false */
- /* FUTURE: depreciate warning for "compose:outside-overlay"*/
- clip_to_self=IsStringFalse(value);
- }
+ if (value != (const char *) NULL)
+ clip_to_self=IsStringFalse(value); /* deprecated */
new_images=RemoveFirstImageFromList(images);
source_image=RemoveFirstImageFromList(images);
diff --git a/MagickWand/operation.c b/MagickWand/operation.c
index 7d75896793..30a88bebe5 100644
--- a/MagickWand/operation.c
+++ b/MagickWand/operation.c
@@ -3881,17 +3881,13 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
MagickFalse,value);
/* Get "clip-to-self" expert setting (false is normal) */
+ clip_to_self=MagickFalse;
value=GetImageOption(_image_info,"compose:clip-to-self");
- if (value == (const char *) NULL)
- clip_to_self=MagickTrue;
- else
- clip_to_self=IsStringTrue(GetImageOption(_image_info,
- "compose:clip-to-self")); /* if this is true */
+ if (value != (const char *) NULL)
+ clip_to_self=IsStringTrue(value);
value=GetImageOption(_image_info,"compose:outside-overlay");
- if (value != (const char *) NULL) { /* or this false */
- /* FUTURE: depreciate warning for "compose:outside-overlay"*/
- clip_to_self=IsStringFalse(value);
- }
+ if (value != (const char *) NULL)
+ clip_to_self=IsStringFalse(value); /* deprecated */
new_images=RemoveFirstImageFromList(&_images);
source_image=RemoveFirstImageFromList(&_images);