From cad4e1b9691af480db55fb597175db5f3e7d6acc Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 16 Oct 2011 14:58:39 +0000 Subject: [PATCH] --- MagickWand/magick-property.c | 10 +---- MagickWand/magick-wand.c | 8 ++-- MagickWand/pixel-iterator.c | 39 ++++------------ MagickWand/wand-view.c | 86 ++++++++++++++---------------------- 4 files changed, 46 insertions(+), 97 deletions(-) diff --git a/MagickWand/magick-property.c b/MagickWand/magick-property.c index d2d92536a..b431aaffd 100644 --- a/MagickWand/magick-property.c +++ b/MagickWand/magick-property.c @@ -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)); } /* @@ -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); } diff --git a/MagickWand/magick-wand.c b/MagickWand/magick-wand.c index 305863673..b698dd25a 100644 --- a/MagickWand/magick-wand.c +++ b/MagickWand/magick-wand.c @@ -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; diff --git a/MagickWand/pixel-iterator.c b/MagickWand/pixel-iterator.c index 3fa676a0a..dec99443b 100644 --- a/MagickWand/pixel-iterator.c +++ b/MagickWand/pixel-iterator.c @@ -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); } diff --git a/MagickWand/wand-view.c b/MagickWand/wand-view.c index 83b024e30..b0a7849bc 100644 --- a/MagickWand/wand-view.c +++ b/MagickWand/wand-view.c @@ -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 -- 2.40.0