]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 20 Oct 2011 16:04:16 +0000 (16:04 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 20 Oct 2011 16:04:16 +0000 (16:04 +0000)
13 files changed:
MagickCore/annotate.c
MagickCore/display.c
MagickCore/identify.c
MagickCore/image-view.c
MagickCore/layer.c
MagickCore/nt-base.c
MagickCore/nt-base.h
MagickCore/prepress.c
MagickCore/prepress.h
MagickCore/segment.c
MagickCore/xwindow-private.h
MagickCore/xwindow.c
MagickWand/magick-image.c

index ebc69f3de75f211f421f43d2f69d0e2e09d33e7a..bf92645f7629e4aa88f15123a1b4ab9f664a9c1b 100644 (file)
@@ -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",
index 4f68122a1e34fbf42d62ff1a9c735451981f893e..96bbcd80627d90781ab3ce3f0e7e28eb2968da6c 100644 (file)
@@ -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);
     /*
index d309087c38a2843708a5012ac9ec979c56fb38a7..ba1c16def6976bca916a48f82858d9911b70e5b4 100644 (file)
@@ -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)
         {
index edfa608f3477254a205f8bc3c00844fefa0360e2..fe099978f9dbf0af96142ea38bfc579fc59f0663 100644 (file)
@@ -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
index 48e52b70c7d4e9c5c643592e0467960c45ccfb70..637158967716b867d90242f2aeb7aa72b5af1b67 100644 (file)
@@ -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:
 %
 %
 %    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)
       {
index e141d08abdb50637a4d9bedb631d81bf97efe98b..86d67d6377e9f67bd53a969462b29632eece75e0 100644 (file)
@@ -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);
index ba63216769fb16c542dc3009bd4e3ccc475db53c..6fd766ec5c13433a63affdb2387f8813f771543b 100644 (file)
@@ -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
index 76b09f6d3c553edc90d690f3cbc7e48117fc6986..253c7f420ce74c558f819f9ce1801da4dd512baf 100644 (file)
 %
 %  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)
index b3c46a20679d1e9fa7ffc69fdfa3ccb0eb721282..6829c50ae60bd153eaa418c61ffb7704b6f103d9 100644 (file)
@@ -23,7 +23,7 @@ extern "C" {
 #endif
 
 extern MagickExport double
-  GetImageTotalInkDensity(Image *image);
+  GetImageTotalInkDensity(Image *image,ExceptionInfo *);
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index ee2fa59fc9466b45a345dc16bb1fd42534572877..2c1eca05553be025b643e935a4dc8c02c393ff06 100644 (file)
@@ -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)
index a37978a3dfc2457de8cf8634726ce8a9de6e049b..78682bcc0364e7fffb3496ffad700551c90e1d8d 100644 (file)
@@ -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 *),
index 4649415735d1e6630c9d051806991062db05b1d9..262fdb26f29b6b7db4b4f2ebbc84c5104a13671b 100644 (file)
@@ -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;
 
index 923eca4723b9c586f863d71bbf8a12e3aae00142..fa030552d942e369be06fc98b30dc7ea27ecdb52 100644 (file)
@@ -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));
 }
 \f
 /*