From: Cristy Date: Tue, 22 Jan 2019 00:37:00 +0000 (-0500) Subject: Clamp -charcoal to replicate IMv6 results X-Git-Tag: 7.0.8-25~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88fce67336199f7c58330a2bdca80b313474ae1d;p=imagemagick Clamp -charcoal to replicate IMv6 results --- diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 6bcd7ad36..031b7aa31 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -92,6 +92,7 @@ #include "MagickCore/string_.h" #include "MagickCore/string-private.h" #include "MagickCore/thread-private.h" +#include "MagickCore/threshold.h" #include "MagickCore/transform.h" #include "MagickCore/transform-private.h" #include "MagickCore/utility.h" @@ -597,6 +598,9 @@ MagickExport Image *CharcoalImage(const Image *image,const double radius, *charcoal_image, *edge_image; + MagickBooleanType + status; + assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); if (image->debug != MagickFalse) @@ -606,13 +610,20 @@ MagickExport Image *CharcoalImage(const Image *image,const double radius, edge_image=EdgeImage(image,radius,exception); if (edge_image == (Image *) NULL) return((Image *) NULL); - charcoal_image=BlurImage(edge_image,radius,sigma,exception); + charcoal_image=(Image *) NULL; + status=ClampImage(edge_image,exception); + if (status != MagickFalse) + charcoal_image=BlurImage(edge_image,radius,sigma,exception); edge_image=DestroyImage(edge_image); if (charcoal_image == (Image *) NULL) return((Image *) NULL); - (void) NormalizeImage(charcoal_image,exception); - (void) NegateImage(charcoal_image,MagickFalse,exception); - (void) GrayscaleImage(charcoal_image,image->intensity,exception); + status=NormalizeImage(charcoal_image,exception); + if (status != MagickFalse) + status=NegateImage(charcoal_image,MagickFalse,exception); + if (status != MagickFalse) + status=GrayscaleImage(charcoal_image,image->intensity,exception); + if (status == MagickFalse) + charcoal_image=DestroyImage(charcoal_image); return(charcoal_image); }