From 189e84ce7da8fbf4eb57c908846bcc0bdcbdc688 Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 27 Aug 2011 18:08:53 +0000 Subject: [PATCH] --- Magick++/lib/Image.cpp | 57 ++++++++++++++++++++++++++------------ MagickCore/display.c | 4 +-- MagickCore/draw.c | 6 ++-- MagickCore/magick-config.h | 47 +++++++++++++++++++------------ MagickCore/paint.c | 52 +++++++++++++++++----------------- MagickCore/paint.h | 10 +++---- MagickCore/version.h | 4 +-- MagickWand/magick-image.c | 14 ++++------ MagickWand/mogrify.c | 9 +++--- PerlMagick/Magick.xs | 14 +++++----- coders/gradient.c | 3 +- coders/msl.c | 8 +++--- coders/palm.c | 6 ++-- 13 files changed, 132 insertions(+), 102 deletions(-) diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index f9cd05356..322f9aede 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -990,12 +990,16 @@ void Magick::Image::floodFillOpacity( const ssize_t x_, target.green=pixel.green; target.blue=pixel.blue; target.alpha=alpha_; + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); FloodfillPaintImage ( image(), options()->drawInfo(), // const DrawInfo *draw_info &target, static_cast(x_), static_cast(y_), - method_ == FloodfillMethod ? MagickFalse : MagickTrue); - throwImageException(); + method_ == FloodfillMethod ? MagickFalse : MagickTrue, + &exceptionInfo); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } // Flood-fill texture across pixels that match the color of the @@ -1019,16 +1023,19 @@ void Magick::Image::floodFillTexture( const ssize_t x_, target.red=GetPixelRed(constImage(),p); target.green=GetPixelGreen(constImage(),p); target.blue=GetPixelBlue(constImage(),p); + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); if (p) FloodfillPaintImage ( image(), // Image *image options()->drawInfo(), // const DrawInfo *draw_info &target, // const MagickPacket target static_cast(x_), // const ssize_t x_offset static_cast(y_), // const ssize_t y_offset - MagickFalse // const PaintMethod method - ); + MagickFalse, // const PaintMethod method + &exceptionInfo ); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); - throwImageException(); } void Magick::Image::floodFillTexture( const Magick::Geometry &point_, const Magick::Image &texture_ ) @@ -1054,14 +1061,17 @@ void Magick::Image::floodFillTexture( const ssize_t x_, target.red=static_cast(borderColor_).red; target.green=static_cast(borderColor_).green; target.blue=static_cast(borderColor_).blue; + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); FloodfillPaintImage ( image(), options()->drawInfo(), &target, static_cast(x_), static_cast(y_), - MagickTrue); + MagickTrue, &exceptionInfo); - throwImageException(); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } void Magick::Image::floodFillTexture( const Magick::Geometry &point_, const Magick::Image &texture_, @@ -1310,10 +1320,13 @@ void Magick::Image::matteFloodfill ( const Color &target_ , target.blue=static_cast(target_).blue; target.alpha=alpha_; ChannelType channel_mask = SetPixelChannelMask( image(), AlphaChannel ); + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); FloodfillPaintImage ( image(), options()->drawInfo(), &target, x_, y_, - method_ == FloodfillMethod ? MagickFalse : MagickTrue); + method_ == FloodfillMethod ? MagickFalse : MagickTrue, &exceptionInfo); (void) SetPixelChannelMap( image(), channel_mask ); - throwImageException(); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } // Filter image by replacing each pixel component with the median @@ -1447,10 +1460,13 @@ void Magick::Image::opaque ( const Color &opaqueColor_, PixelInfo opaque; PixelInfo pen; - (void) QueryMagickColor(std::string(opaqueColor_).c_str(),&opaque,&image()->exception); - (void) QueryMagickColor(std::string(penColor_).c_str(),&pen,&image()->exception); - OpaquePaintImage ( image(), &opaque, &pen, MagickFalse ); - throwImageException(); + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); + (void) QueryMagickColor(std::string(opaqueColor_).c_str(),&opaque, &exceptionInfo); + (void) QueryMagickColor(std::string(penColor_).c_str(),&pen, &exceptionInfo); + OpaquePaintImage ( image(), &opaque, &pen, MagickFalse, &exceptionInfo ); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } // Ping is similar to read except only enough of the image is read to @@ -2090,9 +2106,13 @@ void Magick::Image::transparent ( const Color &color_ ) PixelInfo target; (void) QueryMagickColor(std::string(color_).c_str(),&target,&image()->exception); + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); modifyImage(); - TransparentPaintImage ( image(), &target, TransparentAlpha, MagickFalse ); - throwImageException(); + TransparentPaintImage ( image(), &target, TransparentAlpha, MagickFalse, + &exceptionInfo ); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } // Add matte image to image, setting pixels matching color to transparent @@ -2114,10 +2134,13 @@ void Magick::Image::transparentChroma(const Color &colorLow_, &image()->exception); (void) QueryMagickColor(std::string(colorHigh_).c_str(),&targetHigh, &image()->exception); + ExceptionInfo exceptionInfo; + GetExceptionInfo( &exceptionInfo ); modifyImage(); TransparentPaintImageChroma ( image(), &targetLow, &targetHigh, - TransparentAlpha, MagickFalse ); - throwImageException(); + TransparentAlpha, MagickFalse, &exceptionInfo ); + throwException( exceptionInfo ); + (void) DestroyExceptionInfo( &exceptionInfo ); } diff --git a/MagickCore/display.c b/MagickCore/display.c index ca763bcd6..ee15ea1e0 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -3803,7 +3803,7 @@ static MagickBooleanType XColorEditImage(Display *display, &draw_info->fill,exception); (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t) x_offset,(ssize_t) y_offset,method == FloodfillMethod ? - MagickFalse : MagickTrue); + MagickFalse : MagickTrue,exception); draw_info=DestroyDrawInfo(draw_info); break; } @@ -10084,7 +10084,7 @@ static MagickBooleanType XMatteEditImage(Display *display, channel_mask=SetPixelChannelMask(*image,AlphaChannel); (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t) x_offset,(ssize_t) y_offset,method == FloodfillMethod ? - MagickFalse : MagickTrue); + MagickFalse : MagickTrue,exception); (void) SetPixelChannelMap(*image,channel_mask); draw_info=DestroyDrawInfo(draw_info); break; diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 0e21687d1..6b754ba8e 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -2494,7 +2494,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) GetMagickToken(q,&q,token); (void) QueryColorDatabase(token,&stop_color,&image->exception); (void) GradientImage(image,LinearGradient,ReflectSpread, - &start_color,&stop_color); + &start_color,&stop_color,&image->exception); start_color=stop_color; GetMagickToken(q,&q,token); break; @@ -4245,7 +4245,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, } (void) FloodfillPaintImage(image,draw_info,&target,x,y, primitive_info->method == FloodfillMethod ? MagickFalse : - MagickTrue); + MagickTrue,exception); break; } case ResetMethod: @@ -4365,7 +4365,7 @@ MagickExport MagickBooleanType DrawPrimitive(Image *image, channel_mask=SetPixelChannelMask(image,AlphaChannel); (void) FloodfillPaintImage(image,draw_info,&target,x,y, primitive_info->method == FloodfillMethod ? MagickFalse : - MagickTrue); + MagickTrue,exception); (void) SetPixelChannelMask(image,channel_mask); break; } diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index d0dd86310..60334d7b9 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -12,7 +12,9 @@ /* #undef AUTOTRACE_DELEGATE */ /* Define if coders and filters are to be built as modules. */ -/* #undef BUILD_MODULES */ +#ifndef MAGICKCORE_BUILD_MODULES +#define MAGICKCORE_BUILD_MODULES 1 +#endif /* Define if you have the bzip2 library */ #ifndef MAGICKCORE_BZLIB_DELEGATE @@ -78,7 +80,9 @@ #endif /* Define if you have FFTW library */ -/* #undef FFTW_DELEGATE */ +#ifndef MAGICKCORE_FFTW_DELEGATE +#define MAGICKCORE_FFTW_DELEGATE 1 +#endif /* Location of filter modules */ #ifndef MAGICKCORE_FILTER_PATH @@ -432,15 +436,15 @@ #endif /* Define if you have the header file. */ -#ifndef MAGICKCORE_HAVE_LCMS2_H -#define MAGICKCORE_HAVE_LCMS2_H 1 -#endif +/* #undef HAVE_LCMS2_H */ /* Define if you have the header file. */ /* #undef HAVE_LCMS2_LCMS2_H */ /* Define if you have the header file. */ -/* #undef HAVE_LCMS_H */ +#ifndef MAGICKCORE_HAVE_LCMS_H +#define MAGICKCORE_HAVE_LCMS_H 1 +#endif /* Define if you have the header file. */ /* #undef HAVE_LCMS_LCMS_H */ @@ -1157,16 +1161,15 @@ /* Define if you have umem memory allocation library */ /* #undef HasUMEM */ -/* Define if you have wmflite library */ -/* #undef HasWMFlite */ - /* ImageMagick is formally installed under prefix */ #ifndef MAGICKCORE_INSTALLED_SUPPORT #define MAGICKCORE_INSTALLED_SUPPORT 1 #endif /* Define if you have JBIG library */ -/* #undef JBIG_DELEGATE */ +#ifndef MAGICKCORE_JBIG_DELEGATE +#define MAGICKCORE_JBIG_DELEGATE 1 +#endif /* Define if you have JPEG version 2 "Jasper" library */ #ifndef MAGICKCORE_JP2_DELEGATE @@ -1195,7 +1198,9 @@ #endif /* Define if you have LQR library */ -/* #undef LQR_DELEGATE */ +#ifndef MAGICKCORE_LQR_DELEGATE +#define MAGICKCORE_LQR_DELEGATE 1 +#endif /* Define if using libltdl to support dynamically loadable modules */ #ifndef MAGICKCORE_LTDL_DELEGATE @@ -1207,7 +1212,7 @@ /* Define to the system default library search path. */ #ifndef MAGICKCORE_LT_DLSEARCH_PATH -#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib/llvm:/usr/lib64/llvm:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2" +#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2" #endif /* The archive extension */ @@ -1258,7 +1263,9 @@ /* #undef NO_MINUS_C_MINUS_O */ /* Define if you have OPENEXR library */ -/* #undef OPENEXR_DELEGATE */ +#ifndef MAGICKCORE_OPENEXR_DELEGATE +#define MAGICKCORE_OPENEXR_DELEGATE 1 +#endif /* Define to the address where bug reports for this package should be sent. */ #ifndef MAGICKCORE_PACKAGE_BUGREPORT @@ -1313,7 +1320,9 @@ #endif /* Define if you have RSVG library */ -/* #undef RSVG_DELEGATE */ +#ifndef MAGICKCORE_RSVG_DELEGATE +#define MAGICKCORE_RSVG_DELEGATE 1 +#endif /* Define to the type of arg 1 for `select'. */ #ifndef MAGICKCORE_SELECT_TYPE_ARG1 @@ -1450,7 +1459,9 @@ /* Define if you have WEBP library */ -/* #undef WEBP_DELEGATE */ +#ifndef MAGICKCORE_WEBP_DELEGATE +#define MAGICKCORE_WEBP_DELEGATE 1 +#endif /* Define to use the Windows GDI32 library */ /* #undef WINGDI32_DELEGATE */ @@ -1458,8 +1469,10 @@ /* Define if using the dmalloc debugging malloc package */ /* #undef WITH_DMALLOC */ -/* Define if you have wmf library */ -/* #undef WMF_DELEGATE */ +/* Define if you have WMF library */ +#ifndef MAGICKCORE_WMF_DELEGATE +#define MAGICKCORE_WMF_DELEGATE 1 +#endif /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/MagickCore/paint.c b/MagickCore/paint.c index c47efff03..469d53472 100644 --- a/MagickCore/paint.c +++ b/MagickCore/paint.c @@ -85,7 +85,7 @@ % MagickBooleanType FloodfillPaintImage(Image *image, % const DrawInfo *draw_info,const PixelInfo target, % const ssize_t x_offset,const ssize_t y_offset, -% const MagickBooleanType invert) +% const MagickBooleanType invert,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -99,10 +99,13 @@ % % o invert: paint any pixel that does not match the target color. % +% o exception: return any errors or warnings in this structure. +% */ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, const DrawInfo *draw_info,const PixelInfo *target,const ssize_t x_offset, - const ssize_t y_offset,const MagickBooleanType invert) + const ssize_t y_offset,const MagickBooleanType invert, + ExceptionInfo *exception) { #define MaxStacksize (1UL << 15) #define PushSegmentStack(up,left,right,delta) \ @@ -126,9 +129,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, *floodplane_view, *image_view; - ExceptionInfo - *exception; - Image *floodplane_image; @@ -169,7 +169,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, return(MagickFalse); if ((y_offset < 0) || (y_offset >= (ssize_t) image->rows)) return(MagickFalse); - exception=(&image->exception); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) return(MagickFalse); if (image->matte == MagickFalse) @@ -380,7 +379,7 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, % % MagickBooleanType GradientImage(Image *image,const GradientType type, % const SpreadMethod method,const PixelPacket *start_color, -% const PixelPacket *stop_color) +% const PixelPacket *stop_color,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -394,6 +393,8 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, % % o stop_color: the stop color. % +% o exception: return any errors or warnings in this structure. +% */ static inline double MagickMax(const double x,const double y) @@ -403,7 +404,8 @@ static inline double MagickMax(const double x,const double y) MagickExport MagickBooleanType GradientImage(Image *image, const GradientType type,const SpreadMethod method, - const PixelPacket *start_color,const PixelPacket *stop_color) + const PixelPacket *start_color,const PixelPacket *stop_color, + ExceptionInfo *exception) { DrawInfo *draw_info; @@ -720,7 +722,7 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, % % MagickBooleanType OpaquePaintImage(Image *image, % const PixelPacket *target,const PixelPacket *fill, -% const MagickBooleanType invert) +% const MagickBooleanType invert,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -732,18 +734,18 @@ MagickExport Image *OilPaintImage(const Image *image,const double radius, % % o invert: paint any pixel that does not match the target color. % +% o exception: return any errors or warnings in this structure. +% */ MagickExport MagickBooleanType OpaquePaintImage(Image *image, - const PixelInfo *target,const PixelInfo *fill,const MagickBooleanType invert) + const PixelInfo *target,const PixelInfo *fill,const MagickBooleanType invert, + ExceptionInfo *exception) { #define OpaquePaintImageTag "Opaque/Image" CacheView *image_view; - ExceptionInfo - *exception; - MagickBooleanType status; @@ -762,7 +764,6 @@ MagickExport MagickBooleanType OpaquePaintImage(Image *image, assert(fill != (PixelInfo *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - exception=(&image->exception); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) return(MagickFalse); /* @@ -858,7 +859,7 @@ MagickExport MagickBooleanType OpaquePaintImage(Image *image, % % MagickBooleanType TransparentPaintImage(Image *image, % const PixelInfo *target,const Quantum opacity, -% const MagickBooleanType invert) +% const MagickBooleanType invert,ExceptionInfo *exception) % % A description of each parameter follows: % @@ -870,19 +871,18 @@ MagickExport MagickBooleanType OpaquePaintImage(Image *image, % % o invert: paint any pixel that does not match the target color. % +% o exception: return any errors or warnings in this structure. +% */ MagickExport MagickBooleanType TransparentPaintImage(Image *image, const PixelInfo *target,const Quantum opacity, - const MagickBooleanType invert) + const MagickBooleanType invert,ExceptionInfo *exception) { #define TransparentPaintImageTag "Transparent/Image" CacheView *image_view; - ExceptionInfo - *exception; - MagickBooleanType status; @@ -900,7 +900,6 @@ MagickExport MagickBooleanType TransparentPaintImage(Image *image, assert(target != (PixelInfo *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - exception=(&image->exception); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) return(MagickFalse); if (image->matte == MagickFalse) @@ -987,7 +986,8 @@ MagickExport MagickBooleanType TransparentPaintImage(Image *image, % % MagickBooleanType TransparentPaintImage(Image *image, % const PixelInfo *low,const PixelInfo *hight, -% const Quantum opacity,const MagickBooleanType invert) +% const Quantum opacity,const MagickBooleanType invert, +% ExceptionInfo *exception) % % A description of each parameter follows: % @@ -1001,19 +1001,18 @@ MagickExport MagickBooleanType TransparentPaintImage(Image *image, % % o invert: paint any pixel that does not match the target color. % +% o exception: return any errors or warnings in this structure. +% */ MagickExport MagickBooleanType TransparentPaintImageChroma(Image *image, - const PixelInfo *low,const PixelInfo *high, - const Quantum opacity,const MagickBooleanType invert) + const PixelInfo *low,const PixelInfo *high,const Quantum opacity, + const MagickBooleanType invert,ExceptionInfo *exception) { #define TransparentPaintImageTag "Transparent/Image" CacheView *image_view; - ExceptionInfo - *exception; - MagickBooleanType status; @@ -1029,7 +1028,6 @@ MagickExport MagickBooleanType TransparentPaintImageChroma(Image *image, assert(low != (PixelInfo *) NULL); if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - exception=(&image->exception); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) return(MagickFalse); if (image->matte == MagickFalse) diff --git a/MagickCore/paint.h b/MagickCore/paint.h index 9b080c448..3002767f3 100644 --- a/MagickCore/paint.h +++ b/MagickCore/paint.h @@ -30,15 +30,15 @@ extern MagickExport Image extern MagickExport MagickBooleanType FloodfillPaintImage(Image *,const DrawInfo *,const PixelInfo *,const ssize_t, - const ssize_t,const MagickBooleanType), + const ssize_t,const MagickBooleanType,ExceptionInfo *), GradientImage(Image *,const GradientType,const SpreadMethod, - const PixelPacket *,const PixelPacket *), + const PixelPacket *,const PixelPacket *,ExceptionInfo *), OpaquePaintImage(Image *,const PixelInfo *,const PixelInfo *, - const MagickBooleanType), + const MagickBooleanType,ExceptionInfo *), TransparentPaintImage(Image *,const PixelInfo *, - const Quantum,const MagickBooleanType), + const Quantum,const MagickBooleanType,ExceptionInfo *), TransparentPaintImageChroma(Image *,const PixelInfo *, - const PixelInfo *,const Quantum,const MagickBooleanType); + const PixelInfo *,const Quantum,const MagickBooleanType,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/MagickCore/version.h b/MagickCore/version.h index cabcffa12..658656d1e 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -27,14 +27,14 @@ extern "C" { */ #define MagickPackageName "ImageMagick" #define MagickCopyright "Copyright (C) 1999-2011 ImageMagick Studio LLC" -#define MagickSVNRevision "5051" +#define MagickSVNRevision "exported" #define MagickLibVersion 0x700 #define MagickLibVersionText "7.0.0" #define MagickLibVersionNumber 5,0,0 #define MagickLibAddendum "-0" #define MagickLibInterface 5 #define MagickLibMinInterface 5 -#define MagickReleaseDate "2011-08-24" +#define MagickReleaseDate "2011-08-26" #define MagickChangeDate "20110801" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 6374ec9c7..ed761aa24 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -3023,9 +3023,8 @@ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, if (bordercolor != (PixelWand *) NULL) PixelGetMagickColor(bordercolor,&target); wand->images->fuzz=fuzz; - status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert); - if (status == MagickFalse) - InheritException(wand->exception,&wand->images->exception); + status=FloodfillPaintImage(wand->images,draw_info,&target,x,y,invert, + &wand->images->exception); draw_info=DestroyDrawInfo(draw_info); return(status); } @@ -6899,9 +6898,8 @@ WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, PixelGetMagickColor(target,&target_pixel); PixelGetMagickColor(fill,&fill_pixel); wand->images->fuzz=fuzz; - status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert); - if (status == MagickFalse) - InheritException(wand->exception,&wand->images->exception); + status=OpaquePaintImage(wand->images,&target_pixel,&fill_pixel,invert, + &wand->images->exception); return(status); } @@ -11445,9 +11443,7 @@ WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, PixelGetMagickColor(target,&target_pixel); wand->images->fuzz=fuzz; status=TransparentPaintImage(wand->images,&target_pixel,ClampToQuantum( - QuantumRange*alpha),invert); - if (status == MagickFalse) - InheritException(wand->exception,&wand->images->exception); + QuantumRange*alpha),invert,&wand->images->exception); return(status); } diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 7570fc0b7..d2dd3830f 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -1571,8 +1571,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) ParsePageGeometry(*image,argv[i+1],&geometry,exception); (void) QueryMagickColor(argv[i+2],&target,exception); (void) FloodfillPaintImage(*image,draw_info,&target,geometry.x, - geometry.y,*option == '-' ? MagickFalse : MagickTrue); - InheritException(exception,&(*image)->exception); + geometry.y,*option == '-' ? MagickFalse : MagickTrue,exception); break; } if (LocaleCompare("flop",option+1) == 0) @@ -2172,7 +2171,7 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) SyncImageSettings(mogrify_info,*image); (void) QueryMagickColor(argv[i+1],&target,exception); (void) OpaquePaintImage(*image,&target,&fill,*option == '-' ? - MagickFalse : MagickTrue); + MagickFalse : MagickTrue,exception); break; } if (LocaleCompare("ordered-dither",option+1) == 0) @@ -2939,8 +2938,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) SyncImageSettings(mogrify_info,*image); (void) QueryMagickColor(argv[i+1],&target,exception); (void) TransparentPaintImage(*image,&target,(Quantum) - TransparentAlpha,*option == '-' ? MagickFalse : MagickTrue); - InheritException(exception,&(*image)->exception); + TransparentAlpha,*option == '-' ? MagickFalse : MagickTrue, + &(*image)->exception); break; } if (LocaleCompare("transpose",option+1) == 0) diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs index de7b2e7d4..c676521d0 100644 --- a/PerlMagick/Magick.xs +++ b/PerlMagick/Magick.xs @@ -8171,7 +8171,7 @@ Mogrify(ref,...) if (attribute_flag[6] != 0) invert=(MagickBooleanType) argument_list[6].integer_reference; (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, - geometry.y,invert); + geometry.y,invert,exception); draw_info=DestroyDrawInfo(draw_info); break; } @@ -8730,7 +8730,7 @@ Mogrify(ref,...) invert=(MagickBooleanType) argument_list[6].integer_reference; channel_mask=SetPixelChannelMask(image,AlphaChannel); (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, - geometry.y,invert); + geometry.y,invert,exception); (void) SetPixelChannelMask(image,channel_mask); draw_info=DestroyDrawInfo(draw_info); break; @@ -8824,7 +8824,7 @@ Mogrify(ref,...) if (attribute_flag[4] != 0) invert=(MagickBooleanType) argument_list[4].integer_reference; channel_mask=SetPixelChannelMask(image,channel); - (void) OpaquePaintImage(image,&target,&fill_color,invert); + (void) OpaquePaintImage(image,&target,&fill_color,invert,exception); (void) SetPixelChannelMask(image,channel_mask); break; } @@ -8996,7 +8996,7 @@ Mogrify(ref,...) if (attribute_flag[3] != 0) invert=(MagickBooleanType) argument_list[3].integer_reference; (void) TransparentPaintImage(image,&target,ClampToQuantum(opacity), - invert); + invert,exception); break; } case 57: /* Threshold */ @@ -10166,7 +10166,7 @@ Mogrify(ref,...) invert=(MagickBooleanType) argument_list[7].integer_reference; channel_mask=SetPixelChannelMask(image,channel); (void) FloodfillPaintImage(image,draw_info,&target,geometry.x, - geometry.y,invert); + geometry.y,invert,exception); (void) SetPixelChannelMask(image,channel_mask); draw_info=DestroyDrawInfo(draw_info); break; @@ -11088,7 +11088,7 @@ Montage(ref,...) QueryMagickColor(SvPV(ST(i),na),&transparent_color,exception); for (next=image; next; next=next->next) (void) TransparentPaintImage(next,&transparent_color, - TransparentAlpha,MagickFalse); + TransparentAlpha,MagickFalse,exception); break; } ThrowPerlException(exception,OptionError,"UnrecognizedAttribute", @@ -11110,7 +11110,7 @@ Montage(ref,...) if (transparent_color.alpha != TransparentAlpha) for (next=image; next; next=next->next) (void) TransparentPaintImage(next,&transparent_color, - TransparentAlpha,MagickFalse); + TransparentAlpha,MagickFalse,exception); for ( ; image; image=image->next) { AddImageToRegistry(sv,image); diff --git a/coders/gradient.c b/coders/gradient.c index 424bca570..7f2e1b2ec 100644 --- a/coders/gradient.c +++ b/coders/gradient.c @@ -133,7 +133,8 @@ static Image *ReadGRADIENTImage(const ImageInfo *image_info, return((Image *) NULL); } (void) GradientImage(image,LocaleCompare(image_info->magick,"GRADIENT") == 0 ? - LinearGradient : RadialGradient,PadSpread,&start_color,&stop_color); + LinearGradient : RadialGradient,PadSpread,&start_color,&stop_color, + exception); return(GetFirstImageInList(image)); } diff --git a/coders/msl.c b/coders/msl.c index d0e942d8e..37a05ee5d 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -1718,7 +1718,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target, geometry.x,geometry.y,paint_method == FloodfillMethod ? - MagickFalse : MagickTrue); + MagickFalse : MagickTrue,&msl_info->image[n]->exception); draw_info=DestroyDrawInfo(draw_info); break; } @@ -3742,7 +3742,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, channel_mask=SetPixelChannelMask(msl_info->image[n],AlphaChannel); (void) FloodfillPaintImage(msl_info->image[n],draw_info,&target, geometry.x,geometry.y,paint_method == FloodfillMethod ? - MagickFalse : MagickTrue); + MagickFalse : MagickTrue,&msl_info->image[n]->exception); (void) SetPixelChannelMap(msl_info->image[n],channel_mask); draw_info=DestroyDrawInfo(draw_info); break; @@ -4235,7 +4235,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, } channel_mask=SetPixelChannelMask(msl_info->image[n],channel); (void) OpaquePaintImage(msl_info->image[n],&target,&fill_color, - MagickFalse); + MagickFalse,&msl_info->image[n]->exception); (void) SetPixelChannelMap(msl_info->image[n],channel_mask); break; } @@ -7111,7 +7111,7 @@ static void MSLStartElement(void *context,const xmlChar *tag, (void) QueryMagickColor(value,&target,&exception); (void) TransparentPaintImage(msl_info->image[n],&target, - TransparentAlpha,MagickFalse); + TransparentAlpha,MagickFalse,&msl_info->image[n]->exception); break; } ThrowMSLException(OptionError,"UnrecognizedAttribute",keyword); diff --git a/coders/palm.c b/coders/palm.c index 91cc2094d..367a9ab0e 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -515,12 +515,12 @@ static Image *ReadPALMImage(const ImageInfo *image_info, if (bits_per_pixel != 16) SetPixelInfoPacket(image,image->colormap+(mask-transparentIndex), &transpix); - (void) TransparentPaintImage(image,&transpix,(Quantum) - TransparentAlpha,MagickFalse); + (void) TransparentPaintImage(image,&transpix,(Quantum) TransparentAlpha, + MagickFalse,exception); } one_row=(unsigned char *) RelinquishMagickMemory(one_row); if (compressionType == PALM_COMPRESSION_SCANLINE) - lastrow=(unsigned char *) RelinquishMagickMemory(lastrow); + lastrow=(unsigned char *) RelinquishMagickMemory(lastrow); /* Proceed to next image. Copied from coders/pnm.c */ -- 2.40.0