From: cristy Date: Thu, 20 Oct 2011 16:04:16 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~6775 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c3af951210f34d3f244b31f06ee291e5be8ecb7;p=imagemagick --- diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index ebc69f3de..bf92645f7 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -2062,7 +2062,7 @@ static MagickBooleanType RenderX11(Image *image,const DrawInfo *draw_info, pixel.pen_color.red=ScaleQuantumToShort(draw_info->fill.red); pixel.pen_color.green=ScaleQuantumToShort(draw_info->fill.green); pixel.pen_color.blue=ScaleQuantumToShort(draw_info->fill.blue); - status=XAnnotateImage(display,&pixel,&annotate_info,image); + status=XAnnotateImage(display,&pixel,&annotate_info,image,exception); if (status == 0) { ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed", diff --git a/MagickCore/display.c b/MagickCore/display.c index 4f68122a1..96bbcd806 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -2730,7 +2730,8 @@ static MagickBooleanType XAnnotateEditImage(Display *display, /* Annotate image with text. */ - status=XAnnotateImage(display,windows->pixel_info,annotate_info,image); + status=XAnnotateImage(display,windows->pixel_info,annotate_info,image, + exception); if (status == 0) return(MagickFalse); /* diff --git a/MagickCore/identify.c b/MagickCore/identify.c index d309087c3..ba1c16def 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -573,7 +573,7 @@ MagickExport MagickBooleanType IdentifyImage(Image *image,FILE *file, { if (image->colorspace == CMYKColorspace) (void) FormatLocaleFile(file," Total ink density: %.0f%%\n",100.0* - GetImageTotalInkDensity(image)/(double) QuantumRange); + GetImageTotalInkDensity(image,exception)/(double) QuantumRange); x=0; if (image->matte != MagickFalse) { diff --git a/MagickCore/image-view.c b/MagickCore/image-view.c index edfa608f3..fe099978f 100644 --- a/MagickCore/image-view.c +++ b/MagickCore/image-view.c @@ -215,9 +215,6 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( ImageView *source,ImageView *duplex,ImageView *destination, DuplexTransferImageViewMethod transfer,void *context) { - ExceptionInfo - *exception; - Image *destination_image, *source_image; @@ -237,8 +234,9 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( return(MagickFalse); source_image=source->image; destination_image=destination->image; - exception=destination->exception; - if (SetImageStorageClass(destination_image,DirectClass,exception) == MagickFalse) + status=SetImageStorageClass(destination_image,DirectClass, + destination->exception); + if (status == MagickFalse) return(MagickFalse); status=MagickTrue; progress=0; @@ -277,7 +275,8 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( continue; } destination_pixels=GetCacheViewAuthenticPixels(destination->view, - destination->extent.x,y,destination->extent.width,1,exception); + destination->extent.x,y,destination->extent.width,1, + destination->exception); if (destination_pixels == (Quantum *) NULL) { status=MagickFalse; @@ -285,13 +284,9 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( } if (transfer(source,duplex,destination,y,id,context) == MagickFalse) status=MagickFalse; - sync=SyncCacheViewAuthenticPixels(destination->view,exception); + sync=SyncCacheViewAuthenticPixels(destination->view,destination->exception); if (sync == MagickFalse) - { - InheritException(destination->exception,GetCacheViewException( - source->view)); - status=MagickFalse; - } + status=MagickFalse; if (source_image->progress_monitor != (MagickProgressMonitor) NULL) { MagickBooleanType @@ -314,7 +309,7 @@ MagickExport MagickBooleanType DuplexTransferImageViewIterator( % % % % % % -% G e t I m a g e V i e w A u t h e n t i c M e t a c o n t e n t % +% G e t I m a g e V i e w A u t h e n t i c M e t a c o n t e n t % % % % % % % @@ -864,9 +859,6 @@ MagickExport void SetImageViewDescription(ImageView *image_view, MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination, SetImageViewMethod set,void *context) { - ExceptionInfo - *exception; - Image *destination_image; @@ -884,8 +876,9 @@ MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination, if (set == (SetImageViewMethod) NULL) return(MagickFalse); destination_image=destination->image; - exception=destination->exception; - if (SetImageStorageClass(destination_image,DirectClass,exception) == MagickFalse) + status=SetImageStorageClass(destination_image,DirectClass, + destination->exception); + if (status == MagickFalse) return(MagickFalse); status=MagickTrue; progress=0; @@ -906,23 +899,17 @@ MagickExport MagickBooleanType SetImageViewIterator(ImageView *destination, if (status == MagickFalse) continue; pixels=GetCacheViewAuthenticPixels(destination->view,destination->extent.x, - y,destination->extent.width,1,exception); + y,destination->extent.width,1,destination->exception); if (pixels == (Quantum *) NULL) { - InheritException(destination->exception,GetCacheViewException( - destination->view)); status=MagickFalse; continue; } if (set(destination,y,id,context) == MagickFalse) status=MagickFalse; - sync=SyncCacheViewAuthenticPixels(destination->view,exception); + sync=SyncCacheViewAuthenticPixels(destination->view,destination->exception); if (sync == MagickFalse) - { - InheritException(destination->exception,GetCacheViewException( - destination->view)); - status=MagickFalse; - } + status=MagickFalse; if (destination_image->progress_monitor != (MagickProgressMonitor) NULL) { MagickBooleanType @@ -1026,9 +1013,6 @@ MagickExport void SetImageViewThreads(ImageView *image_view, MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, ImageView *destination,TransferImageViewMethod transfer,void *context) { - ExceptionInfo - *exception; - Image *destination_image, *source_image; @@ -1048,8 +1032,9 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, return(MagickFalse); source_image=source->image; destination_image=destination->image; - exception=destination->exception; - if (SetImageStorageClass(destination_image,DirectClass,exception) == MagickFalse) + status=SetImageStorageClass(destination_image,DirectClass, + destination->exception); + if (status == MagickFalse) return(MagickFalse); status=MagickTrue; progress=0; @@ -1080,7 +1065,8 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, continue; } destination_pixels=GetCacheViewAuthenticPixels(destination->view, - destination->extent.x,y,destination->extent.width,1,exception); + destination->extent.x,y,destination->extent.width,1, + destination->exception); if (destination_pixels == (Quantum *) NULL) { status=MagickFalse; @@ -1088,13 +1074,9 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, } if (transfer(source,destination,y,id,context) == MagickFalse) status=MagickFalse; - sync=SyncCacheViewAuthenticPixels(destination->view,exception); + sync=SyncCacheViewAuthenticPixels(destination->view,destination->exception); if (sync == MagickFalse) - { - InheritException(destination->exception,GetCacheViewException( - source->view)); - status=MagickFalse; - } + status=MagickFalse; if (source_image->progress_monitor != (MagickProgressMonitor) NULL) { MagickBooleanType @@ -1158,9 +1140,6 @@ MagickExport MagickBooleanType TransferImageViewIterator(ImageView *source, MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source, UpdateImageViewMethod update,void *context) { - ExceptionInfo - *exception; - Image *source_image; @@ -1178,8 +1157,8 @@ MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source, if (update == (UpdateImageViewMethod) NULL) return(MagickFalse); source_image=source->image; - exception=source->exception; - if (SetImageStorageClass(source_image,DirectClass,exception) == MagickFalse) + status=SetImageStorageClass(source_image,DirectClass,source->exception); + if (status == MagickFalse) return(MagickFalse); status=MagickTrue; progress=0; @@ -1197,20 +1176,17 @@ MagickExport MagickBooleanType UpdateImageViewIterator(ImageView *source, if (status == MagickFalse) continue; pixels=GetCacheViewAuthenticPixels(source->view,source->extent.x,y, - source->extent.width,1,exception); + source->extent.width,1,source->exception); if (pixels == (Quantum *) NULL) { - InheritException(source->exception,GetCacheViewException(source->view)); status=MagickFalse; continue; } if (update(source,y,id,context) == MagickFalse) status=MagickFalse; - if (SyncCacheViewAuthenticPixels(source->view,exception) == MagickFalse) - { - InheritException(source->exception,GetCacheViewException(source->view)); - status=MagickFalse; - } + status=SyncCacheViewAuthenticPixels(source->view,source->exception); + if (status == MagickFalse) + status=MagickFalse; if (source_image->progress_monitor != (MagickProgressMonitor) NULL) { MagickBooleanType diff --git a/MagickCore/layer.c b/MagickCore/layer.c index 48e52b70c..637158967 100644 --- a/MagickCore/layer.c +++ b/MagickCore/layer.c @@ -84,7 +84,8 @@ % % The format is: % -% void ClearBounds(Image *image,RectangleInfo *bounds) +% void ClearBounds(Image *image,RectangleInfo *bounds +% ExceptionInfo *exception) % % A description of each parameter follows: % @@ -92,18 +93,17 @@ % % o bounds: the area to be clear within the imag image % +% o exception: return any errors or warnings in this structure. +% */ -static void ClearBounds(Image *image,RectangleInfo *bounds) +static void ClearBounds(Image *image,RectangleInfo *bounds, + ExceptionInfo *exception) { - ExceptionInfo - *exception; - ssize_t y; if (bounds->x < 0) return; - exception=(&image->exception); if (image->matte == MagickFalse) (void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception); for (y=0; y < (ssize_t) bounds->height; y++) @@ -322,7 +322,7 @@ MagickExport Image *CoalesceImages(const Image *image,ExceptionInfo *exception) Clear the overlaid area of the coalesced bounds for background disposal */ if (next->previous->dispose == BackgroundDispose) - ClearBounds(dispose_image, &bounds); + ClearBounds(dispose_image,&bounds,exception); /* Next image is the dispose image, overlaid with next frame in sequence. */ @@ -451,7 +451,7 @@ MagickExport Image *DisposeImages(const Image *image,ExceptionInfo *exception) } if ((ssize_t) (bounds.y+bounds.height) > (ssize_t) current_image->rows) bounds.height=current_image->rows-bounds.y; - ClearBounds(current_image,&bounds); + ClearBounds(current_image,&bounds,exception); } /* Select the appropriate previous/disposed image. @@ -1107,7 +1107,7 @@ static Image *OptimizeLayerFrames(const Image *image, return((Image *) NULL); } dup_bounds=CompareImagesBounds(dup_image,curr,CompareClearLayer,exception); - ClearBounds(dup_image,&dup_bounds); + ClearBounds(dup_image,&dup_bounds,exception); try_bounds=CompareImagesBounds(dup_image,curr,CompareAnyLayer,exception); if ( cleared || dup_bounds.width*dup_bounds.height @@ -1137,7 +1137,7 @@ static Image *OptimizeLayerFrames(const Image *image, return((Image *) NULL); } bgnd_bounds=bounds[i-1]; /* interum bounds of the previous image */ - ClearBounds(bgnd_image,&bgnd_bounds); + ClearBounds(bgnd_image,&bgnd_bounds,exception); try_bounds=CompareImagesBounds(bgnd_image,curr,CompareAnyLayer,exception); try_cleared=IsBoundsCleared(bgnd_image,curr,&try_bounds,exception); #if DEBUG_OPT_FRAME @@ -1200,7 +1200,7 @@ static Image *OptimizeLayerFrames(const Image *image, (double) bgnd_bounds.x,(double) bgnd_bounds.y ); #endif } - ClearBounds(bgnd_image,&bgnd_bounds); + ClearBounds(bgnd_image,&bgnd_bounds,exception); #if DEBUG_OPT_FRAME /* Something strange is happening with a specific animation * CompareAnyLayers (normal method) and CompareClearLayers returns the whole @@ -1531,7 +1531,7 @@ MagickExport void OptimizeImageTransparency(const Image *image, } if ((ssize_t) (bounds.y+bounds.height) > (ssize_t) current_image->rows) bounds.height=current_image->rows-bounds.y; - ClearBounds(current_image, &bounds); + ClearBounds(current_image, &bounds,exception); } if (next->dispose != PreviousDispose) { diff --git a/MagickCore/nt-base.c b/MagickCore/nt-base.c index e141d08ab..86d67d637 100644 --- a/MagickCore/nt-base.c +++ b/MagickCore/nt-base.c @@ -497,21 +497,20 @@ MagickPrivate int gettimeofday (struct timeval *time_value, % % The format of the ImageToHBITMAP method is: % -% HBITMAP ImageToHBITMAP(Image *image) +% HBITMAP ImageToHBITMAP(Image *image,ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image to convert. % +% o exception: return any errors or warnings in this structure. +% */ -MagickExport void *ImageToHBITMAP(Image *image) +MagickExport void *ImageToHBITMAP(Image *image,ExceptionInfo *exception) { BITMAP bitmap; - ExceptionInfo - *exception; - HANDLE bitmap_bitsH; @@ -562,7 +561,6 @@ MagickExport void *ImageToHBITMAP(Image *image) if (bitmap.bmBits == NULL) bitmap.bmBits=bitmap_bits; (void) TransformImageColorspace(image,RGBColorspace,exception); - exception=(&image->exception); for (y=0; y < (ssize_t) image->rows; y++) { p=GetVirtualPixels(image,0,y,image->columns,1,exception); diff --git a/MagickCore/nt-base.h b/MagickCore/nt-base.h index ba6321676..6fd766ec5 100644 --- a/MagickCore/nt-base.h +++ b/MagickCore/nt-base.h @@ -39,7 +39,7 @@ extern MagickExport int extern MagickExport void *CropImageToHBITMAP(Image *,const RectangleInfo *,ExceptionInfo *), - *ImageToHBITMAP(Image *), + *ImageToHBITMAP(Image *,ExceptionInfo *), NTErrorHandler(const ExceptionType,const char *,const char *), NTWarningHandler(const ExceptionType,const char *,const char *); #endif diff --git a/MagickCore/prepress.c b/MagickCore/prepress.c index 76b09f6d3..253c7f420 100644 --- a/MagickCore/prepress.c +++ b/MagickCore/prepress.c @@ -71,14 +71,18 @@ % % The format of the GetImageTotalInkDensity method is: % -% double GetImageTotalInkDensity(const Image *image) +% double GetImageTotalInkDensity(const Image *image, +% ExceptionInfo *exception) % % A description of each parameter follows: % % o image: the image. % +% o exception: return any errors or warnings in this structure. +% */ -MagickExport double GetImageTotalInkDensity(Image *image) +MagickExport double GetImageTotalInkDensity(Image *image, + ExceptionInfo *exception) { CacheView *image_view; @@ -86,9 +90,6 @@ MagickExport double GetImageTotalInkDensity(Image *image) double total_ink_density; - ExceptionInfo - *exception; - MagickBooleanType status; @@ -107,7 +108,6 @@ MagickExport double GetImageTotalInkDensity(Image *image) } status=MagickTrue; total_ink_density=0.0; - exception=(&image->exception); image_view=AcquireCacheView(image); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(dynamic,4) shared(status) diff --git a/MagickCore/prepress.h b/MagickCore/prepress.h index b3c46a206..6829c50ae 100644 --- a/MagickCore/prepress.h +++ b/MagickCore/prepress.h @@ -23,7 +23,7 @@ extern "C" { #endif extern MagickExport double - GetImageTotalInkDensity(Image *image); + GetImageTotalInkDensity(Image *image,ExceptionInfo *); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/MagickCore/segment.c b/MagickCore/segment.c index ee2fa59fc..2c1eca055 100644 --- a/MagickCore/segment.c +++ b/MagickCore/segment.c @@ -528,7 +528,6 @@ static MagickBooleanType Classify(Image *image,short **extrema, /* Do course grain classes. */ - exception=(&image->exception); image_view=AcquireCacheView(image); #if defined(MAGICKCORE_OPENMP_SUPPORT) #pragma omp parallel for schedule(dynamic,4) shared(progress,status) diff --git a/MagickCore/xwindow-private.h b/MagickCore/xwindow-private.h index a37978a3d..78682bcc0 100644 --- a/MagickCore/xwindow-private.h +++ b/MagickCore/xwindow-private.h @@ -512,7 +512,8 @@ extern MagickPrivate int XCheckDefineCursor(Display *,Window,Cursor); extern MagickPrivate MagickBooleanType - XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *), + XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *, + ExceptionInfo *), XComponentGenesis(void), XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *), XGetWindowColor(Display *,XWindows *,char *), diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index 464941573..262fdb26f 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -443,7 +443,8 @@ MagickExport void DestroyXResources(void) % The format of the XAnnotateImage method is: % % MagickBooleanType XAnnotateImage(Display *display, -% const XPixelInfo *pixel,XAnnotateInfo *annotate_info,Image *image) +% const XPixelInfo *pixel,XAnnotateInfo *annotate_info,Image *image, +% ExceptionInfo *exception) % % A description of each parameter follows: % @@ -456,9 +457,12 @@ MagickExport void DestroyXResources(void) % % o image: the image. % +% o exception: return any errors or warnings in this structure. +% */ MagickPrivate MagickBooleanType XAnnotateImage(Display *display, - const XPixelInfo *pixel,XAnnotateInfo *annotate_info,Image *image) + const XPixelInfo *pixel,XAnnotateInfo *annotate_info,Image *image, + ExceptionInfo *exception) { CacheView *annotate_view; @@ -466,9 +470,6 @@ MagickPrivate MagickBooleanType XAnnotateImage(Display *display, GC annotate_context; - ExceptionInfo - *exception; - Image *annotate_image; diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 923eca472..fa030552d 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -5617,7 +5617,7 @@ WandExport double MagickGetImageTotalInkDensity(MagickWand *wand) "ContainsNoImages","`%s'",wand->name); return(0.0); } - return(GetImageTotalInkDensity(wand->images)); + return(GetImageTotalInkDensity(wand->images,wand->exception)); } /*