#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"
*charcoal_image,
*edge_image;
+ MagickBooleanType
+ status;
+
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
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);
}
\f