]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 16 Oct 2011 14:58:39 +0000 (14:58 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 16 Oct 2011 14:58:39 +0000 (14:58 +0000)
MagickWand/magick-property.c
MagickWand/magick-wand.c
MagickWand/pixel-iterator.c
MagickWand/wand-view.c

index d2d92536a54d3af633b35cc711f6ba9f415b7d36..b431aaffdcf52d8388f2bed0f719386a2f51ac14 100644 (file)
@@ -2240,19 +2240,13 @@ WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
   const char *artifact,const char *value)
 {
-  MagickBooleanType
-    status;
-
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
   if (wand->debug != MagickFalse)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  status=SetImageArtifact(wand->images,artifact,value);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
-  return(status);
+  return(SetImageArtifact(wand->images,artifact,value));
 }
 \f
 /*
@@ -2306,8 +2300,6 @@ WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand,
   SetStringInfoDatum(profile_info,(unsigned char *) profile);
   status=SetImageProfile(wand->images,name,profile_info,wand->exception);
   profile_info=DestroyStringInfo(profile_info);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
   return(status);
 }
 \f
index 305863673a4b8620b98e647250487ec01d9af9cc..b698dd25aec650d8fbf1d85af1332f51c228d364 100644 (file)
@@ -565,8 +565,7 @@ WandExport double *MagickQueryFontMetrics(MagickWand *wand,
     }
   (void) CloneString(&draw_info->text,text);
   (void) ResetMagickMemory(&metrics,0,sizeof(metrics));
-  status=GetTypeMetrics(wand->images,draw_info,&metrics,
-    &wand->images->exception);
+  status=GetTypeMetrics(wand->images,draw_info,&metrics,wand->exception);
   draw_info=DestroyDrawInfo(draw_info);
   if (status == MagickFalse)
     {
@@ -674,7 +673,7 @@ WandExport double *MagickQueryMultilineFontMetrics(MagickWand *wand,
   (void) CloneString(&draw_info->text,text);
   (void) ResetMagickMemory(&metrics,0,sizeof(metrics));
   status=GetMultilineTypeMetrics(wand->images,draw_info,&metrics,
-    &wand->images->exception);
+    wand->exception);
   draw_info=DestroyDrawInfo(draw_info);
   if (status == MagickFalse)
     {
@@ -918,7 +917,8 @@ WandExport MagickBooleanType MagickSetIteratorIndex(MagickWand *wand,
   image=GetImageFromList(wand->images,index);
   if (image == (Image *) NULL)
     {
-      InheritException(wand->exception,&wand->images->exception);
+      (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError,
+        "NoSuchImage","`%s'",wand->name);
       return(MagickFalse);
     }
   wand->images=image;
index 3fa676a0ad97eab7e3870e9054d064d3ea5c9dee..dec99443bca41df931f4145c607a41b688e54a05 100644 (file)
@@ -504,11 +504,7 @@ WandExport PixelWand **PixelGetCurrentIteratorRow(PixelIterator *iterator,
     iterator->region.y+iterator->y,iterator->region.width,1,
     iterator->exception);
   if (pixels == (const Quantum *) NULL)
-    {
-      InheritException(iterator->exception,GetCacheViewException(
-        iterator->view));
-      return((PixelWand **) NULL);
-    }
+    return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
     PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
@@ -688,11 +684,7 @@ WandExport PixelWand **PixelGetNextIteratorRow(PixelIterator *iterator,
     iterator->region.y+iterator->y,iterator->region.width,1,
     iterator->exception);
   if (pixels == (const Quantum *) NULL)
-    {
-      InheritException(iterator->exception,GetCacheViewException(
-        iterator->view));
-      return((PixelWand **) NULL);
-    }
+    return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
     PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
@@ -750,11 +742,7 @@ WandExport PixelWand **PixelGetPreviousIteratorRow(PixelIterator *iterator,
     iterator->region.y+iterator->y,iterator->region.width,1,
     iterator->exception);
   if (pixels == (const Quantum *) NULL)
-    {
-      InheritException(iterator->exception,GetCacheViewException(
-        iterator->view));
-      return((PixelWand **) NULL);
-    }
+    return((PixelWand **) NULL);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
     PixelSetQuantumPixel(iterator->image,pixels,iterator->pixel_wands[x]);
@@ -923,9 +911,6 @@ WandExport void PixelSetLastIteratorRow(PixelIterator *iterator)
 */
 WandExport MagickBooleanType PixelSyncIterator(PixelIterator *iterator)
 {
-  ExceptionInfo
-    *exception;
-
   register ssize_t
     x;
 
@@ -938,25 +923,17 @@ WandExport MagickBooleanType PixelSyncIterator(PixelIterator *iterator)
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
   if (SetCacheViewStorageClass(iterator->view,DirectClass) == MagickFalse)
     return(MagickFalse);
-  exception=iterator->exception;
   pixels=GetCacheViewAuthenticPixels(iterator->view,iterator->region.x,
-    iterator->region.y+iterator->y,iterator->region.width,1,exception);
+    iterator->region.y+iterator->y,iterator->region.width,1,
+    iterator->exception);
   if (pixels == (Quantum *) NULL)
-    {
-      InheritException(iterator->exception,GetCacheViewException(
-        iterator->view));
-      return(MagickFalse);
-    }
+    return(MagickFalse);
   for (x=0; x < (ssize_t) iterator->region.width; x++)
   {
     PixelGetQuantumPixel(iterator->image,iterator->pixel_wands[x],pixels);
     pixels+=GetPixelChannels(iterator->image);
   }
-  if (SyncCacheViewAuthenticPixels(iterator->view,exception) == MagickFalse)
-    {
-      InheritException(iterator->exception,GetCacheViewException(
-        iterator->view));
-      return(MagickFalse);
-    }
+  if (SyncCacheViewAuthenticPixels(iterator->view,iterator->exception) == MagickFalse)
+    return(MagickFalse);
   return(MagickTrue);
 }
index 83b024e307643bffa4722b45a99058eba49ca4e9..b0a7849bc46c8eb632f26f9005b8ee15bfbc8c47 100644 (file)
@@ -263,9 +263,6 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
   WandView *duplex,WandView *destination,DuplexTransferWandViewMethod transfer,
   void *context)
 {
-  ExceptionInfo
-    *exception;
-
   Image
     *destination_image,
     *source_image;
@@ -285,8 +282,9 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
     return(MagickFalse);
   source_image=source->wand->images;
   destination_image=destination->wand->images;
-  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;
@@ -339,7 +337,8 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
       duplex_pixels+=GetPixelChannels(duplex->image);
     }
     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;
@@ -354,20 +353,17 @@ WandExport MagickBooleanType DuplexTransferWandViewIterator(WandView *source,
     if (transfer(source,duplex,destination,y,id,context) == MagickFalse)
       status=MagickFalse;
     destination_pixels=GetCacheViewAuthenticPixels(destination->view,
-      destination->extent.x,y,destination->extent.width,1,exception);
+      destination->extent.x,y,destination->extent.width,1,
+      destination->exception);
     for (x=0; x < (ssize_t) destination->extent.width; x++)
     {
       PixelGetQuantumPixel(destination->image,destination->pixel_wands[id][x],
         destination_pixels);
       destination_pixels+=GetPixelChannels(destination->image);
     }
-    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
@@ -904,9 +900,6 @@ MagickExport void SetWandViewDescription(WandView *wand_view,
 WandExport MagickBooleanType SetWandViewIterator(WandView *destination,
   SetWandViewMethod set,void *context)
 {
-  ExceptionInfo
-    *exception;
-
   Image
     *destination_image;
 
@@ -924,8 +917,9 @@ WandExport MagickBooleanType SetWandViewIterator(WandView *destination,
   if (set == (SetWandViewMethod) NULL)
     return(MagickFalse);
   destination_image=destination->wand->images;
-  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;
@@ -949,11 +943,9 @@ WandExport MagickBooleanType SetWandViewIterator(WandView *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;
       }
@@ -965,13 +957,9 @@ WandExport MagickBooleanType SetWandViewIterator(WandView *destination,
         pixels);
       pixels+=GetPixelChannels(destination->image);
     }
-    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
@@ -1075,9 +1063,6 @@ MagickExport void SetWandViewThreads(WandView *image_view,
 WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
   WandView *destination,TransferWandViewMethod transfer,void *context)
 {
-  ExceptionInfo
-    *exception;
-
   Image
     *destination_image,
     *source_image;
@@ -1097,8 +1082,9 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
     return(MagickFalse);
   source_image=source->wand->images;
   destination_image=destination->wand->images;
-  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;
@@ -1137,7 +1123,8 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
       pixels+=GetPixelChannels(source->image);
     }
     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;
@@ -1152,20 +1139,17 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
     if (transfer(source,destination,y,id,context) == MagickFalse)
       status=MagickFalse;
     destination_pixels=GetCacheViewAuthenticPixels(destination->view,
-      destination->extent.x,y,destination->extent.width,1,exception);
+      destination->extent.x,y,destination->extent.width,1,
+      destination->exception);
     for (x=0; x < (ssize_t) destination->extent.width; x++)
     {
       PixelGetQuantumPixel(destination->image,destination->pixel_wands[id][x],
         destination_pixels);
       destination_pixels+=GetPixelChannels(destination->image);
     }
-    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
@@ -1229,9 +1213,6 @@ WandExport MagickBooleanType TransferWandViewIterator(WandView *source,
 WandExport MagickBooleanType UpdateWandViewIterator(WandView *source,
   UpdateWandViewMethod update,void *context)
 {
-  ExceptionInfo
-    *exception;
-
   Image
     *source_image;
 
@@ -1249,8 +1230,8 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *source,
   if (update == (UpdateWandViewMethod) NULL)
     return(MagickFalse);
   source_image=source->wand->images;
-  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;
@@ -1262,6 +1243,9 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *source,
     const int
       id = GetOpenMPThreadId();
 
+    MagickBooleanType
+      sync;
+
     register ssize_t
       x;
 
@@ -1271,11 +1255,9 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *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;
       }
@@ -1291,11 +1273,9 @@ WandExport MagickBooleanType UpdateWandViewIterator(WandView *source,
       PixelGetQuantumPixel(source->image,source->pixel_wands[id][x],pixels);
       pixels+=GetPixelChannels(source->image);
     }
-    if (SyncCacheViewAuthenticPixels(source->view,exception) == MagickFalse)
-      {
-        InheritException(source->exception,GetCacheViewException(source->view));
-        status=MagickFalse;
-      }
+    sync=SyncCacheViewAuthenticPixels(source->view,source->exception);
+    if (sync == MagickFalse)
+      status=MagickFalse;
     if (source_image->progress_monitor != (MagickProgressMonitor) NULL)
       {
         MagickBooleanType