]> granicus.if.org Git - imagemagick/blobdiff - MagickWand/magick-property.c
(no commit message)
[imagemagick] / MagickWand / magick-property.c
index e24b5e26cc184154cbadc906948c97c47561adc4..9fcab4efa2c8eba769347dc75e5b7176b136eab7 100644 (file)
@@ -23,7 +23,7 @@
 %                                 August 2003                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -58,7 +58,7 @@
 #define ThrowWandException(severity,tag,context) \
 { \
   (void) ThrowMagickException(wand->exception,GetMagickModule(),severity, \
-    tag,"`%s'",context); \
+    tag,"'%s'",context); \
   return(MagickFalse); \
 }
 \f
@@ -92,12 +92,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return(MagickFalse);
     }
   return(DeleteImageArtifact(wand->images,artifact));
@@ -133,12 +134,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return(MagickFalse);
     }
   return(DeleteImageProperty(wand->images,property));
@@ -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));
 }
 \f
@@ -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);
 }
 \f
@@ -240,10 +244,11 @@ 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();
-  PixelSetQuantumPacket(background_color,&wand->image_info->background_color);
+  PixelSetPixelColor(background_color,&wand->image_info->background_color);
   return(background_color);
 }
 \f
@@ -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);
 }
 \f
@@ -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);
 }
 \f
@@ -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);
 }
 \f
@@ -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));
 }
 \f
@@ -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));
 }
 \f
@@ -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,12 +568,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char *) NULL);
     }
   value=GetImageArtifact(wand->images,artifact);
@@ -617,15 +630,16 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char **) NULL);
     }
-  (void) GetImageProperty(wand->images,"exif:*");
+  (void) GetImageProperty(wand->images,"exif:*",wand->exception);
   length=1024;
   artifacts=(char **) AcquireQuantumMemory(length,sizeof(*artifacts));
   if (artifacts == (char **) NULL)
@@ -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)
           {
@@ -645,7 +659,7 @@ WandExport char **MagickGetImageArtifacts(MagickWand *wand,
             if (artifacts == (char **) NULL)
               {
                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
-                  ResourceLimitError,"MemoryAllocationFailed","`%s'",
+                  ResourceLimitError,"MemoryAllocationFailed","'%s'",
                   wand->name);
                 return((char **) NULL);
               }
@@ -698,12 +712,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((unsigned char *) NULL);
     }
   *length=0;
@@ -740,7 +755,7 @@ WandExport unsigned char *MagickGetImageProfile(MagickWand *wand,
 %
 %  The format of the MagickGetImageProfiles method is:
 %
-%      char *MagickGetImageProfiles(MagickWand *wand,
+%      char *MagickGetImageProfiles(MagickWand *wand,const char *pattern,
 %        size_t *number_profiles)
 %
 %  A description of each parameter follows:
@@ -769,12 +784,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char **) NULL);
     }
   (void) GetImageProfile(wand->images,"exif:*");
@@ -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)
           {
@@ -797,7 +813,7 @@ WandExport char **MagickGetImageProfiles(MagickWand *wand,const char *pattern,
             if (profiles == (char **) NULL)
               {
                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
-                  ResourceLimitError,"MemoryAllocationFailed","`%s'",
+                  ResourceLimitError,"MemoryAllocationFailed","'%s'",
                   wand->name);
                 return((char **) NULL);
               }
@@ -845,15 +861,16 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char *) NULL);
     }
-  value=GetImageProperty(wand->images,property);
+  value=GetImageProperty(wand->images,property,wand->exception);
   if (value == (const char *) NULL)
     return((char *) NULL);
   return(ConstantString(value));
@@ -906,15 +923,16 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char **) NULL);
     }
-  (void) GetImageProperty(wand->images,"exif:*");
+  (void) GetImageProperty(wand->images,"exif:*",wand->exception);
   length=1024;
   properties=(char **) AcquireQuantumMemory(length,sizeof(*properties));
   if (properties == (char **) NULL)
@@ -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)
           {
@@ -934,7 +952,7 @@ WandExport char **MagickGetImageProperties(MagickWand *wand,
             if (properties == (char **) NULL)
               {
                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
-                  ResourceLimitError,"MemoryAllocationFailed","`%s'",
+                  ResourceLimitError,"MemoryAllocationFailed","'%s'",
                   wand->name);
                 return((char **) NULL);
               }
@@ -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);
 }
 \f
@@ -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));
 }
@@ -1066,7 +1087,7 @@ WandExport char *MagickGetOption(MagickWand *wand,const char *key)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   M a g i c k G e t O p t i o n                                             %
+%   M a g i c k G e t O p t i o n s                                           %
 %                                                                             %
 %                                                                             %
 %                                                                             %
@@ -1079,7 +1100,8 @@ WandExport char *MagickGetOption(MagickWand *wand,const char *key)
 %
 %  The format of the MagickGetOptions method is:
 %
-%      char *MagickGetOptions(MagickWand *wand,size_t *number_options)
+%      char *MagickGetOptions(MagickWand *wand,const char *pattern,
+%        size_t *number_options)
 %
 %  A description of each parameter follows:
 %
@@ -1107,12 +1129,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((char **) NULL);
     }
   length=1024;
@@ -1124,7 +1147,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)
           {
@@ -1134,7 +1157,7 @@ WandExport char **MagickGetOptions(MagickWand *wand,const char *pattern,
             if (options == (char **) NULL)
               {
                 (void) ThrowMagickException(wand->exception,GetMagickModule(),
-                  ResourceLimitError,"MemoryAllocationFailed","`%s'",
+                  ResourceLimitError,"MemoryAllocationFailed","'%s'",
                   wand->name);
                 return((char **) NULL);
               }
@@ -1175,8 +1198,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);
 }
 \f
@@ -1244,8 +1268,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 +1307,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);
 }
 \f
@@ -1399,8 +1425,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 +1441,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 +1540,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)
@@ -1538,7 +1566,7 @@ WandExport double *MagickGetSamplingFactors(MagickWand *wand,
     while (((int) *p != 0) && ((isspace((int) ((unsigned char) *p)) != 0) ||
            (*p == ',')))
       p++;
-    sampling_factors[i]=InterpretLocaleValue(p,(char **) NULL);
+    sampling_factors[i]=StringToDouble(p,(char **) NULL);
     i++;
   }
   *number_factors=(size_t) i;
@@ -1580,8 +1608,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 +1652,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 +1687,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);
 }
 \f
@@ -1725,19 +1756,14 @@ WandExport const char *MagickGetVersion(size_t *version)
 WandExport MagickBooleanType MagickProfileImage(MagickWand *wand,
   const char *name,const void *profile,const size_t length)
 {
-  MagickBooleanType
-    status;
-
   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=ProfileImage(wand->images,name,profile,length,MagickTrue);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
-  return(status);
+  return(ProfileImage(wand->images,name,profile,length,wand->exception));
 }
 \f
 /*
@@ -1778,12 +1804,13 @@ 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,
-        "ContainsNoImages","`%s'",wand->name);
+        "ContainsNoImages","'%s'",wand->name);
       return((unsigned char *) NULL);
     }
   *length=0;
@@ -1831,8 +1858,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);
 }
@@ -1867,8 +1895,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);
 }
@@ -1903,8 +1932,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);
 }
@@ -1939,8 +1969,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);
 }
@@ -1975,8 +2006,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);
 }
@@ -2011,8 +2043,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);
 }
@@ -2049,8 +2082,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);
@@ -2086,8 +2120,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);
@@ -2123,8 +2158,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);
 }
@@ -2161,8 +2197,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';
@@ -2209,8 +2246,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);
@@ -2246,19 +2284,14 @@ WandExport MagickBooleanType MagickSetGravity(MagickWand *wand,
 WandExport MagickBooleanType MagickSetImageArtifact(MagickWand *wand,
   const char *artifact,const char *value)
 {
-  MagickBooleanType
-    status;
-
   assert(wand != (MagickWand *) NULL);
   assert(wand->signature == WandSignature);
-  if (wand->debug != MagickFalse)
+  if( IfMagickTrue(wand->debug) )
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  status=SetImageArtifact(wand->images,artifact,value);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
-  return(status);
+  return(SetImageArtifact(wand->images,artifact,value));
 }
 \f
 /*
@@ -2304,16 +2337,15 @@ 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);
   SetStringInfoDatum(profile_info,(unsigned char *) profile);
-  status=SetImageProfile(wand->images,name,profile_info);
+  status=SetImageProfile(wand->images,name,profile_info,wand->exception);
   profile_info=DestroyStringInfo(profile_info);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
   return(status);
 }
 \f
@@ -2352,13 +2384,12 @@ 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);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
+  status=SetImageProperty(wand->images,property,value,wand->exception);
   return(status);
 }
 \f
@@ -2393,8 +2424,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);
 }
@@ -2432,8 +2464,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);
@@ -2472,8 +2505,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));
 }
 \f
@@ -2507,8 +2541,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);
 }
@@ -2554,8 +2589,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);
@@ -2592,8 +2628,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);
 }
@@ -2628,8 +2665,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);
 }
@@ -2679,8 +2717,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);
@@ -2735,7 +2774,7 @@ WandExport MagickBooleanType MagickSetResourceLimit(const ResourceType type,
 %  The format of the MagickSetResolution method is:
 %
 %      MagickBooleanType MagickSetResolution(MagickWand *wand,
-%        const double x_resolution,const doubtl y_resolution)
+%        const double x_resolution,const double y_resolution)
 %
 %  A description of each parameter follows:
 %
@@ -2754,8 +2793,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);
@@ -2801,8 +2841,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);
@@ -2857,8 +2898,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);
@@ -2904,8 +2946,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);
@@ -2945,8 +2988,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);
 }