From: anthony Date: Fri, 30 Mar 2012 14:35:24 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5929 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8270b722ebf3396f5428f5988484e6f8922f43ac;p=imagemagick --- diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 69aa16a40..8650d7e60 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -97,8 +97,9 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); if (clone_wand == (MagickWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", @@ -112,9 +113,10 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, clone_wand->image_info=CloneImageInfo(wand->image_info); clone_wand->images=images; clone_wand->debug=IsEventLogging(); - if (clone_wand->debug != MagickFalse) - (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name); clone_wand->signature=WandSignature; + + if( IfMagickTrue(clone_wand->debug) ) + (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name); return(clone_wand); } @@ -144,7 +146,7 @@ WandExport Image *GetImageFromMagickWand(const MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); if (wand->images == (Image *) NULL) { @@ -196,8 +198,9 @@ WandExport MagickBooleanType MagickAdaptiveBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sharp_image=AdaptiveBlurImage(wand->images,radius,sigma,wand->exception); @@ -241,8 +244,9 @@ WandExport MagickBooleanType MagickAdaptiveResizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); resize_image=AdaptiveResizeImage(wand->images,columns,rows,wand->exception); @@ -293,8 +297,9 @@ WandExport MagickBooleanType MagickAdaptiveSharpenImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sharp_image=AdaptiveSharpenImage(wand->images,radius,sigma,wand->exception); @@ -344,8 +349,9 @@ WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); threshold_image=AdaptiveThresholdImage(wand->images,width,height,bias, @@ -401,7 +407,7 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand, /* if no images in wand, just add them, set current as appropriate */ if (wand->images == (Image *) NULL) { - if (wand->insert_before != MagickFalse) + if( IfMagickTrue(wand->insert_before) ) wand->images=GetFirstImageInList(images); else wand->images=GetLastImageInList(images); @@ -409,7 +415,7 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand, } /* user jumped to first image, so prepend new images - remain active */ - if ((wand->insert_before != MagickFalse) && + if( IfMagickTrue((wand->insert_before) ) && (wand->images->previous == (Image *) NULL) ) { PrependImageToList(&wand->images,images); @@ -440,8 +446,9 @@ WandExport MagickBooleanType MagickAddImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + assert(add_wand != (MagickWand *) NULL); assert(add_wand->signature == WandSignature); if (add_wand->images == (Image *) NULL) @@ -490,8 +497,9 @@ WandExport MagickBooleanType MagickAddNoiseImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); noise_image=AddNoiseImage(wand->images,noise_type,attenuate,wand->exception); @@ -538,8 +546,9 @@ WandExport MagickBooleanType MagickAffineTransformImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); draw_info=PeekDrawingWand(drawing_wand); @@ -603,8 +612,9 @@ WandExport MagickBooleanType MagickAnnotateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); draw_info=PeekDrawingWand(drawing_wand); @@ -655,8 +665,9 @@ WandExport MagickBooleanType MagickAnimateImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) CloneString(&wand->image_info->server_name,server_name); status=AnimateImages(wand->image_info,wand->images,wand->exception); return(status); @@ -702,8 +713,9 @@ WandExport MagickWand *MagickAppendImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); append_image=AppendImages(wand->images,stack,wand->exception); @@ -742,8 +754,9 @@ WandExport MagickBooleanType MagickAutoGammaImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=AutoGammaImage(wand->images,wand->exception); @@ -780,8 +793,9 @@ WandExport MagickBooleanType MagickAutoLevelImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=AutoLevelImage(wand->images,wand->exception); @@ -826,8 +840,9 @@ WandExport MagickBooleanType MagickBlackThresholdImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(thresholds,MaxTextExtent, @@ -872,8 +887,9 @@ WandExport MagickBooleanType MagickBlueShiftImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); shift_image=BlueShiftImage(wand->images,factor,wand->exception); @@ -922,8 +938,9 @@ WandExport MagickBooleanType MagickBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); blur_image=BlurImage(wand->images,radius,sigma,wand->exception); @@ -978,8 +995,9 @@ WandExport MagickBooleanType MagickBorderImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); border_info.width=width; @@ -1032,8 +1050,9 @@ WandExport MagickBooleanType MagickBrightnessContrastImage( assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=BrightnessContrastImage(wand->images,brightness,contrast, @@ -1086,8 +1105,9 @@ WandExport MagickWand *MagickChannelFxImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); fx_image=ChannelFxImage(wand->images,expression,wand->exception); @@ -1132,8 +1152,9 @@ WandExport MagickBooleanType MagickCharcoalImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); charcoal_image=CharcoalImage(wand->images,radius,sigma,wand->exception); @@ -1189,8 +1210,9 @@ WandExport MagickBooleanType MagickChopImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); chop.width=width; @@ -1232,8 +1254,9 @@ WandExport MagickBooleanType MagickClampImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(ClampImage(wand->images,wand->exception)); @@ -1269,8 +1292,9 @@ WandExport MagickBooleanType MagickClipImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ClipImage(wand->images,wand->exception); @@ -1317,8 +1341,9 @@ WandExport MagickBooleanType MagickClipImagePath(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ClipImagePath(wand->images,pathname,inside,wand->exception); @@ -1360,8 +1385,9 @@ WandExport MagickBooleanType MagickClutImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (clut_wand->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ClutImage(wand->images,clut_wand->images,method,wand->exception); @@ -1402,8 +1428,9 @@ WandExport MagickWand *MagickCoalesceImages(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); coalesce_image=CoalesceImages(wand->images,wand->exception); @@ -1463,8 +1490,9 @@ WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ColorDecisionListImage(wand->images,color_correction_collection, @@ -1513,8 +1541,9 @@ WandExport MagickBooleanType MagickColorizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); GetPixelInfo(wand->images,&target); @@ -1581,8 +1610,9 @@ WandExport MagickBooleanType MagickColorMatrixImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (color_matrix == (const KernelInfo *) NULL) return(MagickFalse); if (wand->images == (Image *) NULL) @@ -1626,8 +1656,9 @@ WandExport MagickWand *MagickCombineImages(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); combine_image=CombineImages(wand->images,wand->exception); @@ -1669,8 +1700,9 @@ WandExport MagickBooleanType MagickCommentImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SetImageProperty(wand->images,"comment",comment,wand->exception); @@ -1712,8 +1744,9 @@ WandExport MagickWand *MagickCompareImagesLayers(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); layers_image=CompareImagesLayers(wand->images,method,wand->exception); @@ -1762,8 +1795,9 @@ WandExport MagickWand *MagickCompareImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -1829,8 +1863,9 @@ WandExport MagickBooleanType MagickCompositeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (source_wand->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); @@ -1901,8 +1936,9 @@ WandExport MagickBooleanType MagickCompositeLayers(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (source_wand->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); @@ -1948,8 +1984,9 @@ WandExport MagickBooleanType MagickContrastImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ContrastImage(wand->images,sharpen,wand->exception); @@ -1994,8 +2031,9 @@ WandExport MagickBooleanType MagickContrastStretchImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ContrastStretchImage(wand->images,black_point,white_point, @@ -2036,8 +2074,9 @@ WandExport MagickBooleanType MagickConvolveImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (kernel == (const KernelInfo *) NULL) return(MagickFalse); if (wand->images == (Image *) NULL) @@ -2091,8 +2130,9 @@ WandExport MagickBooleanType MagickCropImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); crop.width=width; @@ -2141,8 +2181,9 @@ WandExport MagickBooleanType MagickCycleColormapImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=CycleColormapImage(wand->images,displace,wand->exception); @@ -2210,8 +2251,9 @@ WandExport MagickBooleanType MagickConstituteImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + images=ConstituteImage(columns,rows,map,storage,pixels,wand->exception); if (images == (Image *) NULL) return(MagickFalse); @@ -2248,8 +2290,9 @@ WandExport MagickBooleanType MagickDecipherImage(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(DecipherImage(wand->images,passphrase,wand->exception)); @@ -2286,8 +2329,9 @@ WandExport MagickWand *MagickDeconstructImages(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); deconstruct_image=CompareImagesLayers(wand->images,CompareAnyLayer, @@ -2333,8 +2377,9 @@ WandExport MagickBooleanType MagickDeskewImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sepia_image=DeskewImage(wand->images,threshold,wand->exception); @@ -2374,8 +2419,9 @@ WandExport MagickBooleanType MagickDespeckleImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); despeckle_image=DespeckleImage(wand->images,wand->exception); @@ -2449,8 +2495,9 @@ WandExport MagickBooleanType MagickDisplayImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); @@ -2495,8 +2542,9 @@ WandExport MagickBooleanType MagickDisplayImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) CloneString(&wand->image_info->server_name,server_name); status=DisplayImages(wand->image_info,wand->images,wand->exception); return(status); @@ -2571,8 +2619,9 @@ WandExport MagickBooleanType MagickDistortImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); distort_image=DistortImage(wand->images,method,number_arguments,arguments, @@ -2622,8 +2671,9 @@ WandExport MagickBooleanType MagickDrawImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); draw_info=PeekDrawingWand(drawing_wand); @@ -2676,8 +2726,9 @@ WandExport MagickBooleanType MagickEdgeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); edge_image=EdgeImage(wand->images,radius,sigma,wand->exception); @@ -2727,8 +2778,9 @@ WandExport MagickBooleanType MagickEmbossImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); emboss_image=EmbossImage(wand->images,radius,sigma,wand->exception); @@ -2768,8 +2820,9 @@ WandExport MagickBooleanType MagickEncipherImage(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(EncipherImage(wand->images,passphrase,wand->exception)); @@ -2805,8 +2858,9 @@ WandExport MagickBooleanType MagickEnhanceImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); enhance_image=EnhanceImage(wand->images,wand->exception); @@ -2847,8 +2901,9 @@ WandExport MagickBooleanType MagickEqualizeImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=EqualizeImage(wand->images,wand->exception); @@ -2896,8 +2951,9 @@ WandExport MagickWand *MagickEvaluateImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); evaluate_image=EvaluateImages(wand->images,op,wand->exception); @@ -2914,8 +2970,9 @@ WandExport MagickBooleanType MagickEvaluateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=EvaluateImage(wand->images,op,value,wand->exception); @@ -2983,8 +3040,9 @@ WandExport MagickBooleanType MagickExportImagePixels(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ExportImagePixels(wand->images,x,y,columns,rows,map, @@ -3036,8 +3094,9 @@ WandExport MagickBooleanType MagickExtentImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); extent.width=width; @@ -3081,8 +3140,9 @@ WandExport MagickBooleanType MagickFlipImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); flip_image=FlipImage(wand->images,wand->exception); @@ -3149,8 +3209,9 @@ WandExport MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL); @@ -3196,8 +3257,9 @@ WandExport MagickBooleanType MagickFlopImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); flop_image=FlopImage(wand->images,wand->exception); @@ -3243,8 +3305,9 @@ WandExport MagickBooleanType MagickForwardFourierTransformImage( assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); forward_image=ForwardFourierTransformImage(wand->images,magnitude, @@ -3308,8 +3371,9 @@ WandExport MagickBooleanType MagickFrameImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) ResetMagickMemory(&frame_info,0,sizeof(frame_info)); @@ -3369,8 +3433,9 @@ WandExport MagickBooleanType MagickFunctionImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=FunctionImage(wand->images,function,number_arguments,arguments, @@ -3409,8 +3474,9 @@ WandExport MagickWand *MagickFxImage(MagickWand *wand,const char *expression) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); fx_image=FxImage(wand->images,expression,wand->exception); @@ -3458,8 +3524,9 @@ WandExport MagickBooleanType MagickGammaImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=GammaImage(wand->images,gamma,wand->exception); @@ -3505,8 +3572,9 @@ WandExport MagickBooleanType MagickGaussianBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); blur_image=GaussianBlurImage(wand->images,radius,sigma,wand->exception); @@ -3545,8 +3613,9 @@ WandExport MagickWand *MagickGetImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -3587,8 +3656,9 @@ WandExport MagickBooleanType MagickGetImageAlphaChannel(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(GetImageAlphaChannel(wand->images)); @@ -3623,8 +3693,9 @@ WandExport MagickWand *MagickGetImageMask(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -3667,8 +3738,9 @@ WandExport MagickBooleanType MagickGetImageBackgroundColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelSetPixelColor(background_color,&wand->images->background_color); @@ -3711,8 +3783,9 @@ WandExport unsigned char *MagickGetImageBlob(MagickWand *wand,size_t *length) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -3760,8 +3833,9 @@ WandExport unsigned char *MagickGetImagesBlob(MagickWand *wand,size_t *length) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -3806,8 +3880,9 @@ WandExport MagickBooleanType MagickGetImageBluePrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *x=wand->images->chromaticity.blue_primary.x; @@ -3845,8 +3920,9 @@ WandExport MagickBooleanType MagickGetImageBorderColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelSetPixelColor(border_color,&wand->images->border_color); @@ -3896,8 +3972,9 @@ WandExport ChannelFeatures *MagickGetImageFeatures(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -3943,8 +4020,9 @@ WandExport MagickBooleanType MagickGetImageKurtosis(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=GetImageKurtosis(wand->images,kurtosis,skewness,wand->exception); @@ -3989,8 +4067,9 @@ WandExport MagickBooleanType MagickGetImageMean(MagickWand *wand,double *mean, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=GetImageMean(wand->images,mean,standard_deviation,wand->exception); @@ -4032,8 +4111,9 @@ WandExport MagickBooleanType MagickGetImageRange(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=GetImageRange(wand->images,minima,maxima,wand->exception); @@ -4074,8 +4154,9 @@ WandExport ChannelStatistics *MagickGetImageStatistics(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4118,8 +4199,9 @@ WandExport MagickBooleanType MagickGetImageColormapColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if ((wand->images->colormap == (PixelInfo *) NULL) || @@ -4159,8 +4241,9 @@ WandExport size_t MagickGetImageColors(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4196,8 +4279,9 @@ WandExport ColorspaceType MagickGetImageColorspace(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4234,8 +4318,9 @@ WandExport CompositeOperator MagickGetImageCompose(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4271,8 +4356,9 @@ WandExport CompressionType MagickGetImageCompression(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4308,8 +4394,9 @@ WandExport size_t MagickGetImageCompressionQuality(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4345,8 +4432,9 @@ WandExport size_t MagickGetImageDelay(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->delay); @@ -4378,8 +4466,9 @@ WandExport size_t MagickGetImageDepth(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->depth); @@ -4411,8 +4500,9 @@ WandExport DisposeType MagickGetImageDispose(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4461,8 +4551,9 @@ WandExport MagickBooleanType MagickGetImageDistortion(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=GetImageDistortion(wand->images,reference->images,metric,distortion, @@ -4508,8 +4599,9 @@ WandExport double *MagickGetImageDistortions(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + assert(reference != (MagickWand *) NULL); assert(reference->signature == WandSignature); if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) @@ -4550,8 +4642,9 @@ WandExport char *MagickGetImageFilename(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4588,8 +4681,9 @@ WandExport char *MagickGetImageFormat(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4625,8 +4719,9 @@ WandExport double MagickGetImageFuzz(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4662,8 +4757,9 @@ WandExport double MagickGetImageGamma(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4699,8 +4795,9 @@ WandExport GravityType MagickGetImageGravity(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4742,8 +4839,9 @@ WandExport MagickBooleanType MagickGetImageGreenPrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *x=wand->images->chromaticity.green_primary.x; @@ -4777,8 +4875,9 @@ WandExport size_t MagickGetImageHeight(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->rows); @@ -4825,8 +4924,9 @@ WandExport PixelWand **MagickGetImageHistogram(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4872,8 +4972,9 @@ WandExport InterlaceType MagickGetImageInterlaceScheme(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4912,8 +5013,9 @@ WandExport PixelInterpolateMethod MagickGetImageInterpolateMethod( { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -4949,8 +5051,9 @@ WandExport size_t MagickGetImageIterations(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->iterations); @@ -4986,8 +5089,9 @@ WandExport MagickBooleanType MagickGetImageLength(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *length=GetBlobSize(wand->images); @@ -5024,8 +5128,9 @@ WandExport MagickBooleanType MagickGetImageMatteColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelSetPixelColor(matte_color,&wand->images->matte_color); @@ -5058,8 +5163,9 @@ WandExport OrientationType MagickGetImageOrientation(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5105,8 +5211,9 @@ WandExport MagickBooleanType MagickGetImagePage(MagickWand *wand, { assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *width=wand->images->page.width; @@ -5154,8 +5261,9 @@ WandExport MagickBooleanType MagickGetImagePixelColor(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); image_view=AcquireCacheView(wand->images); @@ -5202,8 +5310,9 @@ WandExport MagickBooleanType MagickGetImageRedPrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *x=wand->images->chromaticity.red_primary.x; @@ -5256,8 +5365,9 @@ WandExport MagickWand *MagickGetImageRegion(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); region.width=width; @@ -5296,8 +5406,9 @@ WandExport RenderingIntent MagickGetImageRenderingIntent(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5339,8 +5450,9 @@ WandExport MagickBooleanType MagickGetImageResolution(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *x=wand->images->resolution.x; @@ -5374,8 +5486,9 @@ WandExport size_t MagickGetImageScene(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->scene); @@ -5414,8 +5527,9 @@ WandExport char *MagickGetImageSignature(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5423,7 +5537,7 @@ WandExport char *MagickGetImageSignature(MagickWand *wand) return((char *) NULL); } status=SignatureImage(wand->images,wand->exception); - if (status == MagickFalse) + if( IfMagickFalse(status) ) return((char *) NULL); value=GetImageProperty(wand->images,"signature",wand->exception); if (value == (const char *) NULL) @@ -5457,8 +5571,9 @@ WandExport size_t MagickGetImageTicksPerSecond(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return((size_t) wand->images->ticks_per_second); @@ -5498,8 +5613,9 @@ WandExport ImageType MagickGetImageType(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5535,8 +5651,9 @@ WandExport ResolutionType MagickGetImageUnits(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5573,8 +5690,9 @@ WandExport VirtualPixelMethod MagickGetImageVirtualPixelMethod(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5616,8 +5734,9 @@ WandExport MagickBooleanType MagickGetImageWhitePoint(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); *x=wand->images->chromaticity.white_point.x; @@ -5651,8 +5770,9 @@ WandExport size_t MagickGetImageWidth(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(wand->images->columns); @@ -5685,8 +5805,9 @@ WandExport size_t MagickGetNumberImages(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(GetImageListLength(wand->images)); } @@ -5716,8 +5837,9 @@ WandExport double MagickGetImageTotalInkDensity(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5764,8 +5886,9 @@ WandExport MagickBooleanType MagickHaldClutImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (hald_wand->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=HaldClutImage(wand->images,hald_wand->images,wand->exception); @@ -5799,8 +5922,9 @@ WandExport MagickBooleanType MagickHasNextImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if (GetNextImageInList(wand->images) == (Image *) NULL) @@ -5835,8 +5959,9 @@ WandExport MagickBooleanType MagickHasPreviousImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if (GetPreviousImageInList(wand->images) == (Image *) NULL) @@ -5881,8 +6006,9 @@ WandExport char *MagickIdentifyImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -5945,8 +6071,9 @@ WandExport MagickBooleanType MagickImplodeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); implode_image=ImplodeImage(wand->images,amount,method,wand->exception); @@ -6016,8 +6143,9 @@ WandExport MagickBooleanType MagickImportImagePixels(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=ImportImagePixels(wand->images,x,y,columns,rows,map,storage,pixels, @@ -6062,8 +6190,9 @@ WandExport MagickBooleanType MagickInterpolativeResizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); resize_image=InterpolativeResizeImage(wand->images,columns,rows,method, @@ -6117,8 +6246,9 @@ WandExport MagickBooleanType MagickInverseFourierTransformImage( assert(magnitude_wand != (MagickWand *) NULL); assert(magnitude_wand->signature == WandSignature); - if (magnitude_wand->debug != MagickFalse) + if( IfMagickTrue(magnitude_wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s", + magnitude_wand->name); wand=magnitude_wand; if (magnitude_wand->images == (Image *) NULL) @@ -6166,8 +6296,9 @@ WandExport MagickBooleanType MagickLabelImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SetImageProperty(wand->images,"label",label,wand->exception); @@ -6224,8 +6355,9 @@ WandExport MagickBooleanType MagickLevelImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=LevelImage(wand->images,black_point,white_point,gamma, @@ -6271,8 +6403,9 @@ WandExport MagickBooleanType MagickLinearStretchImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=LinearStretchImage(wand->images,black_point,white_point, @@ -6319,8 +6452,9 @@ WandExport MagickBooleanType MagickLiquidRescaleImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); rescale_image=LiquidRescaleImage(wand->images,columns,rows,delta_x, @@ -6361,8 +6495,9 @@ WandExport MagickBooleanType MagickMagnifyImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); magnify_image=MagnifyImage(wand->images,wand->exception); @@ -6423,8 +6558,9 @@ WandExport MagickWand *MagickMergeImageLayers(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); mosaic_image=MergeImageLayers(wand->images,method,wand->exception); @@ -6463,8 +6599,9 @@ WandExport MagickBooleanType MagickMinifyImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); minify_image=MinifyImage(wand->images,wand->exception); @@ -6521,8 +6658,9 @@ WandExport MagickBooleanType MagickModulateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(modulate,MaxTextExtent,"%g,%g,%g", @@ -6589,8 +6727,9 @@ WandExport MagickWand *MagickMontageImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); montage_info=CloneMontageInfo(wand->image_info,(MontageInfo *) NULL); @@ -6679,8 +6818,9 @@ WandExport MagickWand *MagickMorphImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); morph_image=MorphImages(wand->images,number_frames,wand->exception); @@ -6729,8 +6869,9 @@ WandExport MagickBooleanType MagickMorphologyImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (kernel == (const KernelInfo *) NULL) return(MagickFalse); if (wand->images == (Image *) NULL) @@ -6785,8 +6926,9 @@ WandExport MagickBooleanType MagickMotionBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); blur_image=MotionBlurImage(wand->images,radius,sigma,angle,wand->exception); @@ -6834,8 +6976,9 @@ WandExport MagickBooleanType MagickNegateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=NegateImage(wand->images,gray,wand->exception); @@ -6884,8 +7027,9 @@ WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + PixelGetMagickColor(background,&pixel); images=NewMagickImage(wand->image_info,width,height,&pixel,wand->exception); if (images == (Image *) NULL) @@ -6932,12 +7076,13 @@ WandExport MagickBooleanType MagickNextImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->insert_before=MagickFalse; /* Inserts is now appended */ - if (wand->image_pending != MagickFalse) + if( IfMagickTrue(wand->image_pending) ) { wand->image_pending=MagickFalse; return(MagickTrue); @@ -6984,8 +7129,9 @@ WandExport MagickBooleanType MagickNormalizeImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=NormalizeImage(wand->images,wand->exception); @@ -7029,8 +7175,9 @@ WandExport MagickBooleanType MagickOilPaintImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); paint_image=OilPaintImage(wand->images,radius,sigma,wand->exception); @@ -7091,8 +7238,9 @@ WandExport MagickBooleanType MagickOpaquePaintImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetMagickColor(target,&target_pixel); @@ -7135,8 +7283,9 @@ WandExport MagickWand *MagickOptimizeImageLayers(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); optimize_image=OptimizeImageLayers(wand->images,wand->exception); @@ -7198,8 +7347,9 @@ WandExport MagickBooleanType MagickOrderedPosterizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=OrderedPosterizeImage(wand->images,threshold_map,wand->exception); @@ -7244,8 +7394,9 @@ WandExport MagickBooleanType MagickPingImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + ping_info=CloneImageInfo(wand->image_info); if (filename != (const char *) NULL) (void) CopyMagickString(ping_info->filename,filename,MaxTextExtent); @@ -7294,8 +7445,9 @@ WandExport MagickBooleanType MagickPingImageBlob(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + read_info=CloneImageInfo(wand->image_info); SetImageInfoBlob(read_info,blob,length); images=PingImage(read_info,wand->exception); @@ -7341,8 +7493,9 @@ WandExport MagickBooleanType MagickPingImageFile(MagickWand *wand,FILE *file) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); assert(file != (FILE *) NULL); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + read_info=CloneImageInfo(wand->image_info); SetImageInfoFile(read_info,file); images=PingImage(read_info,wand->exception); @@ -7396,8 +7549,9 @@ WandExport MagickBooleanType MagickPolaroidImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); draw_info=PeekDrawingWand(drawing_wand); @@ -7448,8 +7602,9 @@ WandExport MagickBooleanType MagickPosterizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=PosterizeImage(wand->images,levels,dither,wand->exception); @@ -7492,8 +7647,9 @@ WandExport MagickWand *MagickPreviewImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); preview_image=PreviewImage(wand->images,preview,wand->exception); @@ -7542,12 +7698,13 @@ WandExport MagickBooleanType MagickPreviousImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - if (wand->image_pending != MagickFalse) + if( IfMagickTrue(wand->image_pending) ) { wand->image_pending=MagickFalse; /* image returned no longer pending */ return(MagickTrue); @@ -7626,8 +7783,9 @@ WandExport MagickBooleanType MagickQuantizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); @@ -7705,8 +7863,9 @@ WandExport MagickBooleanType MagickQuantizeImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); quantize_info=CloneQuantizeInfo((QuantizeInfo *) NULL); @@ -7753,8 +7912,9 @@ WandExport MagickBooleanType MagickRadialBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); blur_image=RadialBlurImage(wand->images,angle,wand->exception); @@ -7808,8 +7968,9 @@ WandExport MagickBooleanType MagickRaiseImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); raise_info.width=width; @@ -7856,8 +8017,9 @@ WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(threshold,MaxTextExtent,"%gx%g",low,high); @@ -7904,8 +8066,9 @@ WandExport MagickBooleanType MagickReadImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + read_info=CloneImageInfo(wand->image_info); if (filename != (const char *) NULL) (void) CopyMagickString(read_info->filename,filename,MaxTextExtent); @@ -7952,8 +8115,9 @@ WandExport MagickBooleanType MagickReadImageBlob(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + images=BlobToImage(wand->image_info,blob,length,wand->exception); if (images == (Image *) NULL) return(MagickFalse); @@ -7996,8 +8160,9 @@ WandExport MagickBooleanType MagickReadImageFile(MagickWand *wand,FILE *file) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); assert(file != (FILE *) NULL); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + read_info=CloneImageInfo(wand->image_info); SetImageInfoFile(read_info,file); images=ReadImage(read_info,wand->exception); @@ -8047,8 +8212,9 @@ WandExport MagickBooleanType MagickRemapImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (remap_wand->images == (Image *) NULL)) ThrowWandException(WandError,"ContainsNoImages",wand->name); @@ -8090,8 +8256,9 @@ WandExport MagickBooleanType MagickRemoveImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); DeleteImageFromList(&wand->images); @@ -8146,8 +8313,9 @@ WandExport MagickBooleanType MagickResampleImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); resample_image=ResampleImage(wand->images,x_resolution,y_resolution,filter, @@ -8188,8 +8356,9 @@ WandExport MagickBooleanType MagickResetImagePage(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if ((page == (char *) NULL) || (*page == '\0')) @@ -8248,8 +8417,9 @@ WandExport MagickBooleanType MagickResizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); resize_image=ResizeImage(wand->images,columns,rows,filter,wand->exception); @@ -8295,8 +8465,9 @@ WandExport MagickBooleanType MagickRollImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); roll_image=RollImage(wand->images,x,y,wand->exception); @@ -8344,8 +8515,9 @@ WandExport MagickBooleanType MagickRotateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetQuantumPacket(background,&wand->images->background_color); @@ -8394,8 +8566,9 @@ WandExport MagickBooleanType MagickSampleImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sample_image=SampleImage(wand->images,columns,rows,wand->exception); @@ -8441,8 +8614,9 @@ WandExport MagickBooleanType MagickScaleImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); scale_image=ScaleImage(wand->images,columns,rows,wand->exception); @@ -8500,8 +8674,9 @@ MagickExport MagickBooleanType MagickSegmentImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SegmentImage(wand->images,colorspace,verbose,cluster_threshold, @@ -8550,8 +8725,9 @@ WandExport MagickBooleanType MagickSelectiveBlurImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); blur_image=SelectiveBlurImage(wand->images,radius,sigma,threshold, @@ -8597,8 +8773,9 @@ WandExport MagickBooleanType MagickSeparateImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); separate_image=SeparateImage(wand->images,channel,wand->exception); @@ -8644,8 +8821,9 @@ WandExport MagickBooleanType MagickSepiaToneImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sepia_image=SepiaToneImage(wand->images,threshold,wand->exception); @@ -8690,12 +8868,14 @@ WandExport MagickBooleanType MagickSetImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + assert(set_wand != (MagickWand *) NULL); assert(set_wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",set_wand->name); + if (set_wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); images=CloneImageList(set_wand->images,wand->exception); @@ -8737,8 +8917,9 @@ WandExport MagickBooleanType MagickSetImageAlphaChannel(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageAlphaChannel(wand->images,alpha_type,wand->exception)); @@ -8774,8 +8955,9 @@ WandExport MagickBooleanType MagickSetImageBackgroundColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetQuantumPacket(background,&wand->images->background_color); @@ -8814,8 +8996,9 @@ WandExport MagickBooleanType MagickSetImageBluePrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->chromaticity.blue_primary.x=x; @@ -8853,8 +9036,9 @@ WandExport MagickBooleanType MagickSetImageBorderColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetQuantumPacket(border,&wand->images->border_color); @@ -8891,12 +9075,14 @@ WandExport MagickBooleanType MagickSetImageMask(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + assert(clip_mask != (MagickWand *) NULL); assert(clip_mask->signature == WandSignature); - if (clip_mask->debug != MagickFalse) + if( IfMagickTrue(clip_mask->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clip_mask->name); + if (clip_mask->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",clip_mask->name); return(SetImageMask(wand->images,clip_mask->images,wand->exception)); @@ -8935,8 +9121,9 @@ WandExport MagickBooleanType MagickSetImageColor(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + PixelGetMagickColor(color,&pixel); return(SetImageColor(wand->images,&pixel,wand->exception)); } @@ -8974,8 +9161,9 @@ WandExport MagickBooleanType MagickSetImageColormapColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if ((wand->images->colormap == (PixelInfo *) NULL) || @@ -9019,8 +9207,9 @@ WandExport MagickBooleanType MagickSetImageColorspace(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageColorspace(wand->images,colorspace,wand->exception)); @@ -9058,8 +9247,9 @@ WandExport MagickBooleanType MagickSetImageCompose(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->compose=compose; @@ -9096,8 +9286,9 @@ WandExport MagickBooleanType MagickSetImageCompression(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->compression=compression; @@ -9134,8 +9325,9 @@ WandExport MagickBooleanType MagickSetImageCompressionQuality(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->quality=quality; @@ -9172,8 +9364,9 @@ WandExport MagickBooleanType MagickSetImageDelay(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->delay=delay; @@ -9210,8 +9403,9 @@ WandExport MagickBooleanType MagickSetImageDepth(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageDepth(wand->images,depth,wand->exception)); @@ -9247,8 +9441,9 @@ WandExport MagickBooleanType MagickSetImageDispose(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->dispose=dispose; @@ -9287,8 +9482,9 @@ WandExport MagickBooleanType MagickSetImageExtent(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageExtent(wand->images,columns,rows,wand->exception)); @@ -9325,8 +9521,9 @@ WandExport MagickBooleanType MagickSetImageFilename(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if (filename != (const char *) NULL) @@ -9368,8 +9565,9 @@ WandExport MagickBooleanType MagickSetImageFormat(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if ((format == (char *) NULL) || (*format == '\0')) @@ -9415,8 +9613,9 @@ WandExport MagickBooleanType MagickSetImageFuzz(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->fuzz=fuzz; @@ -9453,8 +9652,9 @@ WandExport MagickBooleanType MagickSetImageGamma(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->gamma=gamma; @@ -9492,8 +9692,9 @@ WandExport MagickBooleanType MagickSetImageGravity(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->gravity=gravity; @@ -9534,8 +9735,9 @@ WandExport MagickBooleanType MagickSetImageGreenPrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->chromaticity.green_primary.x=x; @@ -9574,8 +9776,9 @@ WandExport MagickBooleanType MagickSetImageInterlaceScheme(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->interlace=interlace; @@ -9613,8 +9816,9 @@ WandExport MagickBooleanType MagickSetImagePixelInterpolateMethod(MagickWand *wa { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->interpolate=method; @@ -9651,8 +9855,9 @@ WandExport MagickBooleanType MagickSetImageIterations(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->iterations=iterations; @@ -9690,11 +9895,12 @@ WandExport MagickBooleanType MagickSetImageMatte(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); - if ((wand->images->matte == MagickFalse) && (matte != MagickFalse)) + if( IfMagickFalse(wand->images->matte) && IsMagickTrue(matte)) (void) SetImageAlpha(wand->images,OpaqueAlpha,wand->exception); wand->images->matte=matte; return(MagickTrue); @@ -9730,8 +9936,9 @@ WandExport MagickBooleanType MagickSetImageMatteColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetQuantumPacket(matte,&wand->images->matte_color); @@ -9772,8 +9979,9 @@ WandExport MagickBooleanType MagickSetImageAlpha(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SetImageAlpha(wand->images,ClampToQuantum(QuantumRange*alpha), @@ -9811,8 +10019,9 @@ WandExport MagickBooleanType MagickSetImageOrientation(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->orientation=orientation; @@ -9857,8 +10066,9 @@ WandExport MagickBooleanType MagickSetImagePage(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->page.width=width; @@ -9913,8 +10123,9 @@ WandExport MagickProgressMonitor MagickSetImageProgressMonitor(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -9958,8 +10169,9 @@ WandExport MagickBooleanType MagickSetImageRedPrimary(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->chromaticity.red_primary.x=x; @@ -9998,8 +10210,9 @@ WandExport MagickBooleanType MagickSetImageRenderingIntent(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->rendering_intent=rendering_intent; @@ -10038,8 +10251,9 @@ WandExport MagickBooleanType MagickSetImageResolution(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->resolution.x=x_resolution; @@ -10077,8 +10291,9 @@ WandExport MagickBooleanType MagickSetImageScene(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->scene=scene; @@ -10115,8 +10330,9 @@ WandExport MagickBooleanType MagickSetImageTicksPerSecond(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->ticks_per_second=ticks_per_second; @@ -10156,8 +10372,9 @@ WandExport MagickBooleanType MagickSetImageType(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageType(wand->images,image_type,wand->exception)); @@ -10194,8 +10411,9 @@ WandExport MagickBooleanType MagickSetImageUnits(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->units=units; @@ -10234,8 +10452,9 @@ WandExport VirtualPixelMethod MagickSetImageVirtualPixelMethod(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return(UndefinedVirtualPixelMethod); return(SetImageVirtualPixelMethod(wand->images,method,wand->exception)); @@ -10273,8 +10492,9 @@ WandExport MagickBooleanType MagickSetImageWhitePoint(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->chromaticity.white_point.x=x; @@ -10321,8 +10541,9 @@ WandExport MagickBooleanType MagickShadeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); shade_image=ShadeImage(wand->images,gray,asimuth,elevation,wand->exception); @@ -10371,8 +10592,9 @@ WandExport MagickBooleanType MagickShadowImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); shadow_image=ShadowImage(wand->images,alpha,sigma,x,y,wand->exception); @@ -10421,8 +10643,9 @@ WandExport MagickBooleanType MagickSharpenImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sharp_image=SharpenImage(wand->images,radius,sigma,wand->exception); @@ -10473,8 +10696,9 @@ WandExport MagickBooleanType MagickShaveImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); shave_info.width=columns; @@ -10531,8 +10755,9 @@ WandExport MagickBooleanType MagickShearImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetQuantumPacket(background,&wand->images->background_color); @@ -10589,8 +10814,9 @@ WandExport MagickBooleanType MagickSigmoidalContrastImage( assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SigmoidalContrastImage(wand->images,sharpen,alpha,beta, @@ -10642,8 +10868,9 @@ WandExport MagickWand *MagickSimilarityImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (reference->images == (Image *) NULL)) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -10699,8 +10926,9 @@ WandExport MagickBooleanType MagickSketchImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sketch_image=SketchImage(wand->images,radius,sigma,angle,wand->exception); @@ -10748,8 +10976,9 @@ WandExport MagickWand *MagickSmushImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); smush_image=SmushImages(wand->images,stack,offset,wand->exception); @@ -10794,8 +11023,9 @@ WandExport MagickBooleanType MagickSolarizeImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SolarizeImage(wand->images,threshold,wand->exception); @@ -10862,8 +11092,9 @@ WandExport MagickBooleanType MagickSparseColorImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); sparse_image=SparseColorImage(wand->images,method,number_arguments,arguments, @@ -10918,8 +11149,9 @@ WandExport MagickBooleanType MagickSpliceImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); splice.width=width; @@ -10969,8 +11201,9 @@ WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); spread_image=SpreadImage(wand->images,radius,method,wand->exception); @@ -11018,8 +11251,9 @@ WandExport MagickBooleanType MagickStatisticImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); statistic_image=StatisticImage(wand->images,type,width,height, @@ -11068,8 +11302,9 @@ WandExport MagickWand *MagickSteganoImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (watermark_wand->images == (Image *) NULL)) { @@ -11119,8 +11354,9 @@ WandExport MagickWand *MagickStereoImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (offset_wand->images == (Image *) NULL)) { @@ -11160,8 +11396,9 @@ WandExport MagickBooleanType MagickStripImage(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(StripImage(wand->images,wand->exception)); @@ -11204,8 +11441,9 @@ WandExport MagickBooleanType MagickSwirlImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); swirl_image=SwirlImage(wand->images,degrees,method,wand->exception); @@ -11252,8 +11490,9 @@ WandExport MagickWand *MagickTextureImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((wand->images == (Image *) NULL) || (texture_wand->images == (Image *) NULL)) { @@ -11265,7 +11504,7 @@ WandExport MagickWand *MagickTextureImage(MagickWand *wand, if (texture_image == (Image *) NULL) return((MagickWand *) NULL); status=TextureImage(texture_image,texture_wand->images,wand->exception); - if (status == MagickFalse) + if( IfMagickFalse(status) ) { texture_image=DestroyImage(texture_image); return((MagickWand *) NULL); @@ -11322,8 +11561,9 @@ WandExport MagickBooleanType MagickThresholdImageChannel(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=BilevelImage(wand->images,threshold,wand->exception); @@ -11367,8 +11607,9 @@ WandExport MagickBooleanType MagickThumbnailImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); thumbnail_image=ThumbnailImage(wand->images,columns,rows,wand->exception); @@ -11422,8 +11663,9 @@ WandExport MagickBooleanType MagickTintImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if (wand->images->colorspace != CMYKColorspace) @@ -11492,15 +11734,17 @@ WandExport MagickWand *MagickTransformImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + + if (wand->images == (Image *) NULL) return((MagickWand *) NULL); transform_image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); if (transform_image == (Image *) NULL) return((MagickWand *) NULL); status=TransformImage(&transform_image,crop,geometry,wand->exception); - if (status == MagickFalse) + if( IfMagickFalse(status) ) { transform_image=DestroyImage(transform_image); return((MagickWand *) NULL); @@ -11542,8 +11786,10 @@ WandExport MagickBooleanType MagickTransformImageColorspace(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(TransformImageColorspace(wand->images,colorspace,wand->exception)); @@ -11601,8 +11847,10 @@ WandExport MagickBooleanType MagickTransparentPaintImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); PixelGetMagickColor(target,&target_pixel); @@ -11642,8 +11890,9 @@ WandExport MagickBooleanType MagickTransposeImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); transpose_image=TransposeImage(wand->images,wand->exception); @@ -11683,8 +11932,9 @@ WandExport MagickBooleanType MagickTransverseImage(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); transverse_image=TransverseImage(wand->images,wand->exception); @@ -11730,8 +11980,9 @@ WandExport MagickBooleanType MagickTrimImage(MagickWand *wand,const double fuzz) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wand->images->fuzz=fuzz; @@ -11771,8 +12022,9 @@ WandExport MagickBooleanType MagickUniqueImageColors(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); unique_image=UniqueImageColors(wand->images,wand->exception); @@ -11828,8 +12080,9 @@ WandExport MagickBooleanType MagickUnsharpMaskImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); unsharp_image=UnsharpMaskImage(wand->images,radius,sigma,amount,threshold, @@ -11878,8 +12131,9 @@ WandExport MagickBooleanType MagickVignetteImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); vignette_image=VignetteImage(wand->images,radius,sigma,x,y,wand->exception); @@ -11929,8 +12183,9 @@ WandExport MagickBooleanType MagickWaveImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); wave_image=WaveImage(wand->images,amplitude,wave_length,method, @@ -11976,8 +12231,9 @@ WandExport MagickBooleanType MagickWhiteThresholdImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); (void) FormatLocaleString(thresholds,MaxTextExtent, @@ -12029,8 +12285,9 @@ WandExport MagickBooleanType MagickWriteImage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); if (filename != (const char *) NULL) @@ -12084,8 +12341,9 @@ WandExport MagickBooleanType MagickWriteImageFile(MagickWand *wand,FILE *file) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); assert(file != (FILE *) NULL); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); image=CloneImage(wand->images,0,0,MagickTrue,wand->exception); @@ -12138,8 +12396,9 @@ WandExport MagickBooleanType MagickWriteImages(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); write_info=CloneImageInfo(wand->image_info); @@ -12183,8 +12442,9 @@ WandExport MagickBooleanType MagickWriteImagesFile(MagickWand *wand,FILE *file) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); write_info=CloneImageInfo(wand->image_info); diff --git a/MagickWand/magick-property.c b/MagickWand/magick-property.c index 5882fb670..baf507696 100644 --- a/MagickWand/magick-property.c +++ b/MagickWand/magick-property.c @@ -92,8 +92,9 @@ WandExport MagickBooleanType MagickDeleteImageArtifact(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -133,8 +134,9 @@ WandExport MagickBooleanType MagickDeleteImageProperty(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -174,8 +176,9 @@ WandExport MagickBooleanType MagickDeleteOption(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(DeleteImageOption(wand->image_info,option)); } @@ -206,8 +209,9 @@ WandExport MagickBooleanType MagickGetAntialias(const MagickWand *wand) { assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->antialias); } @@ -240,8 +244,9 @@ WandExport PixelWand *MagickGetBackgroundColor(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + background_color=NewPixelWand(); PixelSetPixelColor(background_color,&wand->image_info->background_color); return(background_color); @@ -273,8 +278,9 @@ WandExport ColorspaceType MagickGetColorspace(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->colorspace); } @@ -304,8 +310,9 @@ WandExport CompressionType MagickGetCompression(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->compression); } @@ -335,8 +342,9 @@ WandExport size_t MagickGetCompressionQuality(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->quality); } @@ -390,8 +398,9 @@ WandExport char *MagickGetFilename(const MagickWand *wand) { assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(AcquireString(wand->image_info->filename)); } @@ -421,8 +430,9 @@ WandExport char *MagickGetFont(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->image_info->font == (char *) NULL) return((char *) NULL); return(AcquireString(wand->image_info->font)); @@ -454,8 +464,9 @@ WandExport char *MagickGetFormat(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(AcquireString(wand->image_info->magick)); } @@ -491,8 +502,9 @@ WandExport GravityType MagickGetGravity(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + option=GetImageOption(wand->image_info,"gravity"); if (option == (const char *) NULL) return(UndefinedGravity); @@ -556,8 +568,9 @@ WandExport char *MagickGetImageArtifact(MagickWand *wand,const char *artifact) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -617,8 +630,9 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -635,7 +649,7 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand, for (i=0; artifact != (const char *) NULL; ) { if ((*artifact != '[') && - (GlobExpression(artifact,pattern,MagickFalse) != MagickFalse)) + (IfMagickTrue(GlobExpression(artifact,pattern,MagickFalse)))) { if ((i+1) >= (ssize_t) length) { @@ -698,8 +712,9 @@ WandExport unsigned char *MagickGetImageProfile(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -769,8 +784,9 @@ WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -787,7 +803,7 @@ WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern, for (i=0; property != (const char *) NULL; ) { if ((*property != '[') && - (GlobExpression(property,pattern,MagickFalse) != MagickFalse)) + (IfMagickTrue(GlobExpression(property,pattern,MagickFalse)))) { if ((i+1) >= (ssize_t) length) { @@ -845,8 +861,9 @@ WandExport char *MagickGetImageProperty(MagickWand *wand,const char *property) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -906,8 +923,9 @@ WandExport char **MagickGetImageProperties(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -924,7 +942,7 @@ WandExport char **MagickGetImageProperties(MagickWand *wand, for (i=0; property != (const char *) NULL; ) { if ((*property != '[') && - (GlobExpression(property,pattern,MagickFalse) != MagickFalse)) + (IfMagickTrue(GlobExpression(property,pattern,MagickFalse)))) { if ((i+1) >= (ssize_t) length) { @@ -975,8 +993,9 @@ WandExport InterlaceType MagickGetInterlaceScheme(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->interlace); } @@ -1012,8 +1031,9 @@ WandExport PixelInterpolateMethod MagickGetInterpolateMethod(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + option=GetImageOption(wand->image_info,"interpolate"); if (option == (const char *) NULL) return(UndefinedInterpolatePixel); @@ -1055,8 +1075,9 @@ WandExport char *MagickGetOption(MagickWand *wand,const char *key) assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + option=GetImageOption(wand->image_info,key); return(ConstantString(option)); } @@ -1107,8 +1128,9 @@ WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -1124,7 +1146,7 @@ WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern, for (i=0; option != (const char *) NULL; ) { if ((*option != '[') && - (GlobExpression(option,pattern,MagickFalse) != MagickFalse)) + (IfMagickTrue(GlobExpression(option,pattern,MagickFalse)))) { if ((i+1) >= (ssize_t) length) { @@ -1175,8 +1197,9 @@ WandExport OrientationType MagickGetOrientation(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->orientation); } @@ -1244,8 +1267,9 @@ WandExport MagickBooleanType MagickGetPage(const MagickWand *wand, assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) ResetMagickMemory(&geometry,0,sizeof(geometry)); (void) ParseAbsoluteGeometry(wand->image_info->page,&geometry); *width=geometry.width; @@ -1282,8 +1306,9 @@ WandExport double MagickGetPointsize(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->pointsize); } @@ -1399,8 +1424,9 @@ WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + *x=72.0; *y=72.0; if (wand->image_info->density != (char *) NULL) @@ -1414,7 +1440,7 @@ WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand, flags=ParseGeometry(wand->image_info->density,&geometry_info); *x=geometry_info.rho; *y=geometry_info.sigma; - if ((flags & SigmaValue) == MagickFalse) + if ((flags & SigmaValue) == 0) *y=(*x); } return(MagickTrue); @@ -1513,8 +1539,9 @@ WandExport double *MagickGetSamplingFactors(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + *number_factors=0; sampling_factors=(double *) NULL; if (wand->image_info->sampling_factor == (char *) NULL) @@ -1580,8 +1607,9 @@ WandExport MagickBooleanType MagickGetSize(const MagickWand *wand, assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) ResetMagickMemory(&geometry,0,sizeof(geometry)); (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry); *columns=geometry.width; @@ -1623,8 +1651,9 @@ WandExport MagickBooleanType MagickGetSizeOffset(const MagickWand *wand, assert(wand != (const MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) ResetMagickMemory(&geometry,0,sizeof(geometry)); (void) ParseAbsoluteGeometry(wand->image_info->size,&geometry); *offset=geometry.x; @@ -1657,8 +1686,9 @@ WandExport ImageType MagickGetType(MagickWand *wand) { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(wand->image_info->type); } @@ -1727,8 +1757,9 @@ WandExport MagickBooleanType MagickProfileImage(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(ProfileImage(wand->images,name,profile,length,wand->exception)); @@ -1772,8 +1803,9 @@ WandExport unsigned char *MagickRemoveImageProfile(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) { (void) ThrowMagickException(wand->exception,GetMagickModule(),WandError, @@ -1825,8 +1857,9 @@ WandExport MagickBooleanType MagickSetAntialias(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->antialias=antialias; return(MagickTrue); } @@ -1861,8 +1894,9 @@ WandExport MagickBooleanType MagickSetBackgroundColor(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + PixelGetQuantumPacket(background,&wand->image_info->background_color); return(MagickTrue); } @@ -1897,8 +1931,9 @@ WandExport MagickBooleanType MagickSetColorspace(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->colorspace=colorspace; return(MagickTrue); } @@ -1933,8 +1968,9 @@ WandExport MagickBooleanType MagickSetCompression(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->compression=compression; return(MagickTrue); } @@ -1969,8 +2005,9 @@ WandExport MagickBooleanType MagickSetCompressionQuality(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->quality=quality; return(MagickTrue); } @@ -2005,8 +2042,9 @@ WandExport MagickBooleanType MagickSetDepth(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->depth=depth; return(MagickTrue); } @@ -2043,8 +2081,9 @@ WandExport MagickBooleanType MagickSetExtract(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (geometry != (const char *) NULL) (void) CopyMagickString(wand->image_info->extract,geometry,MaxTextExtent); return(MagickTrue); @@ -2080,8 +2119,9 @@ WandExport MagickBooleanType MagickSetFilename(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (filename != (const char *) NULL) (void) CopyMagickString(wand->image_info->filename,filename,MaxTextExtent); return(MagickTrue); @@ -2117,8 +2157,9 @@ WandExport MagickBooleanType MagickSetFont(MagickWand *wand,const char *font) return(MagickFalse); assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) CloneString(&wand->image_info->font,font); return(MagickTrue); } @@ -2155,8 +2196,9 @@ WandExport MagickBooleanType MagickSetFormat(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if ((format == (char *) NULL) || (*format == '\0')) { *wand->image_info->magick='\0'; @@ -2203,8 +2245,9 @@ WandExport MagickBooleanType MagickSetGravity(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + status=SetImageOption(wand->image_info,"gravity",CommandOptionToMnemonic( MagickGravityOptions,(ssize_t) type)); return(status); @@ -2242,8 +2285,9 @@ WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); return(SetImageArtifact(wand->images,artifact,value)); @@ -2292,8 +2336,9 @@ WandExport MagickBooleanType MagickSetImageProfile(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); profile_info=AcquireStringInfo((size_t) length); @@ -2338,8 +2383,9 @@ WandExport MagickBooleanType MagickSetImageProperty(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->images == (Image *) NULL) ThrowWandException(WandError,"ContainsNoImages",wand->name); status=SetImageProperty(wand->images,property,value,wand->exception); @@ -2377,8 +2423,9 @@ WandExport MagickBooleanType MagickSetInterlaceScheme(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->interlace=interlace_scheme; return(MagickTrue); } @@ -2416,8 +2463,9 @@ WandExport MagickBooleanType MagickSetInterpolateMethod(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + status=SetImageOption(wand->image_info,"interpolate", CommandOptionToMnemonic(MagickInterpolateOptions,(ssize_t) method)); return(status); @@ -2456,8 +2504,9 @@ WandExport MagickBooleanType MagickSetOption(MagickWand *wand,const char *key, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + return(SetImageOption(wand->image_info,key,value)); } @@ -2491,8 +2540,9 @@ WandExport MagickBooleanType MagickSetOrientation(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->orientation=orientation; return(MagickTrue); } @@ -2538,8 +2588,9 @@ WandExport MagickBooleanType MagickSetPage(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g%+.20g", (double) width,(double) height,(double) x,(double) y); (void) CloneString(&wand->image_info->page,geometry); @@ -2576,8 +2627,9 @@ WandExport MagickBooleanType MagickSetPassphrase(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) SetImageOption(wand->image_info,"authenticate",passphrase); return(MagickTrue); } @@ -2612,8 +2664,9 @@ WandExport MagickBooleanType MagickSetPointsize(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->pointsize=pointsize; return(MagickTrue); } @@ -2663,8 +2716,9 @@ WandExport MagickProgressMonitor MagickSetProgressMonitor(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + previous_monitor=SetImageInfoProgressMonitor(wand->image_info, progress_monitor,client_data); return(previous_monitor); @@ -2738,8 +2792,9 @@ WandExport MagickBooleanType MagickSetResolution(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) FormatLocaleString(density,MaxTextExtent,"%gx%g",x_resolution, y_resolution); (void) CloneString(&wand->image_info->density,density); @@ -2785,8 +2840,9 @@ WandExport MagickBooleanType MagickSetSamplingFactors(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + if (wand->image_info->sampling_factor != (char *) NULL) wand->image_info->sampling_factor=(char *) RelinquishMagickMemory(wand->image_info->sampling_factor); @@ -2841,8 +2897,9 @@ WandExport MagickBooleanType MagickSetSize(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g",(double) columns,(double) rows); (void) CloneString(&wand->image_info->size,geometry); @@ -2888,8 +2945,9 @@ WandExport MagickBooleanType MagickSetSizeOffset(MagickWand *wand, assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g%+.20g", (double) columns,(double) rows,(double) offset); (void) CloneString(&wand->image_info->size,geometry); @@ -2929,8 +2987,9 @@ WandExport MagickBooleanType MagickSetType(MagickWand *wand, { assert(wand != (MagickWand *) NULL); assert(wand->signature == WandSignature); - if (wand->debug != MagickFalse) + if( IfMagickTrue(wand->debug) ) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); + wand->image_info->type=image_type; return(MagickTrue); } diff --git a/MagickWand/wand.c b/MagickWand/wand.c index 6b453bced..c32d41369 100644 --- a/MagickWand/wand.c +++ b/MagickWand/wand.c @@ -79,7 +79,7 @@ WandExport size_t AcquireWandId(void) if (wand_semaphore == (SemaphoreInfo *) NULL) AcquireSemaphoreInfo(&wand_semaphore); LockSemaphoreInfo(wand_semaphore); - if ((wand_ids == (SplayTreeInfo *) NULL) && (instantiate_wand == MagickFalse)) + if ((wand_ids == (SplayTreeInfo *) NULL) && IsMagickFalse(instantiate_wand)) { wand_ids=NewSplayTree((int (*)(const void *,const void *)) NULL, (void *(*)(void *)) NULL,(void *(*)(void *)) NULL);