]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/display.c
Update web pages
[imagemagick] / MagickCore / display.c
index 4a75b70b0d1bee43bfae40ae327871a2b9ff5f35..7f3bf7aef64c260471f47bab47f58292f3dc1355 100644 (file)
 %        MagickCore Methods to Interactively Display and Edit an Image        %
 %                                                                             %
 %                             Software Design                                 %
-%                               John Cristy                                   %
+%                                  Cristy                                     %
 %                                July 1992                                    %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2015 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  %
 */
 #include "MagickCore/studio.h"
 #include "MagickCore/artifact.h"
+#include "MagickCore/attribute.h"
 #include "MagickCore/blob.h"
 #include "MagickCore/cache.h"
 #include "MagickCore/cache-private.h"
+#include "MagickCore/channel.h"
 #include "MagickCore/client.h"
 #include "MagickCore/color.h"
 #include "MagickCore/colorspace.h"
@@ -70,6 +72,7 @@
 #include "MagickCore/monitor.h"
 #include "MagickCore/monitor-private.h"
 #include "MagickCore/montage.h"
+#include "MagickCore/nt-base-private.h"
 #include "MagickCore/option.h"
 #include "MagickCore/paint.h"
 #include "MagickCore/pixel.h"
@@ -1671,10 +1674,10 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
     resource_info;
 
   assert(image_info != (const ImageInfo *) NULL);
-  assert(image_info->signature == MagickSignature);
+  assert(image_info->signature == MagickCoreSignature);
   assert(images != (Image *) NULL);
-  assert(images->signature == MagickSignature);
-  if (images->debug != MagickFalse)
+  assert(images->signature == MagickCoreSignature);
+  if (IfMagickTrue(images->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
   display=XOpenDisplay(image_info->server_name);
   if (display == (Display *) NULL)
@@ -1751,7 +1754,7 @@ MagickExport MagickBooleanType RemoteDisplayCommand(const ImageInfo *image_info,
     status;
 
   assert(image_info != (const ImageInfo *) NULL);
-  assert(image_info->signature == MagickSignature);
+  assert(image_info->signature == MagickCoreSignature);
   assert(filename != (char *) NULL);
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
   display=XOpenDisplay(image_info->server_name);
@@ -1799,20 +1802,6 @@ MagickExport MagickBooleanType RemoteDisplayCommand(const ImageInfo *image_info,
 %
 */
 
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
-{
-  if (x > y)
-    return(x);
-  return(y);
-}
-
-static inline ssize_t MagickMin(const ssize_t x,const ssize_t y)
-{
-  if (x < y)
-    return(x);
-  return(y);
-}
-
 static MagickBooleanType XAnnotateEditImage(Display *display,
   XResourceInfo *resource_info,XWindows *windows,Image *image,
   ExceptionInfo *exception)
@@ -1855,7 +1844,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
     transparent_box = MagickTrue,
     transparent_pen = MagickFalse;
 
-  static MagickRealType
+  static double
     degrees = 0.0;
 
   static unsigned int
@@ -1864,8 +1853,8 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
     pen_id = 0;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   const char
     *ColorMenu[MaxNumberPens+1];
@@ -1933,12 +1922,12 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
           x+windows->image.x,y+windows->image.y);
         XInfoWidget(display,windows,text);
       }
@@ -1982,7 +1971,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
             if (font_number == (MaxNumberFonts-2))
               {
                 static char
-                  font_name[MaxTextExtent] = "fixed";
+                  font_name[MagickPathExtent] = "fixed";
 
                 /*
                   Select a font name from a browser.
@@ -2026,12 +2015,12 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               break;
             transparent_pen=pen_number == (MaxNumberPens-2) ? MagickTrue :
               MagickFalse;
-            if (transparent_pen != MagickFalse)
+            if (IfMagickTrue(transparent_pen) )
               break;
             if (pen_number == (MaxNumberPens-1))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -2071,12 +2060,12 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               break;
             transparent_box=pen_number == (MaxNumberPens-2) ? MagickTrue :
               MagickFalse;
-            if (transparent_box != MagickFalse)
+            if (IfMagickTrue(transparent_box) )
               break;
             if (pen_number == (MaxNumberPens-1))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -2103,7 +2092,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               entry;
 
             static char
-              angle[MaxTextExtent] = "30.0";
+              angle[MagickPathExtent] = "30.0";
 
             static const char
               *RotateMenu[] =
@@ -2222,7 +2211,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -2270,10 +2259,10 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
   XGetAnnotateInfo(annotate_info);
   annotate_info->x=x;
   annotate_info->y=y;
-  if ((transparent_box == MagickFalse) && (transparent_pen == MagickFalse))
+  if (IfMagickFalse(transparent_box) && IfMagickFalse(transparent_pen))
     annotate_info->stencil=OpaqueStencil;
   else
-    if (transparent_box == MagickFalse)
+    if (IfMagickFalse(transparent_box) )
       annotate_info->stencil=BackgroundStencil;
     else
       annotate_info->stencil=ForegroundStencil;
@@ -2602,7 +2591,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
         if (event.xselection.property == (Atom) None)
           break;
         status=XGetWindowProperty(display,event.xselection.requestor,
-          event.xselection.property,0L,(long) MaxTextExtent,True,XA_STRING,
+          event.xselection.property,0L,(long) MagickPathExtent,True,XA_STRING,
           &type,&format,&length,&after,&data);
         if ((status != Success) || (type != XA_STRING) || (format == 32) ||
             (length == 0))
@@ -2726,7 +2715,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
       width*(annotate_info->x+windows->image.x)/windows->image.ximage->width;
     annotate_info->y=(int) height*(annotate_info->y-font_info->ascent+
       windows->image.y)/windows->image.ximage->height;
-    (void) FormatLocaleString(annotate_info->geometry,MaxTextExtent,
+    (void) FormatLocaleString(annotate_info->geometry,MagickPathExtent,
       "%ux%u%+d%+d",width*annotate_info->width/windows->image.ximage->width,
       height*annotate_info->height/windows->image.ximage->height,
       annotate_info->x+x,annotate_info->y+y);
@@ -2803,7 +2792,7 @@ static MagickBooleanType XBackgroundImage(Display *display,
     status;
 
   static char
-    window_id[MaxTextExtent] = "root";
+    window_id[MagickPathExtent] = "root";
 
   XResourceInfo
     background_resources;
@@ -2825,7 +2814,7 @@ static MagickBooleanType XBackgroundImage(Display *display,
   background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
   status=XDisplayBackgroundImage(display,&background_resources,*image,
     exception);
-  if (status != MagickFalse)
+  if (IfMagickTrue(status))
     XClientMessage(display,windows->image.id,windows->im_protocols,
       windows->im_retain_colors,CurrentTime);
   XSetCursorState(display,windows,MagickFalse);
@@ -2896,7 +2885,7 @@ static MagickBooleanType XChopImage(Display *display,
     };
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Image
     *chop_image;
@@ -2906,7 +2895,7 @@ static MagickBooleanType XChopImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     scale_factor;
 
   RectangleInfo
@@ -2942,14 +2931,15 @@ static MagickBooleanType XChopImage(Display *display,
   (void) XSelectInput(display,windows->image.id,
     windows->image.attributes.event_mask | PointerMotionMask);
   state=DefaultState;
+  (void) ResetMagickMemory(&segment_info,0,sizeof(segment_info));
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
           x+windows->image.x,y+windows->image.y);
         XInfoWidget(display,windows,text);
       }
@@ -2970,7 +2960,7 @@ static MagickBooleanType XChopImage(Display *display,
           case ChopDirectionCommand:
           {
             char
-              command[MaxTextExtent];
+              command[MagickPathExtent];
 
             static const char
               *Directions[] =
@@ -3033,7 +3023,7 @@ static MagickBooleanType XChopImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -3083,7 +3073,7 @@ static MagickBooleanType XChopImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -3119,9 +3109,9 @@ static MagickBooleanType XChopImage(Display *display,
         /*
           Display info and draw chopping line.
         */
-        if (windows->info.mapped == MagickFalse)
+        if (IfMagickFalse(windows->info.mapped) )
           (void) XMapWindow(display,windows->info.id);
-        (void) FormatLocaleString(text,MaxTextExtent,
+        (void) FormatLocaleString(text,MagickPathExtent,
           " %.20gx%.20g%+.20g%+.20g",(double) chop_info.width,(double)
           chop_info.height,(double) chop_info.x,(double) chop_info.y);
         XInfoWidget(display,windows,text);
@@ -3129,7 +3119,7 @@ static MagickBooleanType XChopImage(Display *display,
           windows->image.highlight_context,&segment_info);
       }
     else
-      if (windows->info.mapped != MagickFalse)
+      if (IfMagickTrue(windows->info.mapped) )
         (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
     /*
       Wait for next event.
@@ -3231,11 +3221,11 @@ static MagickBooleanType XChopImage(Display *display,
   y=0;
   if (windows->image.crop_geometry != (char *) NULL)
     (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   chop_info.x+=x;
   chop_info.x=(ssize_t) (scale_factor*chop_info.x+0.5);
   chop_info.width=(unsigned int) (scale_factor*chop_info.width+0.5);
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   chop_info.y+=y;
   chop_info.y=(ssize_t) (scale_factor*chop_info.y+0.5);
   chop_info.height=(unsigned int) (scale_factor*chop_info.height+0.5);
@@ -3329,8 +3319,8 @@ static MagickBooleanType XColorEditImage(Display *display,
     border_color = { 0, 0, 0, 0, 0, 0 };
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -3386,12 +3376,12 @@ static MagickBooleanType XColorEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
           x+windows->image.x,y+windows->image.y);
         XInfoWidget(display,windows,text);
       }
@@ -3456,7 +3446,7 @@ static MagickBooleanType XColorEditImage(Display *display,
             if (pen_number == (MaxNumberPens-2))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -3502,7 +3492,7 @@ static MagickBooleanType XColorEditImage(Display *display,
             if (pen_number == (MaxNumberPens-2))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -3522,7 +3512,7 @@ static MagickBooleanType XColorEditImage(Display *display,
           case ColorEditFuzzCommand:
           {
             static char
-              fuzz[MaxTextExtent];
+              fuzz[MagickPathExtent];
 
             static const char
               *FuzzMenu[] =
@@ -3549,12 +3539,12 @@ static MagickBooleanType XColorEditImage(Display *display,
                   QuantumRange+1.0);
                 break;
               }
-            (void) (void) CopyMagickString(fuzz,"20%",MaxTextExtent);
+            (void) (void) CopyMagickString(fuzz,"20%",MagickPathExtent);
             (void) XDialogWidget(display,windows,"Ok",
               "Enter fuzz factor (0.0 - 99.9%):",fuzz);
             if (*fuzz == '\0')
               break;
-            (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
+            (void) ConcatenateMagickString(fuzz,"%",MagickPathExtent);
             (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
               1.0);
             break;
@@ -3678,7 +3668,7 @@ static MagickBooleanType XColorEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -3733,7 +3723,7 @@ static MagickBooleanType XColorEditImage(Display *display,
         if ((x_offset >= (int) (*image)->columns) ||
             (y_offset >= (int) (*image)->rows))
           continue;
-        image_view=AcquireCacheView(*image);
+        image_view=AcquireAuthenticCacheView(*image,exception);
         switch (method)
         {
           case PointMethod:
@@ -3742,7 +3732,7 @@ static MagickBooleanType XColorEditImage(Display *display,
             /*
               Update color information using point algorithm.
             */
-            if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+            if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
               return(MagickFalse);
             q=GetCacheViewAuthenticPixels(image_view,(ssize_t)x_offset,
               (ssize_t) y_offset,1,1,exception);
@@ -3787,7 +3777,7 @@ static MagickBooleanType XColorEditImage(Display *display,
                       }
                     q+=GetPixelChannels(*image);
                   }
-                  if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+                  if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
                     break;
                 }
               }
@@ -3824,20 +3814,20 @@ static MagickBooleanType XColorEditImage(Display *display,
               y_offset,&target,exception);
             if (method == FillToBorderMethod)
               {
-                target.red=(MagickRealType)
+                target.red=(double)
                   ScaleShortToQuantum(border_color.red);
-                target.green=(MagickRealType)
+                target.green=(double)
                   ScaleShortToQuantum(border_color.green);
-                target.blue=(MagickRealType)
+                target.blue=(double)
                   ScaleShortToQuantum(border_color.blue);
               }
             draw_info=CloneDrawInfo(resource_info->image_info,
               (DrawInfo *) NULL);
             (void) QueryColorCompliance(resource_info->pen_colors[pen_id],
               AllCompliance,&draw_info->fill,exception);
-            (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
-              x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
-              MagickFalse : MagickTrue,exception);
+            (void) FloodfillPaintImage(*image,draw_info,&target,
+              (ssize_t)x_offset,(ssize_t)y_offset,
+              method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
             draw_info=DestroyDrawInfo(draw_info);
             break;
           }
@@ -3846,7 +3836,7 @@ static MagickBooleanType XColorEditImage(Display *display,
             /*
               Update color information using reset algorithm.
             */
-            if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+            if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
               return(MagickFalse);
             for (y=0; y < (int) (*image)->rows; y++)
             {
@@ -3861,7 +3851,7 @@ static MagickBooleanType XColorEditImage(Display *display,
                 SetPixelBlue(*image,ScaleShortToQuantum(color.blue),q);
                 q+=GetPixelChannels(*image);
               }
-              if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+              if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
                 break;
             }
             break;
@@ -3918,8 +3908,8 @@ static MagickBooleanType XCompositeImage(Display *display,
   ExceptionInfo *exception)
 {
   static char
-    displacement_geometry[MaxTextExtent] = "30x30",
-    filename[MaxTextExtent] = "\0";
+    displacement_geometry[MagickPathExtent] = "30x30",
+    filename[MagickPathExtent] = "\0";
 
   static const char
     *CompositeMenu[] =
@@ -3946,7 +3936,7 @@ static MagickBooleanType XCompositeImage(Display *display,
     };
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -3960,7 +3950,7 @@ static MagickBooleanType XCompositeImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     blend,
     scale_factor;
 
@@ -3990,7 +3980,7 @@ static MagickBooleanType XCompositeImage(Display *display,
   XSetCursorState(display,windows,MagickTrue);
   XCheckRefreshWindows(display,windows);
   (void) CopyMagickString(resource_info->image_info->filename,filename,
-    MaxTextExtent);
+    MagickPathExtent);
   composite_image=ReadImage(resource_info->image_info,exception);
   CatchException(exception);
   XSetCursorState(display,windows,MagickFalse);
@@ -4021,12 +4011,12 @@ static MagickBooleanType XCompositeImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
           (long) composite_info.x,(long) composite_info.y);
         XInfoWidget(display,windows,text);
       }
@@ -4054,7 +4044,7 @@ static MagickBooleanType XCompositeImage(Display *display,
           case CompositeOperatorsCommand:
           {
             char
-              command[MaxTextExtent],
+              command[MagickPathExtent],
               **operators;
 
             /*
@@ -4074,7 +4064,7 @@ static MagickBooleanType XCompositeImage(Display *display,
           case CompositeDissolveCommand:
           {
             static char
-              factor[MaxTextExtent] = "20.0";
+              factor[MagickPathExtent] = "20.0";
 
             /*
               Dissolve the two images a given percent.
@@ -4135,7 +4125,7 @@ static MagickBooleanType XCompositeImage(Display *display,
     {
       case ButtonPress:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -4155,7 +4145,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       }
       case ButtonRelease:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -4179,7 +4169,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -4195,7 +4185,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: 0x%lx (%s)",(unsigned long) key_symbol,command);
         switch ((int) key_symbol)
@@ -4237,7 +4227,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -4254,7 +4244,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       }
       default:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -4279,11 +4269,11 @@ static MagickBooleanType XCompositeImage(Display *display,
   y=0;
   if (windows->image.crop_geometry != (char *) NULL)
     (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   composite_info.x+=x;
   composite_info.x=(ssize_t) (scale_factor*composite_info.x+0.5);
   composite_info.width=(unsigned int) (scale_factor*composite_info.width+0.5);
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   composite_info.y+=y;
   composite_info.y=(ssize_t) (scale_factor*composite_info.y+0.5);
   composite_info.height=(unsigned int) (scale_factor*composite_info.height+0.5);
@@ -4297,8 +4287,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         Scale composite image.
       */
       resize_image=ResizeImage(composite_image,composite_info.width,
-        composite_info.height,composite_image->filter,composite_image->blur,
-        exception);
+        composite_info.height,composite_image->filter,exception);
       composite_image=DestroyImage(composite_image);
       if (resize_image == (Image *) NULL)
         {
@@ -4331,12 +4320,12 @@ static MagickBooleanType XCompositeImage(Display *display,
         Create mattes for blending.
       */
       (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel,exception);
-      opacity=(Quantum) (ScaleQuantumToChar((Quantum) QuantumRange)-
-        ((ssize_t) ScaleQuantumToChar((Quantum) QuantumRange)*blend)/100);
-      if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
+      opacity=(Quantum) (ScaleQuantumToChar(QuantumRange)-
+        ((ssize_t) ScaleQuantumToChar(QuantumRange)*blend)/100);
+      if (IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
         return(MagickFalse);
-      image->matte=MagickTrue;
-      image_view=AcquireCacheView(image);
+      image->alpha_trait=BlendPixelTrait;
+      image_view=AcquireAuthenticCacheView(image,exception);
       for (y=0; y < (int) image->rows; y++)
       {
         q=GetCacheViewAuthenticPixels(image_view,0,(ssize_t) y,image->columns,1,
@@ -4348,7 +4337,7 @@ static MagickBooleanType XCompositeImage(Display *display,
           SetPixelAlpha(image,opacity,q);
           q+=GetPixelChannels(image);
         }
-        if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+        if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
           break;
       }
       image_view=DestroyCacheView(image_view);
@@ -4356,8 +4345,8 @@ static MagickBooleanType XCompositeImage(Display *display,
   /*
     Composite image with X Image window.
   */
-  (void) CompositeImage(image,compose,composite_image,composite_info.x,
-    composite_info.y,exception);
+  (void) CompositeImage(image,composite_image,compose,MagickTrue,
+    composite_info.x,composite_info.y,exception);
   composite_image=DestroyImage(composite_image);
   XSetCursorState(display,windows,MagickFalse);
   /*
@@ -4409,7 +4398,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    geometry[MaxTextExtent];
+    geometry[MagickPathExtent];
 
   MagickStatusType
     status;
@@ -4434,7 +4423,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   */
   width=(unsigned int) windows->image.window_changes.width;
   height=(unsigned int) windows->image.window_changes.height;
-  if (image->debug != MagickFalse)
+  if (IfMagickTrue(image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Configure Image: %dx%d=>%.20gx%.20g",windows->image.ximage->width,
       windows->image.ximage->height,(double) width,(double) height);
@@ -4459,17 +4448,17 @@ static MagickBooleanType XConfigureImage(Display *display,
     (height*windows->image.y/windows->image.ximage->height);
   status=XMakeImage(display,resource_info,&windows->image,image,
     (unsigned int) width,(unsigned int) height,exception);
-  if (status == MagickFalse)
+  if (IfMagickFalse(status) )
     XNoticeWidget(display,windows,"Unable to configure X image:",
       windows->image.name);
   /*
     Notify window manager of the new configuration.
   */
   if (resource_info->image_geometry != (char *) NULL)
-    (void) FormatLocaleString(geometry,MaxTextExtent,"%s>!",
+    (void) FormatLocaleString(geometry,MagickPathExtent,"%s>!",
       resource_info->image_geometry);
   else
-    (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+    (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>!",
       XDisplayWidth(display,windows->image.screen),
       XDisplayHeight(display,windows->image.screen));
   (void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
@@ -4495,7 +4484,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   /*
     Update Magnify window configuration.
   */
-  if (windows->magnify.mapped != MagickFalse)
+  if (IfMagickTrue(windows->magnify.mapped) )
     XMakeMagnifyImage(display,windows,exception);
   windows->pan.crop_geometry=windows->image.crop_geometry;
   XBestIconSize(display,&windows->pan,image);
@@ -4615,8 +4604,8 @@ static MagickBooleanType XCropImage(Display *display,
     *image_view;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -4632,7 +4621,7 @@ static MagickBooleanType XCropImage(Display *display,
   Image
     *crop_image;
 
-  MagickRealType
+  double
     scale_factor;
 
   RectangleInfo
@@ -4693,12 +4682,12 @@ static MagickBooleanType XCropImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
           (long) crop_info.x,(long) crop_info.y);
         XInfoWidget(display,windows,text);
       }
@@ -4840,7 +4829,7 @@ static MagickBooleanType XCropImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -4891,9 +4880,9 @@ static MagickBooleanType XCropImage(Display *display,
           /*
             Display info and draw cropping rectangle.
           */
-          if (windows->info.mapped == MagickFalse)
+          if (IfMagickFalse(windows->info.mapped) )
             (void) XMapWindow(display,windows->info.id);
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           XInfoWidget(display,windows,text);
@@ -4901,7 +4890,7 @@ static MagickBooleanType XCropImage(Display *display,
             windows->image.highlight_context,&highlight_info);
         }
       else
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
       /*
         Wait for next event.
@@ -4981,12 +4970,12 @@ static MagickBooleanType XCropImage(Display *display,
     (void) XMapWindow(display,windows->info.id);
     do
     {
-      if (windows->info.mapped != MagickFalse)
+      if (IfMagickTrue(windows->info.mapped) )
         {
           /*
             Display pointer position.
           */
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             " %.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           XInfoWidget(display,windows,text);
@@ -5163,10 +5152,10 @@ static MagickBooleanType XCropImage(Display *display,
             case XK_Home:
             case XK_KP_Home:
             {
-              crop_info.x=(ssize_t) (windows->image.width/2L-
-                crop_info.width/2L);
-              crop_info.y=(ssize_t) (windows->image.height/2L-
-                crop_info.height/2L);
+              crop_info.x=(ssize_t) (windows->image.width/2L-crop_info.width/
+                2L);
+              crop_info.y=(ssize_t) (windows->image.height/2L-crop_info.height/
+                2L);
               break;
             }
             case XK_Left:
@@ -5246,7 +5235,7 @@ static MagickBooleanType XCropImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (windows->info.mapped != MagickFalse)
+          if (IfMagickTrue(windows->info.mapped) )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -5272,7 +5261,7 @@ static MagickBooleanType XCropImage(Display *display,
           /*
             Set primary selection.
           */
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             "%.20gx%.20g%+.20g%+.20g",(double) crop_info.width,(double)
             crop_info.height,(double) crop_info.x,(double) crop_info.y);
           request=(&(event.xselectionrequest));
@@ -5331,11 +5320,11 @@ static MagickBooleanType XCropImage(Display *display,
   y=0;
   if (windows->image.crop_geometry != (char *) NULL)
     (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   crop_info.x+=x;
   crop_info.x=(ssize_t) (scale_factor*crop_info.x+0.5);
   crop_info.width=(unsigned int) (scale_factor*crop_info.width+0.5);
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   crop_info.y+=y;
   crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
   crop_info.height=(unsigned int) (scale_factor*crop_info.height+0.5);
@@ -5354,10 +5343,10 @@ static MagickBooleanType XCropImage(Display *display,
   /*
     Cut image.
   */
-  if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
+  if (IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
     return(MagickFalse);
-  image->matte=MagickTrue;
-  image_view=AcquireCacheView(image);
+  image->alpha_trait=BlendPixelTrait;
+  image_view=AcquireAuthenticCacheView(image,exception);
   for (y=0; y < (int) crop_info.height; y++)
   {
     q=GetCacheViewAuthenticPixels(image_view,crop_info.x,y+crop_info.y,
@@ -5369,7 +5358,7 @@ static MagickBooleanType XCropImage(Display *display,
       SetPixelAlpha(image,TransparentAlpha,q);
       q+=GetPixelChannels(image);
     }
-    if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+    if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
       break;
   }
   image_view=DestroyCacheView(image_view);
@@ -5455,8 +5444,8 @@ static MagickBooleanType XDrawEditImage(Display *display,
     line_width = 1;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -5468,7 +5457,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     degrees;
 
   MagickStatusType
@@ -5541,12 +5530,12 @@ static MagickBooleanType XDrawEditImage(Display *display,
     state=DefaultState;
     do
     {
-      if (windows->info.mapped != MagickFalse)
+      if (IfMagickTrue(windows->info.mapped) )
         {
           /*
             Display pointer position.
           */
-          (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+          (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
             x+windows->image.x,y+windows->image.y);
           XInfoWidget(display,windows,text);
         }
@@ -5620,7 +5609,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 break;
               transparent=pen_number == (MaxNumberPens-2) ? MagickTrue :
                 MagickFalse;
-              if (transparent != MagickFalse)
+              if (IfMagickTrue(transparent) )
                 {
                   draw_info.stencil=TransparentStencil;
                   break;
@@ -5628,7 +5617,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
               if (pen_number == (MaxNumberPens-1))
                 {
                   static char
-                    color_name[MaxTextExtent] = "gray";
+                    color_name[MagickPathExtent] = "gray";
 
                   /*
                     Select a pen color from a dialog.
@@ -5662,7 +5651,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 status;
 
               static char
-                filename[MaxTextExtent] = "\0";
+                filename[MagickPathExtent] = "\0";
 
               static const char
                 *StipplesMenu[] =
@@ -5750,14 +5739,14 @@ static MagickBooleanType XDrawEditImage(Display *display,
               XCheckRefreshWindows(display,windows);
               image_info=AcquireImageInfo();
               (void) CopyMagickString(image_info->filename,filename,
-                MaxTextExtent);
+                MagickPathExtent);
               stipple_image=ReadImage(image_info,exception);
               CatchException(exception);
               XSetCursorState(display,windows,MagickFalse);
               if (stipple_image == (Image *) NULL)
                 break;
               (void) AcquireUniqueFileResource(filename);
-              (void) FormatLocaleString(stipple_image->filename,MaxTextExtent,
+              (void) FormatLocaleString(stipple_image->filename,MagickPathExtent,
                 "xbm:%s",filename);
               (void) WriteImage(image_info,stipple_image,exception);
               stipple_image=DestroyImage(stipple_image);
@@ -5773,7 +5762,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
             case DrawWidthCommand:
             {
               static char
-                width[MaxTextExtent] = "0";
+                width[MagickPathExtent] = "0";
 
               static const char
                 *WidthsMenu[] =
@@ -5901,7 +5890,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (windows->info.mapped != MagickFalse)
+          if (IfMagickTrue(windows->info.mapped) )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -5951,7 +5940,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
               (void) XDrawLines(display,windows->image.id,
                 windows->image.highlight_context,coordinate_info,
                 number_coordinates,CoordModeOrigin);
-              (void) FormatLocaleString(text,MaxTextExtent," %+d%+d",
+              (void) FormatLocaleString(text,MagickPathExtent," %+d%+d",
                 coordinate_info[number_coordinates-1].x,
                 coordinate_info[number_coordinates-1].y);
               XInfoWidget(display,windows,text);
@@ -5967,14 +5956,14 @@ static MagickBooleanType XDrawEditImage(Display *display,
               */
               degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
                 line_info.y1),(double) (line_info.x2-line_info.x1)));
-              (void) FormatLocaleString(text,MaxTextExtent," %g",
+              (void) FormatLocaleString(text,MagickPathExtent," %g",
                 (double) degrees);
               XInfoWidget(display,windows,text);
               XHighlightLine(display,windows->image.id,
                 windows->image.highlight_context,&line_info);
             }
           else
-            if (windows->info.mapped != MagickFalse)
+            if (IfMagickTrue(windows->info.mapped) )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -5987,7 +5976,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
               /*
                 Display info and draw drawing rectangle.
               */
-              (void) FormatLocaleString(text,MaxTextExtent,
+              (void) FormatLocaleString(text,MagickPathExtent,
                 " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
                 (double) rectangle_info.height,(double) rectangle_info.x,
                 (double) rectangle_info.y);
@@ -5996,7 +5985,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&rectangle_info);
             }
           else
-            if (windows->info.mapped != MagickFalse)
+            if (IfMagickTrue(windows->info.mapped) )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6011,7 +6000,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
               /*
                 Display info and draw drawing rectangle.
               */
-              (void) FormatLocaleString(text,MaxTextExtent,
+              (void) FormatLocaleString(text,MagickPathExtent,
                 " %.20gx%.20g%+.20g%+.20g",(double) rectangle_info.width,
                 (double) rectangle_info.height,(double) rectangle_info.x,
                 (double) rectangle_info.y);
@@ -6020,7 +6009,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 windows->image.highlight_context,&rectangle_info);
             }
           else
-            if (windows->info.mapped != MagickFalse)
+            if (IfMagickTrue(windows->info.mapped) )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6039,14 +6028,14 @@ static MagickBooleanType XDrawEditImage(Display *display,
               */
               degrees=RadiansToDegrees(-atan2((double) (line_info.y2-
                 line_info.y1),(double) (line_info.x2-line_info.x1)));
-              (void) FormatLocaleString(text,MaxTextExtent," %g",
+              (void) FormatLocaleString(text,MagickPathExtent," %g",
                 (double) degrees);
               XInfoWidget(display,windows,text);
               XHighlightLine(display,windows->image.id,
                 windows->image.highlight_context,&line_info);
             }
           else
-            if (windows->info.mapped != MagickFalse)
+            if (IfMagickTrue(windows->info.mapped) )
               (void) XWithdrawWindow(display,windows->info.id,
                 windows->info.screen);
           break;
@@ -6283,7 +6272,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
     draw_info.height=(unsigned int) rectangle_info.height+(line_width << 1);
     if (draw_info.height > (unsigned int) (*image)->rows)
       draw_info.height=(unsigned int) (*image)->rows;
-    (void) FormatLocaleString(draw_info.geometry,MaxTextExtent,"%ux%u%+d%+d",
+    (void) FormatLocaleString(draw_info.geometry,MagickPathExtent,"%ux%u%+d%+d",
       width*draw_info.width/windows->image.ximage->width,
       height*draw_info.height/windows->image.ximage->height,
       draw_info.x+x,draw_info.y+y);
@@ -6371,7 +6360,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
 */
 static void XDrawPanRectangle(Display *display,XWindows *windows)
 {
-  MagickRealType
+  double
     scale_factor;
 
   RectangleInfo
@@ -6380,10 +6369,10 @@ static void XDrawPanRectangle(Display *display,XWindows *windows)
   /*
     Determine dimensions of the panning rectangle.
   */
-  scale_factor=(MagickRealType) windows->pan.width/windows->image.ximage->width;
+  scale_factor=(double) windows->pan.width/windows->image.ximage->width;
   highlight_info.x=(ssize_t) (scale_factor*windows->image.x+0.5);
   highlight_info.width=(unsigned int) (scale_factor*windows->image.width+0.5);
-  scale_factor=(MagickRealType)
+  scale_factor=(double)
     windows->pan.height/windows->image.ximage->height;
   highlight_info.y=(ssize_t) (scale_factor*windows->image.y+0.5);
   highlight_info.height=(unsigned int) (scale_factor*windows->image.height+0.5);
@@ -6466,7 +6455,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
     case UndoCommand:
     {
       char
-        image_geometry[MaxTextExtent];
+        image_geometry[MagickPathExtent];
 
       /*
         Undo the last image transformation.
@@ -6480,7 +6469,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
       undo_image=GetPreviousImageInList(undo_image);
       windows->image.window_changes.width=(int) cache_image->columns;
       windows->image.window_changes.height=(int) cache_image->rows;
-      (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
+      (void) FormatLocaleString(image_geometry,MagickPathExtent,"%dx%d!",
         windows->image.ximage->width,windows->image.ximage->height);
       (void) TransformImage(image,windows->image.crop_geometry,image_geometry,
         exception);
@@ -6493,7 +6482,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
       redo_image=(*image);
       *image=cache_image->list;
       cache_image=DestroyImage(cache_image);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         return;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -6625,7 +6614,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
         {
           cache_image->geometry=AcquireString((char *) NULL);
           (void) CopyMagickString(cache_image->geometry,
-            windows->image.crop_geometry,MaxTextExtent);
+            windows->image.crop_geometry,MagickPathExtent);
         }
       if (undo_image == (Image *) NULL)
         {
@@ -6659,7 +6648,7 @@ static void XImageCache(Display *display,XResourceInfo *resource_info,
       *image=DestroyImage(*image);
       *image=redo_image;
       redo_image=NewImageList();
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         return;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -6725,7 +6714,7 @@ static CommandType XImageWindowCommand(Display *display,
   KeySym key_symbol,Image **image,ExceptionInfo *exception)
 {
   static char
-    delta[MaxTextExtent] = "";
+    delta[MagickPathExtent] = "";
 
   static const char
     Digits[] = "01234567890";
@@ -7115,9 +7104,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
   ExceptionInfo *exception)
 {
   char
-    filename[MaxTextExtent],
-    geometry[MaxTextExtent],
-    modulate_factors[MaxTextExtent];
+    filename[MagickPathExtent],
+    geometry[MagickPathExtent],
+    modulate_factors[MagickPathExtent];
 
   GeometryInfo
     geometry_info;
@@ -7146,7 +7135,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     i;
 
   static char
-    color[MaxTextExtent] = "gray";
+    color[MagickPathExtent] = "gray";
 
   unsigned int
     height,
@@ -7201,6 +7190,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         Select image.
       */
+      if (*resource_info->home_directory == '\0')
+        (void) CopyMagickString(resource_info->home_directory,".",
+          MagickPathExtent);
       status=chdir(resource_info->home_directory);
       if (status == -1)
         (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -7214,12 +7206,12 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Save image.
       */
       status=XSaveImage(display,resource_info,windows,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           char
-            message[MaxTextExtent];
+            message[MagickPathExtent];
 
-          (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+          (void) FormatLocaleString(message,MagickPathExtent,"%s:%s",
             exception->reason != (char *) NULL ? exception->reason : "",
             exception->description != (char *) NULL ? exception->description :
             "");
@@ -7234,12 +7226,12 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Print image.
       */
       status=XPrintImage(display,resource_info,windows,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           char
-            message[MaxTextExtent];
+            message[MagickPathExtent];
 
-          (void) FormatLocaleString(message,MaxTextExtent,"%s:%s",
+          (void) FormatLocaleString(message,MagickPathExtent,"%s:%s",
             exception->reason != (char *) NULL ? exception->reason : "",
             exception->description != (char *) NULL ? exception->description :
             "");
@@ -7251,7 +7243,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case DeleteCommand:
     {
       static char
-        filename[MaxTextExtent] = "\0";
+        filename[MagickPathExtent] = "\0";
 
       /*
         Delete image file.
@@ -7259,8 +7251,8 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XFileBrowserWidget(display,windows,"Delete",filename);
       if (*filename == '\0')
         break;
-      status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
-      if (status != MagickFalse)
+      status=ShredFile(filename);
+      if (IfMagickTrue(status) )
         XNoticeWidget(display,windows,"Unable to delete image file:",filename);
       break;
     }
@@ -7270,8 +7262,8 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         status;
 
       static char
-        color[MaxTextExtent] = "gray",
-        geometry[MaxTextExtent] = "640x480";
+        color[MagickPathExtent] = "gray",
+        geometry[MagickPathExtent] = "640x480";
 
       static const char
         *format = "gradient";
@@ -7291,7 +7283,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         Create canvas.
       */
-      (void) FormatLocaleString(image_info->filename,MaxTextExtent,
+      (void) FormatLocaleString(image_info->filename,MagickPathExtent,
         "%s:%s",format,color);
       (void) CloneString(&image_info->size,geometry);
       nexus=ReadImage(image_info,exception);
@@ -7313,7 +7305,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         exit program.
       */
-      if (resource_info->confirm_exit == MagickFalse)
+      if (IfMagickFalse(resource_info->confirm_exit) )
         XClientMessage(display,windows->image.id,windows->im_protocols,
           windows->im_exit,CurrentTime);
       else
@@ -7355,7 +7347,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Paste image.
       */
       status=XPasteImage(display,resource_info,windows,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to paste X image",
             (*image)->filename);
@@ -7413,14 +7405,14 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       height=(size_t) windows->image.ximage->height;
       x=0;
       y=0;
-      (void) FormatLocaleString(geometry,MaxTextExtent,"%.20gx%.20g+0+0",
+      (void) FormatLocaleString(geometry,MagickPathExtent,"%.20gx%.20g+0+0",
         (double) width,(double) height);
       status=XDialogWidget(display,windows,"Resize",
         "Enter resize geometry (e.g. 640x480, 200%):",geometry);
       if (*geometry == '\0')
         break;
       if (status == 0)
-        (void) ConcatenateMagickString(geometry,"!",MaxTextExtent);
+        (void) ConcatenateMagickString(geometry,"!",MagickPathExtent);
       (void) ParseMetaGeometry(geometry,&x,&y,&width,&height);
       windows->image.window_changes.width=(int) width;
       windows->image.window_changes.height=(int) height;
@@ -7430,7 +7422,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case ApplyCommand:
     {
       char
-        image_geometry[MaxTextExtent];
+        image_geometry[MagickPathExtent];
 
       if ((windows->image.crop_geometry == (char *) NULL) &&
           ((int) (*image)->columns == windows->image.ximage->width) &&
@@ -7444,7 +7436,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         Crop and/or scale displayed image.
       */
-      (void) FormatLocaleString(image_geometry,MaxTextExtent,"%dx%d!",
+      (void) FormatLocaleString(image_geometry,MagickPathExtent,"%dx%d!",
         windows->image.ximage->width,windows->image.ximage->height);
       (void) TransformImage(image,windows->image.crop_geometry,image_geometry,
         exception);
@@ -7503,7 +7495,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Chop image.
       */
       status=XChopImage(display,resource_info,windows,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to cut X image",
             (*image)->filename);
@@ -7538,10 +7530,10 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
           height=(unsigned int) (*image)->rows;
           (void) XParseGeometry(windows->image.crop_geometry,&x,&y,
             &width,&height);
-          (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+          (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",width,height,(int) (*image)->columns-(int) width-x,y);
         }
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
       break;
@@ -7573,10 +7565,10 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
           height=(unsigned int) (*image)->rows;
           (void) XParseGeometry(windows->image.crop_geometry,&x,&y,
             &width,&height);
-          (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+          (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",width,height,x,(int) (*image)->rows-(int) height-y);
         }
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
       break;
@@ -7587,7 +7579,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Rotate image 90 degrees clockwise.
       */
       status=XRotateImage(display,resource_info,windows,90.0,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to rotate X image",
             (*image)->filename);
@@ -7601,7 +7593,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Rotate image 90 degrees counter-clockwise.
       */
       status=XRotateImage(display,resource_info,windows,-90.0,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to rotate X image",
             (*image)->filename);
@@ -7615,7 +7607,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Rotate image.
       */
       status=XRotateImage(display,resource_info,windows,0.0,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to rotate X image",
             (*image)->filename);
@@ -7629,7 +7621,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *shear_image;
 
       static char
-        geometry[MaxTextExtent] = "45.0x45.0";
+        geometry[MagickPathExtent] = "45.0x45.0";
 
       /*
         Query user for shear color and geometry.
@@ -7662,7 +7654,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -7676,7 +7668,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *roll_image;
 
       static char
-        geometry[MaxTextExtent] = "+2+2";
+        geometry[MagickPathExtent] = "+2+2";
 
       /*
         Query user for the roll geometry.
@@ -7703,7 +7695,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -7714,12 +7706,12 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case TrimCommand:
     {
       static char
-        fuzz[MaxTextExtent];
+        fuzz[MagickPathExtent];
 
       /*
         Query user for the fuzz factor.
       */
-      (void) FormatLocaleString(fuzz,MaxTextExtent,"%g%%",100.0*
+      (void) FormatLocaleString(fuzz,MagickPathExtent,"%g%%",100.0*
         (*image)->fuzz/(QuantumRange+1.0));
       (void) XDialogWidget(display,windows,"Trim","Enter fuzz factor:",fuzz);
       if (*fuzz == '\0')
@@ -7729,7 +7721,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Trim image.
       */
       status=XTrimImage(display,resource_info,windows,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to trim X image",
             (*image)->filename);
@@ -7740,7 +7732,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case HueCommand:
     {
       static char
-        hue_percent[MaxTextExtent] = "110";
+        hue_percent[MagickPathExtent] = "110";
 
       /*
         Query user for percent hue change.
@@ -7754,12 +7746,12 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) CopyMagickString(modulate_factors,"100.0/100.0/",MaxTextExtent);
+      (void) CopyMagickString(modulate_factors,"100.0/100.0/",MagickPathExtent);
       (void) ConcatenateMagickString(modulate_factors,hue_percent,
-        MaxTextExtent);
+        MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7768,7 +7760,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case SaturationCommand:
     {
       static char
-        saturation_percent[MaxTextExtent] = "110";
+        saturation_percent[MagickPathExtent] = "110";
 
       /*
         Query user for percent saturation change.
@@ -7782,12 +7774,12 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) CopyMagickString(modulate_factors,"100.0/",MaxTextExtent);
+      (void) CopyMagickString(modulate_factors,"100.0/",MagickPathExtent);
       (void) ConcatenateMagickString(modulate_factors,saturation_percent,
-        MaxTextExtent);
+        MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7796,7 +7788,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case BrightnessCommand:
     {
       static char
-        brightness_percent[MaxTextExtent] = "110";
+        brightness_percent[MagickPathExtent] = "110";
 
       /*
         Query user for percent brightness change.
@@ -7811,10 +7803,10 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       (void) CopyMagickString(modulate_factors,brightness_percent,
-        MaxTextExtent);
+        MagickPathExtent);
       (void) ModulateImage(*image,modulate_factors,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7823,7 +7815,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case GammaCommand:
     {
       static char
-        factor[MaxTextExtent] = "1.6";
+        factor[MagickPathExtent] = "1.6";
 
       /*
         Query user for gamma value.
@@ -7837,9 +7829,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) GammaImage(*image,atof(factor),exception);
+      (void) GammaImage(*image,strtod(factor,(char **) NULL),exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7854,7 +7846,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) ContrastImage(*image,MagickTrue,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7869,7 +7861,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) ContrastImage(*image,MagickFalse,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7882,7 +7874,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         white_point;
 
       static char
-        levels[MaxTextExtent] = "1%";
+        levels[MagickPathExtent] = "1%";
 
       /*
         Query user for gamma value.
@@ -7904,11 +7896,11 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
           black_point*=(double) (*image)->columns*(*image)->rows/100.0;
           white_point*=(double) (*image)->columns*(*image)->rows/100.0;
         }
-      white_point=(MagickRealType) (*image)->columns*(*image)->rows-white_point;
+      white_point=(double) (*image)->columns*(*image)->rows-white_point;
       (void) ContrastStretchImage(*image,black_point,white_point,
         exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7923,7 +7915,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         flags;
 
       static char
-        levels[MaxTextExtent] = "3x50%";
+        levels[MagickPathExtent] = "3x50%";
 
       /*
         Query user for gamma value.
@@ -7945,7 +7937,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) SigmoidalContrastImage(*image,MagickTrue,geometry_info.rho,
         geometry_info.sigma,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7960,7 +7952,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) NormalizeImage(*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7975,7 +7967,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) EqualizeImage(*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -7990,7 +7982,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       (void) NegateImage(*image,MagickFalse,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8003,10 +7995,10 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) SetImageType(*image,(*image)->matte == MagickFalse ?
-        GrayscaleType : GrayscaleMatteType,exception);
+      (void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
+        GrayscaleType : GrayscaleAlphaType,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8018,7 +8010,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *affinity_image;
 
       static char
-        filename[MaxTextExtent] = "\0";
+        filename[MagickPathExtent] = "\0";
 
       /*
         Request image file name from user.
@@ -8031,7 +8023,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
-      (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+      (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
       affinity_image=ReadImage(image_info,exception);
       if (affinity_image != (Image *) NULL)
         {
@@ -8040,7 +8032,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8052,7 +8044,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         status;
 
       static char
-        colors[MaxTextExtent] = "256";
+        colors[MagickPathExtent] = "256";
 
       /*
         Query user for maximum number of colors.
@@ -8067,10 +8059,11 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       quantize_info.number_colors=StringToUnsignedLong(colors);
-      quantize_info.dither=status != 0 ? MagickTrue : MagickFalse;
+      quantize_info.dither_method=status != 0 ? RiemersmaDitherMethod :
+        NoDitherMethod;
       (void) QuantizeImage(&quantize_info,*image,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8094,7 +8087,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8106,7 +8099,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *emboss_image;
 
       static char
-        radius[MaxTextExtent] = "0.0x1.0";
+        radius[MagickPathExtent] = "0.0x1.0";
 
       /*
         Query user for emboss radius.
@@ -8132,7 +8125,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8144,7 +8137,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *noise_image;
 
       static char
-        radius[MaxTextExtent] = "0";
+        radius[MagickPathExtent] = "0";
 
       /*
         Query user for noise radius.
@@ -8168,7 +8161,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8183,7 +8176,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *noise_image;
 
       static char
-        noise_type[MaxTextExtent] = "Gaussian";
+        noise_type[MagickPathExtent] = "Gaussian";
 
       /*
         Add noise to the image.
@@ -8208,7 +8201,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8220,7 +8213,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *sharp_image;
 
       static char
-        radius[MaxTextExtent] = "0.0x1.0";
+        radius[MagickPathExtent] = "0.0x1.0";
 
       /*
         Query user for sharpen radius.
@@ -8236,7 +8229,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       flags=ParseGeometry(radius,&geometry_info);
       sharp_image=SharpenImage(*image,geometry_info.rho,geometry_info.sigma,
-        geometry_info.xi,exception);
+        exception);
       if (sharp_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8244,7 +8237,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8256,7 +8249,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *blur_image;
 
       static char
-        radius[MaxTextExtent] = "0.0x1.0";
+        radius[MagickPathExtent] = "0.0x1.0";
 
       /*
         Query user for blur radius.
@@ -8272,7 +8265,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       flags=ParseGeometry(radius,&geometry_info);
       blur_image=BlurImage(*image,geometry_info.rho,geometry_info.sigma,
-        geometry_info.xi,exception);
+        exception);
       if (blur_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8280,7 +8273,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8292,7 +8285,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         threshold;
 
       static char
-        factor[MaxTextExtent] = "128";
+        factor[MagickPathExtent] = "128";
 
       /*
         Query user for threshold value.
@@ -8309,7 +8302,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
       (void) BilevelImage(*image,threshold,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8321,7 +8314,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *edge_image;
 
       static char
-        radius[MaxTextExtent] = "0";
+        radius[MagickPathExtent] = "0";
 
       /*
         Query user for edge factor.
@@ -8336,8 +8329,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       flags=ParseGeometry(radius,&geometry_info);
-      edge_image=EdgeImage(*image,geometry_info.rho,geometry_info.sigma,
-        exception);
+      edge_image=EdgeImage(*image,geometry_info.rho,exception);
       if (edge_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8345,7 +8337,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8357,7 +8349,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *spread_image;
 
       static char
-        amount[MaxTextExtent] = "2";
+        amount[MagickPathExtent] = "2";
 
       /*
         Query user for spread amount.
@@ -8372,8 +8364,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       flags=ParseGeometry(amount,&geometry_info);
-      spread_image=EdgeImage(*image,geometry_info.rho,geometry_info.sigma,
-        exception);
+      spread_image=EdgeImage(*image,geometry_info.rho,exception);
       if (spread_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8381,7 +8372,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8396,7 +8387,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         status;
 
       static char
-        geometry[MaxTextExtent] = "30x30";
+        geometry[MagickPathExtent] = "30x30";
 
       /*
         Query user for the shade geometry.
@@ -8413,7 +8404,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       flags=ParseGeometry(geometry,&geometry_info);
       if ((flags & SigmaValue) == 0)
         geometry_info.sigma=1.0;
-      shade_image=ShadeImage(*image,status != 0 ? MagickFalse : MagickTrue,
+      shade_image=ShadeImage(*image,status != 0 ? MagickTrue : MagickFalse,
         geometry_info.rho,geometry_info.sigma,exception);
       if (shade_image != (Image *) NULL)
         {
@@ -8422,7 +8413,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8431,7 +8422,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case RaiseCommand:
     {
       static char
-        bevel_width[MaxTextExtent] = "10";
+        bevel_width[MagickPathExtent] = "10";
 
       /*
         Query user for bevel width.
@@ -8450,7 +8441,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         exception);
       (void) RaiseImage(*image,&page_geometry,MagickTrue,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8459,7 +8450,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case SegmentCommand:
     {
       static char
-        threshold[MaxTextExtent] = "1.0x1.5";
+        threshold[MagickPathExtent] = "1.0x1.5";
 
       /*
         Query user for smoothing threshold.
@@ -8479,7 +8470,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) SegmentImage(*image,sRGBColorspace,MagickFalse,geometry_info.rho,
         geometry_info.sigma,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8494,7 +8485,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *sepia_image;
 
       static char
-        factor[MaxTextExtent] = "80%";
+        factor[MagickPathExtent] = "80%";
 
       /*
         Query user for sepia-tone factor.
@@ -8517,7 +8508,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8529,7 +8520,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         threshold;
 
       static char
-        factor[MaxTextExtent] = "60%";
+        factor[MagickPathExtent] = "60%";
 
       /*
         Query user for solarize factor.
@@ -8546,7 +8537,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       threshold=StringToDoubleInterval(factor,(double) QuantumRange+1.0);
       (void) SolarizeImage(*image,threshold,exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8558,7 +8549,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *swirl_image;
 
       static char
-        degrees[MaxTextExtent] = "60";
+        degrees[MagickPathExtent] = "60";
 
       /*
         Query user for swirl angle.
@@ -8582,7 +8573,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8594,7 +8585,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *implode_image;
 
       static char
-        factor[MaxTextExtent] = "0.3";
+        factor[MagickPathExtent] = "0.3";
 
       /*
         Query user for implode factor.
@@ -8618,7 +8609,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8630,7 +8621,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *vignette_image;
 
       static char
-        geometry[MaxTextExtent] = "0x20";
+        geometry[MagickPathExtent] = "0x20";
 
       /*
         Query user for the vignette geometry.
@@ -8651,9 +8642,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         geometry_info.xi=0.1*(*image)->columns;
       if ((flags & PsiValue) == 0)
         geometry_info.psi=0.1*(*image)->rows;
-      vignette_image=VignetteImage(*image,geometry_info.rho,geometry_info.sigma,
-        0.0,(ssize_t) ceil(geometry_info.xi-0.5),(ssize_t)
-        ceil(geometry_info.psi-0.5),exception);
+      vignette_image=VignetteImage(*image,geometry_info.rho,0.0,(ssize_t)
+        ceil(geometry_info.xi-0.5),(ssize_t) ceil(geometry_info.psi-0.5),
+        exception);
       if (vignette_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8661,7 +8652,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8673,7 +8664,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *wave_image;
 
       static char
-        geometry[MaxTextExtent] = "25x150";
+        geometry[MagickPathExtent] = "25x150";
 
       /*
         Query user for the wave geometry.
@@ -8699,7 +8690,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8711,7 +8702,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *paint_image;
 
       static char
-        radius[MaxTextExtent] = "0";
+        radius[MagickPathExtent] = "0";
 
       /*
         Query user for circular neighborhood radius.
@@ -8735,7 +8726,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8747,7 +8738,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *charcoal_image;
 
       static char
-        radius[MaxTextExtent] = "0x1";
+        radius[MagickPathExtent] = "0x1";
 
       /*
         Query user for charcoal radius.
@@ -8767,7 +8758,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       if ((flags & SigmaValue) == 0)
         geometry_info.sigma=geometry_info.rho;
       charcoal_image=CharcoalImage(*image,geometry_info.rho,geometry_info.sigma,
-        geometry_info.xi,exception);
+        exception);
       if (charcoal_image != (Image *) NULL)
         {
           *image=DestroyImage(*image);
@@ -8775,7 +8766,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       XConfigureImageColormap(display,resource_info,windows,*image,exception);
       (void) XConfigureImage(display,resource_info,windows,*image,exception);
@@ -8787,7 +8778,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Annotate the image with text.
       */
       status=XAnnotateEditImage(display,resource_info,windows,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to annotate X image",
             (*image)->filename);
@@ -8801,7 +8792,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Draw image.
       */
       status=XDrawEditImage(display,resource_info,windows,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to draw on the X image",
             (*image)->filename);
@@ -8815,7 +8806,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Color edit.
       */
       status=XColorEditImage(display,resource_info,windows,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to pixel edit X image",
             (*image)->filename);
@@ -8829,7 +8820,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Matte edit.
       */
       status=XMatteEditImage(display,resource_info,windows,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to matte edit X image",
             (*image)->filename);
@@ -8844,7 +8835,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       status=XCompositeImage(display,resource_info,windows,*image,
         exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         {
           XNoticeWidget(display,windows,"Unable to composite X image",
             (*image)->filename);
@@ -8858,7 +8849,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *border_image;
 
       static char
-        geometry[MaxTextExtent] = "6x6";
+        geometry[MagickPathExtent] = "6x6";
 
       /*
         Query user for border color and geometry.
@@ -8890,7 +8881,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -8907,7 +8898,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *frame_image;
 
       static char
-        geometry[MaxTextExtent] = "6x6";
+        geometry[MagickPathExtent] = "6x6";
 
       /*
         Query user for frame color and geometry.
@@ -8946,7 +8937,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         }
       CatchException(exception);
       XSetCursorState(display,windows,MagickFalse);
-      if (windows->image.orphan != MagickFalse)
+      if (IfMagickTrue(windows->image.orphan) )
         break;
       windows->image.window_changes.width=(int) (*image)->columns;
       windows->image.window_changes.height=(int) (*image)->rows;
@@ -8996,7 +8987,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       status=InvokeDelegate(image_info,*image,"edit",(char *) NULL,
         exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to edit image comment",
           (char *) NULL);
       else
@@ -9023,10 +9014,10 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       (void) AcquireUniqueFilename(filename);
-      (void) FormatLocaleString((*image)->filename,MaxTextExtent,"launch:%s",
+      (void) FormatLocaleString((*image)->filename,MagickPathExtent,"launch:%s",
         filename);
       status=WriteImage(image_info,*image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to launch image editor",
           (char *) NULL);
       else
@@ -9055,7 +9046,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       /*
         Zoom image.
       */
-      if (windows->magnify.mapped != MagickFalse)
+      if (IfMagickTrue(windows->magnify.mapped) )
         (void) XRaiseWindow(display,windows->magnify.id);
       else
         {
@@ -9077,7 +9068,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         *preview_image;
 
       static char
-        preview_type[MaxTextExtent] = "Gamma";
+        preview_type[MagickPathExtent] = "Gamma";
 
       /*
         Select preview type from menu.
@@ -9102,19 +9093,19 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) DeleteImageProperty(*image,"label");
       (void) SetImageProperty(*image,"label","Preview",exception);
       (void) AcquireUniqueFilename(filename);
-      (void) FormatLocaleString((*image)->filename,MaxTextExtent,"preview:%s",
+      (void) FormatLocaleString((*image)->filename,MagickPathExtent,"preview:%s",
         filename);
       status=WriteImage(image_info,*image,exception);
-      (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+      (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
       preview_image=ReadImage(image_info,exception);
       (void) RelinquishUniqueFileResource(filename);
       if (preview_image == (Image *) NULL)
         break;
-      (void) FormatLocaleString(preview_image->filename,MaxTextExtent,"show:%s",
+      (void) FormatLocaleString(preview_image->filename,MagickPathExtent,"show:%s",
         filename);
       status=WriteImage(image_info,preview_image,exception);
       preview_image=DestroyImage(preview_image);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to show image preview",
           (*image)->filename);
       XDelay(display,1500);
@@ -9135,19 +9126,19 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) DeleteImageProperty(*image,"label");
       (void) SetImageProperty(*image,"label","Histogram",exception);
       (void) AcquireUniqueFilename(filename);
-      (void) FormatLocaleString((*image)->filename,MaxTextExtent,"histogram:%s",
+      (void) FormatLocaleString((*image)->filename,MagickPathExtent,"histogram:%s",
         filename);
       status=WriteImage(image_info,*image,exception);
-      (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+      (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
       histogram_image=ReadImage(image_info,exception);
       (void) RelinquishUniqueFileResource(filename);
       if (histogram_image == (Image *) NULL)
         break;
-      (void) FormatLocaleString(histogram_image->filename,MaxTextExtent,
+      (void) FormatLocaleString(histogram_image->filename,MagickPathExtent,
         "show:%s",filename);
       status=WriteImage(image_info,histogram_image,exception);
       histogram_image=DestroyImage(histogram_image);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to show histogram",
           (*image)->filename);
       XDelay(display,1500);
@@ -9159,7 +9150,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       Image
         *matte_image;
 
-      if ((*image)->matte == MagickFalse)
+      if ((*image)->alpha_trait == UndefinedPixelTrait)
         {
           XNoticeWidget(display,windows,
             "Image does not have any matte information",(*image)->filename);
@@ -9174,19 +9165,19 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       (void) DeleteImageProperty(*image,"label");
       (void) SetImageProperty(*image,"label","Matte",exception);
       (void) AcquireUniqueFilename(filename);
-      (void) FormatLocaleString((*image)->filename,MaxTextExtent,"matte:%s",
+      (void) FormatLocaleString((*image)->filename,MagickPathExtent,"matte:%s",
         filename);
       status=WriteImage(image_info,*image,exception);
-      (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+      (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
       matte_image=ReadImage(image_info,exception);
       (void) RelinquishUniqueFileResource(filename);
       if (matte_image == (Image *) NULL)
         break;
-      (void) FormatLocaleString(matte_image->filename,MaxTextExtent,"show:%s",
+      (void) FormatLocaleString(matte_image->filename,MagickPathExtent,"show:%s",
         filename);
       status=WriteImage(image_info,matte_image,exception);
       matte_image=DestroyImage(matte_image);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to show matte",
           (*image)->filename);
       XDelay(display,1500);
@@ -9199,7 +9190,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Background image.
       */
       status=XBackgroundImage(display,resource_info,windows,image,exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         break;
       nexus=CloneImage(*image,0,0,MagickTrue,exception);
       if (nexus != (Image *) NULL)
@@ -9210,7 +9201,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case SlideShowCommand:
     {
       static char
-        delay[MaxTextExtent] = "5";
+        delay[MagickPathExtent] = "5";
 
       /*
         Display next image after pausing.
@@ -9230,7 +9221,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
         Set user preferences.
       */
       status=XPreferencesWidget(display,resource_info,windows);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         break;
       nexus=CloneImage(*image,0,0,MagickTrue,exception);
       if (nexus != (Image *) NULL)
@@ -9265,14 +9256,14 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       if (mozilla_window != (Window) NULL)
         {
           char
-            command[MaxTextExtent],
+            command[MagickPathExtent],
             *url;
 
           /*
             Display documentation using Netscape remote control.
           */
           url=GetMagickHomeURL();
-          (void) FormatLocaleString(command,MaxTextExtent,
+          (void) FormatLocaleString(command,MagickPathExtent,
             "openurl(%s,new-tab)",url);
           url=DestroyString(url);
           mozilla_atom=XInternAtom(display,"_MOZILLA_COMMAND",MagickFalse);
@@ -9285,7 +9276,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XCheckRefreshWindows(display,windows);
       status=InvokeDelegate(image_info,*image,"browse",(char *) NULL,
         exception);
-      if (status == MagickFalse)
+      if (IfMagickFalse(status) )
         XNoticeWidget(display,windows,"Unable to browse documentation",
           (char *) NULL);
       XDelay(display,1500);
@@ -9346,7 +9337,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
   ExceptionInfo *exception)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   register int
     x,
@@ -9369,7 +9360,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
     /*
       Map and unmap Info widget as text cursor crosses its boundaries.
     */
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         if ((x < (int) (windows->info.x+windows->info.width)) &&
             (y < (int) (windows->info.y+windows->info.height)))
@@ -9379,12 +9370,12 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
       if ((x > (int) (windows->info.x+windows->info.width)) ||
           (y > (int) (windows->info.y+windows->info.height)))
         (void) XMapWindow(display,windows->info.id);
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
           windows->magnify.x,windows->magnify.y);
         XInfoWidget(display,windows,text);
       }
@@ -9609,8 +9600,8 @@ static void XMakePanImage(Display *display,XResourceInfo *resource_info,
   windows->pan.y=(int) windows->image.y;
   status=XMakeImage(display,resource_info,&windows->pan,image,
     windows->pan.width,windows->pan.height,exception);
-  if (status == MagickFalse)
-    ThrowXWindowFatalException(ResourceLimitError,
+  if (IfMagickFalse(status) )
+    ThrowXWindowException(ResourceLimitError,
      "MemoryAllocationFailed",image->filename);
   (void) XSetWindowBackgroundPixmap(display,windows->pan.id,
     windows->pan.pixmap);
@@ -9659,7 +9650,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
   ExceptionInfo *exception)
 {
   static char
-    matte[MaxTextExtent] = "0";
+    matte[MagickPathExtent] = "0";
 
   static const char
     *MatteEditMenu[] =
@@ -9693,8 +9684,8 @@ static MagickBooleanType XMatteEditImage(Display *display,
     border_color = { 0, 0, 0, 0, 0, 0 };
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -9747,12 +9738,12 @@ static MagickBooleanType XMatteEditImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+d%+d ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+d%+d ",
           x+windows->image.x,y+windows->image.y);
         XInfoWidget(display,windows,text);
       }
@@ -9817,7 +9808,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
             if (pen_number == (MaxNumberPens-2))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -9837,7 +9828,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
           case MatteEditFuzzCommand:
           {
             static char
-              fuzz[MaxTextExtent];
+              fuzz[MagickPathExtent];
 
             static const char
               *FuzzMenu[] =
@@ -9864,12 +9855,12 @@ static MagickBooleanType XMatteEditImage(Display *display,
                   QuantumRange+1.0);
                 break;
               }
-            (void) CopyMagickString(fuzz,"20%",MaxTextExtent);
+            (void) CopyMagickString(fuzz,"20%",MagickPathExtent);
             (void) XDialogWidget(display,windows,"Ok",
               "Enter fuzz factor (0.0 - 99.9%):",fuzz);
             if (*fuzz == '\0')
               break;
-            (void) ConcatenateMagickString(fuzz,"%",MaxTextExtent);
+            (void) ConcatenateMagickString(fuzz,"%",MagickPathExtent);
             (*image)->fuzz=StringToDoubleInterval(fuzz,(double) QuantumRange+
               1.0);
             break;
@@ -9877,7 +9868,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
           case MatteEditValueCommand:
           {
             static char
-              message[MaxTextExtent];
+              message[MagickPathExtent];
 
             static const char
               *MatteMenu[] =
@@ -9897,14 +9888,14 @@ static MagickBooleanType XMatteEditImage(Display *display,
               break;
             if (entry != 2)
               {
-                (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
+                (void) FormatLocaleString(matte,MagickPathExtent,QuantumFormat,
                   OpaqueAlpha);
                 if (LocaleCompare(MatteMenu[entry],"Transparent") == 0)
-                  (void) FormatLocaleString(matte,MaxTextExtent,QuantumFormat,
+                  (void) FormatLocaleString(matte,MagickPathExtent,QuantumFormat,
                     (Quantum) TransparentAlpha);
                 break;
               }
-            (void) FormatLocaleString(message,MaxTextExtent,
+            (void) FormatLocaleString(message,MagickPathExtent,
               "Enter matte value (0 - " QuantumFormat "):",(Quantum)
               QuantumRange);
             (void) XDialogWidget(display,windows,"Matte",message,matte);
@@ -9982,7 +9973,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -10035,7 +10026,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -10090,11 +10081,11 @@ static MagickBooleanType XMatteEditImage(Display *display,
         if ((x_offset >= (int) (*image)->columns) ||
             (y_offset >= (int) (*image)->rows))
           continue;
-        if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+        if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
           return(MagickFalse);
-        if ((*image)->matte == MagickFalse)
+        if ((*image)->alpha_trait == UndefinedPixelTrait)
           (void) SetImageAlphaChannel(*image,OpaqueAlphaChannel,exception);
-        image_view=AcquireCacheView(*image);
+        image_view=AcquireAuthenticCacheView(*image,exception);
         switch (method)
         {
           case PointMethod:
@@ -10135,7 +10126,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
                   SetPixelAlpha(*image,(Quantum) StringToLong(matte),q);
                 q+=GetPixelChannels(*image);
               }
-              if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+              if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
                 break;
             }
             break;
@@ -10160,22 +10151,22 @@ static MagickBooleanType XMatteEditImage(Display *display,
               y_offset,&target,exception);
             if (method == FillToBorderMethod)
               {
-                target.red=(MagickRealType) ScaleShortToQuantum(
+                target.red=(double) ScaleShortToQuantum(
                   border_color.red);
-                target.green=(MagickRealType) ScaleShortToQuantum(
+                target.green=(double) ScaleShortToQuantum(
                   border_color.green);
-                target.blue=(MagickRealType) ScaleShortToQuantum(
+                target.blue=(double) ScaleShortToQuantum(
                   border_color.blue);
               }
             draw_info=CloneDrawInfo(resource_info->image_info,
               (DrawInfo *) NULL);
-            draw_info->fill.alpha=(MagickRealType) ClampToQuantum(
+            draw_info->fill.alpha=(double) ClampToQuantum(
               StringToDouble(matte,(char **) NULL));
-            channel_mask=SetPixelChannelMask(*image,AlphaChannel); 
+            channel_mask=SetImageChannelMask(*image,AlphaChannel);
             (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
-              x_offset,(ssize_t) y_offset,method == FloodfillMethod ?
-              MagickFalse : MagickTrue,exception);
-            (void) SetPixelChannelMapMask(*image,channel_mask);
+              x_offset,(ssize_t) y_offset,
+              method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
+            (void) SetPixelChannelMask(*image,channel_mask);
             draw_info=DestroyDrawInfo(draw_info);
             break;
           }
@@ -10184,7 +10175,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
             /*
               Update matte information using reset algorithm.
             */
-            if (SetImageStorageClass(*image,DirectClass,exception) == MagickFalse)
+            if (IfMagickFalse(SetImageStorageClass(*image,DirectClass,exception)) )
               return(MagickFalse);
             for (y=0; y < (int) (*image)->rows; y++)
             {
@@ -10197,11 +10188,11 @@ static MagickBooleanType XMatteEditImage(Display *display,
                 SetPixelAlpha(*image,(Quantum) StringToLong(matte),q);
                 q+=GetPixelChannels(*image);
               }
-              if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+              if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
                 break;
             }
             if (StringToLong(matte) == (long) OpaqueAlpha)
-              (*image)->matte=MagickFalse;
+              (*image)->alpha_trait=UndefinedPixelTrait;
             break;
           }
         }
@@ -10263,12 +10254,12 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
     *image_info;
 
   static char
-    filename[MaxTextExtent] = "\0";
+    filename[MagickPathExtent] = "\0";
 
   /*
     Request file name from user.
   */
-  if (command == MagickFalse)
+  if (IfMagickFalse(command) )
     XFileBrowserWidget(display,windows,"Open",filename);
   else
     {
@@ -10290,13 +10281,13 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
       status=XGetCommand(display,windows->image.id,&files,&count);
       if (status == 0)
         {
-          ThrowXWindowFatalException(XServerError,"UnableToGetProperty","...");
+          ThrowXWindowException(XServerError,"UnableToGetProperty","...");
           return((Image *) NULL);
         }
       filelist=(char **) AcquireQuantumMemory((size_t) count,sizeof(*filelist));
       if (filelist == (char **) NULL)
         {
-          ThrowXWindowFatalException(ResourceLimitError,
+          ThrowXWindowException(ResourceLimitError,
             "MemoryAllocationFailed","...");
           (void) XFreeStringList(files);
           return((Image *) NULL);
@@ -10316,18 +10307,18 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
   image_info=CloneImageInfo(resource_info->image_info);
   (void) SetImageInfoProgressMonitor(image_info,(MagickProgressMonitor) NULL,
     (void *) NULL);
-  (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+  (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
   exception=AcquireExceptionInfo();
   (void) SetImageInfo(image_info,0,exception);
   if (LocaleCompare(image_info->magick,"X") == 0)
     {
       char
-        seconds[MaxTextExtent];
+        seconds[MagickPathExtent];
 
       /*
         User may want to delay the X server screen grab.
       */
-      (void) CopyMagickString(seconds,"0",MaxTextExtent);
+      (void) CopyMagickString(seconds,"0",MagickPathExtent);
       (void) XDialogWidget(display,windows,"Grab","Enter any delay in seconds:",
         seconds);
       if (*seconds == '\0')
@@ -10336,17 +10327,17 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
     }
   magick_info=GetMagickInfo(image_info->magick,exception);
   if ((magick_info != (const MagickInfo *) NULL) &&
-      (magick_info->raw != MagickFalse))
+      GetMagickRawSupport(magick_info) == MagickTrue)
     {
       char
-        geometry[MaxTextExtent];
+        geometry[MagickPathExtent];
 
       /*
         Request image size from the user.
       */
-      (void) CopyMagickString(geometry,"512x512",MaxTextExtent);
+      (void) CopyMagickString(geometry,"512x512",MagickPathExtent);
       if (image_info->size != (char *) NULL)
-        (void) CopyMagickString(geometry,image_info->size,MaxTextExtent);
+        (void) CopyMagickString(geometry,image_info->size,MagickPathExtent);
       (void) XDialogWidget(display,windows,"Load","Enter the image geometry:",
         geometry);
       (void) CloneString(&image_info->size,geometry);
@@ -10356,7 +10347,7 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
   */
   XSetCursorState(display,windows,MagickTrue);
   XCheckRefreshWindows(display,windows);
-  (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+  (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
   nexus=ReadImage(image_info,exception);
   CatchException(exception);
   XSetCursorState(display,windows,MagickFalse);
@@ -10372,19 +10363,19 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
       /*
         Unknown image format.
       */
-      text=FileToString(filename,~0,exception);
+      text=FileToString(filename,~0UL,exception);
       if (text == (char *) NULL)
         return((Image *) NULL);
       textlist=StringToList(text);
       if (textlist != (char **) NULL)
         {
           char
-            title[MaxTextExtent];
+            title[MagickPathExtent];
 
           register int
             i;
 
-          (void) FormatLocaleString(title,MaxTextExtent,
+          (void) FormatLocaleString(title,MagickPathExtent,
             "Unknown format: %s",filename);
           XTextViewWidget(display,resource_info,windows,MagickTrue,title,
             (const char **) textlist);
@@ -10434,12 +10425,12 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event,
   ExceptionInfo *exception)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
 
-  MagickRealType
+  double
     x_factor,
     y_factor;
 
@@ -10467,8 +10458,8 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event,
   /*
     Pan image as pointer moves until the mouse button is released.
   */
-  x_factor=(MagickRealType) windows->image.ximage->width/windows->pan.width;
-  y_factor=(MagickRealType) windows->image.ximage->height/windows->pan.height;
+  x_factor=(double) windows->image.ximage->width/windows->pan.width;
+  y_factor=(double) windows->image.ximage->height/windows->pan.height;
   pan_info.width=windows->pan.width*windows->image.width/
     windows->image.ximage->width;
   pan_info.height=windows->pan.height*windows->image.height/
@@ -10544,7 +10535,7 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event,
             */
             windows->image.x=(int) pan_info.x;
             windows->image.y=(int) pan_info.y;
-            (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
+            (void) FormatLocaleString(text,MagickPathExtent," %ux%u%+d%+d ",
               windows->image.width,windows->image.height,windows->image.x,
               windows->image.y);
             XInfoWidget(display,windows,text);
@@ -10629,7 +10620,7 @@ static MagickBooleanType XPasteImage(Display *display,
     compose = CopyCompositeOp;
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -10643,7 +10634,7 @@ static MagickBooleanType XPasteImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     scale_factor;
 
   RectangleInfo
@@ -10691,12 +10682,12 @@ static MagickBooleanType XPasteImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
           (long) paste_info.x,(long) paste_info.y);
         XInfoWidget(display,windows,text);
       }
@@ -10724,7 +10715,7 @@ static MagickBooleanType XPasteImage(Display *display,
           case PasteOperatorsCommand:
           {
             char
-              command[MaxTextExtent],
+              command[MagickPathExtent],
               **operators;
 
             /*
@@ -10765,7 +10756,7 @@ static MagickBooleanType XPasteImage(Display *display,
     {
       case ButtonPress:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -10783,9 +10774,9 @@ static MagickBooleanType XPasteImage(Display *display,
         if (windows->image.crop_geometry != (char *) NULL)
           (void) XParseGeometry(windows->image.crop_geometry,&x,&y,
             &width,&height);
-        scale_factor=(MagickRealType) windows->image.ximage->width/width;
+        scale_factor=(double) windows->image.ximage->width/width;
         paste_info.width=(unsigned int) (scale_factor*paste_image->columns+0.5);
-        scale_factor=(MagickRealType) windows->image.ximage->height/height;
+        scale_factor=(double) windows->image.ximage->height/height;
         paste_info.height=(unsigned int) (scale_factor*paste_image->rows+0.5);
         (void) XCheckDefineCursor(display,windows->image.id,cursor);
         paste_info.x=(ssize_t) windows->image.x+event.xbutton.x;
@@ -10794,7 +10785,7 @@ static MagickBooleanType XPasteImage(Display *display,
       }
       case ButtonRelease:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -10818,7 +10809,7 @@ static MagickBooleanType XPasteImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -10834,7 +10825,7 @@ static MagickBooleanType XPasteImage(Display *display,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: 0x%lx (%s)",(long) key_symbol,command);
         switch ((int) key_symbol)
@@ -10876,7 +10867,7 @@ static MagickBooleanType XPasteImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -10893,7 +10884,7 @@ static MagickBooleanType XPasteImage(Display *display,
       }
       default:
       {
-        if (image->debug != MagickFalse)
+        if (IfMagickTrue(image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -10918,19 +10909,19 @@ static MagickBooleanType XPasteImage(Display *display,
   y=0;
   if (windows->image.crop_geometry != (char *) NULL)
     (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   paste_info.x+=x;
   paste_info.x=(ssize_t) (scale_factor*paste_info.x+0.5);
   paste_info.width=(unsigned int) (scale_factor*paste_info.width+0.5);
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   paste_info.y+=y;
   paste_info.y=(ssize_t) (scale_factor*paste_info.y*scale_factor+0.5);
   paste_info.height=(unsigned int) (scale_factor*paste_info.height+0.5);
   /*
     Paste image with X Image window.
   */
-  (void) CompositeImage(image,compose,paste_image,paste_info.x,paste_info.y,
-    exception);
+  (void) CompositeImage(image,paste_image,compose,MagickTrue,paste_info.x,
+    paste_info.y,exception);
   paste_image=DestroyImage(paste_image);
   XSetCursorState(display,windows,MagickFalse);
   /*
@@ -10979,8 +10970,8 @@ static MagickBooleanType XPrintImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    filename[MaxTextExtent],
-    geometry[MaxTextExtent];
+    filename[MagickPathExtent],
+    geometry[MagickPathExtent];
 
   Image
     *print_image;
@@ -10995,9 +10986,9 @@ static MagickBooleanType XPrintImage(Display *display,
     Request Postscript page geometry from user.
   */
   image_info=CloneImageInfo(resource_info->image_info);
-  (void) FormatLocaleString(geometry,MaxTextExtent,"Letter");
+  (void) FormatLocaleString(geometry,MagickPathExtent,"Letter");
   if (image_info->page != (char *) NULL)
-    (void) CopyMagickString(geometry,image_info->page,MaxTextExtent);
+    (void) CopyMagickString(geometry,image_info->page,MagickPathExtent);
   XListBrowserWidget(display,windows,&windows->widget,PageSizes,"Select",
     "Select Postscript Page Geometry:",geometry);
   if (*geometry == '\0')
@@ -11011,7 +11002,7 @@ static MagickBooleanType XPrintImage(Display *display,
   print_image=CloneImage(image,0,0,MagickTrue,exception);
   if (print_image == (Image *) NULL)
     return(MagickFalse);
-  (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%dx%d!",
     windows->image.ximage->width,windows->image.ximage->height);
   (void) TransformImage(&print_image,windows->image.crop_geometry,geometry,
     exception);
@@ -11019,7 +11010,7 @@ static MagickBooleanType XPrintImage(Display *display,
     Print image.
   */
   (void) AcquireUniqueFilename(filename);
-  (void) FormatLocaleString(print_image->filename,MaxTextExtent,"print:%s",
+  (void) FormatLocaleString(print_image->filename,MagickPathExtent,"print:%s",
     filename);
   status=WriteImage(image_info,print_image,exception);
   (void) RelinquishUniqueFileResource(filename);
@@ -11275,8 +11266,8 @@ static MagickBooleanType XROIImage(Display *display,
     };
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   CommandType
     command_type;
@@ -11293,7 +11284,7 @@ static MagickBooleanType XROIImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     scale_factor;
 
   MagickProgressMonitor
@@ -11337,12 +11328,12 @@ static MagickBooleanType XROIImage(Display *display,
   state=DefaultState;
   do
   {
-    if (windows->info.mapped != MagickFalse)
+    if (IfMagickTrue(windows->info.mapped) )
       {
         /*
           Display pointer position.
         */
-        (void) FormatLocaleString(text,MaxTextExtent," %+ld%+ld ",
+        (void) FormatLocaleString(text,MagickPathExtent," %+ld%+ld ",
           (long) roi_info.x,(long) roi_info.y);
         XInfoWidget(display,windows,text);
       }
@@ -11447,7 +11438,7 @@ static MagickBooleanType XROIImage(Display *display,
         */
         x=event.xmotion.x;
         y=event.xmotion.y;
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           {
             if ((x < (int) (windows->info.x+windows->info.width)) &&
                 (y < (int) (windows->info.y+windows->info.height)))
@@ -11498,9 +11489,9 @@ static MagickBooleanType XROIImage(Display *display,
           /*
             Display info and draw region of interest rectangle.
           */
-          if (windows->info.mapped == MagickFalse)
+          if (IfMagickFalse(windows->info.mapped) )
             (void) XMapWindow(display,windows->info.id);
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           XInfoWidget(display,windows,text);
@@ -11508,7 +11499,7 @@ static MagickBooleanType XROIImage(Display *display,
             windows->image.highlight_context,&highlight_info);
         }
       else
-        if (windows->info.mapped != MagickFalse)
+        if (IfMagickTrue(windows->info.mapped) )
           (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
       /*
         Wait for next event.
@@ -11588,15 +11579,17 @@ static MagickBooleanType XROIImage(Display *display,
     */
     state=DefaultState;
     command_type=NullCommand;
+    crop_info.x=0;
+    crop_info.y=0;
     (void) XMapWindow(display,windows->info.id);
     do
     {
-      if (windows->info.mapped != MagickFalse)
+      if (IfMagickTrue(windows->info.mapped) )
         {
           /*
             Display pointer position.
           */
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             " %.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           XInfoWidget(display,windows,text);
@@ -11637,11 +11630,11 @@ static MagickBooleanType XROIImage(Display *display,
               if (windows->image.crop_geometry != (char *) NULL)
                 (void) XParseGeometry(windows->image.crop_geometry,&x,&y,
                   &width,&height);
-              scale_factor=(MagickRealType) width/windows->image.ximage->width;
+              scale_factor=(double) width/windows->image.ximage->width;
               crop_info.x+=x;
               crop_info.x=(ssize_t) (scale_factor*crop_info.x+0.5);
               crop_info.width=(unsigned int) (scale_factor*crop_info.width+0.5);
-              scale_factor=(MagickRealType)
+              scale_factor=(double)
                 height/windows->image.ximage->height;
               crop_info.y+=y;
               crop_info.y=(ssize_t) (scale_factor*crop_info.y+0.5);
@@ -11663,8 +11656,8 @@ static MagickBooleanType XROIImage(Display *display,
               (void) XMagickCommand(display,resource_info,windows,
                 SaveToUndoBufferCommand,image,exception);
               windows->image.orphan=MagickFalse;
-              (void) CompositeImage(*image,CopyCompositeOp,roi_image,
-                crop_info.x,crop_info.y,exception);
+              (void) CompositeImage(*image,roi_image,CopyCompositeOp,
+                MagickTrue,crop_info.x,crop_info.y,exception);
               roi_image=DestroyImage(roi_image);
               (void) SetImageProgressMonitor(*image,progress_monitor,
                 (*image)->client_data);
@@ -11697,7 +11690,7 @@ static MagickBooleanType XROIImage(Display *display,
           id=XCommandWidget(display,windows,ApplyMenu,&event);
           if (id >= 0)
             {
-              (void) CopyMagickString(command,ApplyMenu[id],MaxTextExtent);
+              (void) CopyMagickString(command,ApplyMenu[id],MagickPathExtent);
               command_type=ApplyCommands[id];
               if (id < ApplyMenus)
                 {
@@ -11709,7 +11702,7 @@ static MagickBooleanType XROIImage(Display *display,
                   if (entry >= 0)
                     {
                       (void) CopyMagickString(command,Menus[id][entry],
-                        MaxTextExtent);
+                        MagickPathExtent);
                       command_type=Commands[id][entry];
                     }
                 }
@@ -11913,7 +11906,7 @@ static MagickBooleanType XROIImage(Display *display,
           */
           x=event.xmotion.x;
           y=event.xmotion.y;
-          if (windows->info.mapped != MagickFalse)
+          if (IfMagickTrue(windows->info.mapped) )
             {
               if ((x < (int) (windows->info.x+windows->info.width)) &&
                   (y < (int) (windows->info.y+windows->info.height)))
@@ -11939,7 +11932,7 @@ static MagickBooleanType XROIImage(Display *display,
           /*
             Set primary selection.
           */
-          (void) FormatLocaleString(text,MaxTextExtent,
+          (void) FormatLocaleString(text,MagickPathExtent,
             "%.20gx%.20g%+.20g%+.20g",(double) roi_info.width,(double)
             roi_info.height,(double) roi_info.x,(double) roi_info.y);
           request=(&(event.xselectionrequest));
@@ -12048,8 +12041,8 @@ static MagickBooleanType XRotateImage(Display *display,
     pen_id = 0;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Image
     *rotate_image;
@@ -12059,7 +12052,7 @@ static MagickBooleanType XRotateImage(Display *display,
     x,
     y;
 
-  MagickRealType
+  double
     normalized_degrees;
 
   register int
@@ -12153,7 +12146,7 @@ static MagickBooleanType XRotateImage(Display *display,
                 if (pen_number == (MaxNumberPens-2))
                   {
                     static char
-                      color_name[MaxTextExtent] = "gray";
+                      color_name[MagickPathExtent] = "gray";
 
                     /*
                       Select a pen color from a dialog.
@@ -12240,7 +12233,7 @@ static MagickBooleanType XRotateImage(Display *display,
           case KeyPress:
           {
             char
-              command[MaxTextExtent];
+              command[MagickPathExtent];
 
             KeySym
               key_symbol;
@@ -12313,16 +12306,16 @@ static MagickBooleanType XRotateImage(Display *display,
             /*
               Display info and draw rotation line.
             */
-            if (windows->info.mapped == MagickFalse)
+            if (IfMagickFalse(windows->info.mapped) )
               (void) XMapWindow(display,windows->info.id);
-            (void) FormatLocaleString(text,MaxTextExtent," %g",
+            (void) FormatLocaleString(text,MagickPathExtent," %g",
               direction == VerticalRotateCommand ? degrees-90.0 : degrees);
             XInfoWidget(display,windows,text);
             XHighlightLine(display,windows->image.id,
               windows->image.highlight_context,&rotate_info);
           }
         else
-          if (windows->info.mapped != MagickFalse)
+          if (IfMagickTrue(windows->info.mapped) )
             (void) XWithdrawWindow(display,windows->info.id,
               windows->info.screen);
         /*
@@ -12432,7 +12425,7 @@ static MagickBooleanType XRotateImage(Display *display,
           /*
             Rotate 90 degrees.
           */
-          (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+          (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",height,width,(int) (*image)->columns-
             (int) height-y,x);
           break;
@@ -12442,7 +12435,7 @@ static MagickBooleanType XRotateImage(Display *display,
           /*
             Rotate 180 degrees.
           */
-          (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+          (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",width,height,(int) width-x,(int) height-y);
           break;
         }
@@ -12451,13 +12444,13 @@ static MagickBooleanType XRotateImage(Display *display,
           /*
             Rotate 270 degrees.
           */
-          (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+          (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
             "%ux%u%+d%+d",height,width,y,(int) (*image)->rows-(int) width-x);
           break;
         }
       }
     }
-  if (windows->image.orphan != MagickFalse)
+  if (IfMagickTrue(windows->image.orphan) )
     return(MagickTrue);
   if (normalized_degrees != 0.0)
     {
@@ -12529,8 +12522,8 @@ static MagickBooleanType XSaveImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    filename[MaxTextExtent],
-    geometry[MaxTextExtent];
+    filename[MagickPathExtent],
+    geometry[MagickPathExtent];
 
   Image
     *save_image;
@@ -12546,11 +12539,11 @@ static MagickBooleanType XSaveImage(Display *display,
   */
   if (resource_info->write_filename != (char *) NULL)
     (void) CopyMagickString(filename,resource_info->write_filename,
-      MaxTextExtent);
+      MagickPathExtent);
   else
     {
       char
-        path[MaxTextExtent];
+        path[MagickPathExtent];
 
       int
         status;
@@ -12568,7 +12561,7 @@ static MagickBooleanType XSaveImage(Display *display,
   XFileBrowserWidget(display,windows,"Save",filename);
   if (*filename == '\0')
     return(MagickTrue);
-  if (IsPathAccessible(filename) != MagickFalse)
+  if (IfMagickTrue(IsPathAccessible(filename)) )
     {
       int
         status;
@@ -12581,13 +12574,13 @@ static MagickBooleanType XSaveImage(Display *display,
         return(MagickTrue);
     }
   image_info=CloneImageInfo(resource_info->image_info);
-  (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
+  (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
   (void) SetImageInfo(image_info,1,exception);
   if ((LocaleCompare(image_info->magick,"JPEG") == 0) ||
       (LocaleCompare(image_info->magick,"JPG") == 0))
     {
       char
-        quality[MaxTextExtent];
+        quality[MagickPathExtent];
 
       int
         status;
@@ -12595,7 +12588,7 @@ static MagickBooleanType XSaveImage(Display *display,
       /*
         Request JPEG quality from user.
       */
-      (void) FormatLocaleString(quality,MaxTextExtent,"%.20g",(double)
+      (void) FormatLocaleString(quality,MagickPathExtent,"%.20g",(double)
         image->quality);
       status=XDialogWidget(display,windows,"Save","Enter JPEG quality:",
         quality);
@@ -12610,16 +12603,16 @@ static MagickBooleanType XSaveImage(Display *display,
       (LocaleCompare(image_info->magick,"PS2") == 0))
     {
       char
-        geometry[MaxTextExtent];
+        geometry[MagickPathExtent];
 
       /*
         Request page geometry from user.
       */
-      (void) CopyMagickString(geometry,PSPageGeometry,MaxTextExtent);
+      (void) CopyMagickString(geometry,PSPageGeometry,MagickPathExtent);
       if (LocaleCompare(image_info->magick,"PDF") == 0)
-        (void) CopyMagickString(geometry,PSPageGeometry,MaxTextExtent);
+        (void) CopyMagickString(geometry,PSPageGeometry,MagickPathExtent);
       if (image_info->page != (char *) NULL)
-        (void) CopyMagickString(geometry,image_info->page,MaxTextExtent);
+        (void) CopyMagickString(geometry,image_info->page,MagickPathExtent);
       XListBrowserWidget(display,windows,&windows->widget,PageSizes,"Select",
         "Select page geometry:",geometry);
       if (*geometry != '\0')
@@ -12633,16 +12626,16 @@ static MagickBooleanType XSaveImage(Display *display,
   save_image=CloneImage(image,0,0,MagickTrue,exception);
   if (save_image == (Image *) NULL)
     return(MagickFalse);
-  (void) FormatLocaleString(geometry,MaxTextExtent,"%dx%d!",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%dx%d!",
     windows->image.ximage->width,windows->image.ximage->height);
   (void) TransformImage(&save_image,windows->image.crop_geometry,geometry,
     exception);
   /*
     Write image.
   */
-  (void) CopyMagickString(save_image->filename,filename,MaxTextExtent);
+  (void) CopyMagickString(save_image->filename,filename,MagickPathExtent);
   status=WriteImage(image_info,save_image,exception);
-  if (status != MagickFalse)
+  if (IfMagickTrue(status) )
     image->taint=MagickFalse;
   save_image=DestroyImage(save_image);
   image_info=DestroyImageInfo(image_info);
@@ -12757,7 +12750,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
              if (y >= (int) windows->image.height)
                y=(int) (windows->image.height-1);
             windows->magnify.y=windows->image.y+y;
-            if (windows->magnify.mapped == MagickFalse)
+            if (IfMagickFalse(windows->magnify.mapped) )
               (void) XMapRaised(display,windows->magnify.id);
             XMakeMagnifyImage(display,windows,exception);
             if (event->type == ButtonRelease)
@@ -12796,7 +12789,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
           */
           windows->magnify.width=(unsigned int) event->xconfigure.width;
           windows->magnify.height=(unsigned int) event->xconfigure.height;
-          if (windows->magnify.mapped == MagickFalse)
+          if (IfMagickFalse(windows->magnify.mapped) )
             break;
           magnify=1;
           while ((int) magnify <= event->xconfigure.width)
@@ -12846,7 +12839,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
     case KeyPress:
     {
       char
-        command[MaxTextExtent];
+        command[MagickPathExtent];
 
       KeySym
         key_symbol;
@@ -12881,7 +12874,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
     {
       while (XCheckMaskEvent(display,ButtonMotionMask,event)) ;
       if (event->xmotion.window == windows->image.id)
-        if (windows->magnify.mapped != MagickFalse)
+        if (IfMagickTrue(windows->magnify.mapped) )
           {
             /*
               Update magnified image.
@@ -12959,25 +12952,25 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
   RectangleInfo *crop_info,Image *image)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   int
     x,
     y;
 
-  MagickRealType
+  double
     scale_factor;
 
   unsigned int
     height,
     width;
 
-  if (windows->info.mapped != MagickFalse)
+  if (IfMagickTrue(windows->info.mapped) )
     {
       /*
         Display info on cropping rectangle.
       */
-      (void) FormatLocaleString(text,MaxTextExtent," %.20gx%.20g%+.20g%+.20g",
+      (void) FormatLocaleString(text,MagickPathExtent," %.20gx%.20g%+.20g%+.20g",
         (double) crop_info->width,(double) crop_info->height,(double)
         crop_info->x,(double) crop_info->y);
       XInfoWidget(display,windows,text);
@@ -12996,19 +12989,19 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
   /*
     Define the crop geometry string from the cropping rectangle.
   */
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   if (crop_info->x > 0)
     x+=(int) (scale_factor*crop_info->x+0.5);
   width=(unsigned int) (scale_factor*crop_info->width+0.5);
   if (width == 0)
     width=1;
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   if (crop_info->y > 0)
     y+=(int) (scale_factor*crop_info->y+0.5);
   height=(unsigned int) (scale_factor*crop_info->height+0.5);
   if (height == 0)
     height=1;
-  (void) FormatLocaleString(windows->image.crop_geometry,MaxTextExtent,
+  (void) FormatLocaleString(windows->image.crop_geometry,MagickPathExtent,
     "%ux%u%+d%+d",width,height,x,y);
 }
 \f
@@ -13076,8 +13069,8 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
     };
 
   char
-    command[MaxTextExtent],
-    filename[MaxTextExtent];
+    command[MagickPathExtent],
+    filename[MagickPathExtent];
 
   Image
     *tile_image;
@@ -13089,7 +13082,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
     x,
     y;
 
-  MagickRealType
+  double
     scale_factor;
 
   register char
@@ -13112,10 +13105,10 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
   height=(unsigned int) image->rows;
   if (windows->image.crop_geometry != (char *) NULL)
     (void) XParseGeometry(windows->image.crop_geometry,&x,&y,&width,&height);
-  scale_factor=(MagickRealType) width/windows->image.ximage->width;
+  scale_factor=(double) width/windows->image.ximage->width;
   event->xbutton.x+=windows->image.x;
   event->xbutton.x=(int) (scale_factor*event->xbutton.x+x+0.5);
-  scale_factor=(MagickRealType) height/windows->image.ximage->height;
+  scale_factor=(double) height/windows->image.ximage->height;
   event->xbutton.y+=windows->image.y;
   event->xbutton.y=(int) (scale_factor*event->xbutton.y+y+0.5);
   /*
@@ -13179,9 +13172,9 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
       */
       XCheckRefreshWindows(display,windows);
       (void) CopyMagickString(resource_info->image_info->magick,"MIFF",
-        MaxTextExtent);
+        MagickPathExtent);
       (void) CopyMagickString(resource_info->image_info->filename,filename,
-        MaxTextExtent);
+        MagickPathExtent);
       tile_image=ReadImage(resource_info->image_info,exception);
       CatchException(exception);
       (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
@@ -13210,7 +13203,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
       /*
         Delete tile image.
       */
-      if (IsPathAccessible(filename) == MagickFalse)
+      if (IfMagickFalse(IsPathAccessible(filename)) )
         {
           XNoticeWidget(display,windows,"Image file does not exist:",filename);
           break;
@@ -13218,8 +13211,8 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
       status=XConfirmWidget(display,windows,"Really delete tile",filename);
       if (status <= 0)
         break;
-      status=remove_utf8(filename) != 0 ? MagickTrue : MagickFalse;
-      if (status != MagickFalse)
+      status=ShredFile(filename);
+      if (IfMagickTrue(status) )
         {
           XNoticeWidget(display,windows,"Unable to delete image file:",
             filename);
@@ -13256,7 +13249,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
           q++;
         (void) CopyMagickString(filename,p,(size_t) (q-p+1));
         p=q;
-        if (IsPathAccessible(filename) != MagickFalse)
+        if (IfMagickTrue(IsPathAccessible(filename)) )
           {
             tile++;
             continue;
@@ -13266,7 +13259,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
         */
         x_offset=(int) (width*(tile % (((int) image->columns-x)/width))+x);
         y_offset=(int) (height*(tile/(((int) image->columns-x)/width))+y);
-        image_view=AcquireCacheView(image);
+        image_view=AcquireAuthenticCacheView(image,exception);
         (void) GetOneCacheViewVirtualPixelInfo(image_view,0,0,&pixel,exception);
         for (i=0; i < (int) height; i++)
         {
@@ -13276,10 +13269,10 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
             break;
           for (j=0; j < (int) width; j++)
           {
-            SetPixelInfoPixel(image,&pixel,s);
+            SetPixelViaPixelInfo(image,&pixel,s);
             s+=GetPixelChannels(image);
           }
-          if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+          if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
             break;
         }
         image_view=DestroyCacheView(image_view);
@@ -13310,7 +13303,7 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 %  XTranslateImage() translates the image within an Image window by one pixel
-%  as specified by the key symbol.  If the image has a `montage string the
+%  as specified by the key symbol.  If the image has a montage string the
 %  translation is respect to the width and height contained within the string.
 %
 %  The format of the XTranslateImage method is:
@@ -13335,7 +13328,7 @@ static void XTranslateImage(Display *display,XWindows *windows,
   Image *image,const KeySym key_symbol)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   int
     x,
@@ -13408,7 +13401,7 @@ static void XTranslateImage(Display *display,XWindows *windows,
   /*
     Refresh Image window.
   */
-  (void) FormatLocaleString(text,MaxTextExtent," %ux%u%+d%+d ",
+  (void) FormatLocaleString(text,MagickPathExtent," %ux%u%+d%+d ",
     windows->image.width,windows->image.height,windows->image.x,
     windows->image.y);
   XInfoWidget(display,windows,text);
@@ -13625,8 +13618,8 @@ static Image *XVisualDirectoryImage(Display *display,
     i;
 
   static char
-    filename[MaxTextExtent] = "\0",
-    filenames[MaxTextExtent] = "*";
+    filename[MagickPathExtent] = "\0",
+    filenames[MagickPathExtent] = "*";
 
   XResourceInfo
     background_resources;
@@ -13643,19 +13636,19 @@ static Image *XVisualDirectoryImage(Display *display,
   filelist=(char **) AcquireMagickMemory(sizeof(*filelist));
   if (filelist == (char **) NULL)
     {
-      ThrowXWindowFatalException(ResourceLimitError,"MemoryAllocationFailed",
+      ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed",
         filenames);
       return((Image *) NULL);
     }
   number_files=1;
   filelist[0]=filenames;
   status=ExpandFilenames(&number_files,&filelist);
-  if ((status == MagickFalse) || (number_files == 0))
+  if (IfMagickFalse(status) || (number_files == 0))
     {
       if (number_files == 0)
-        ThrowXWindowFatalException(ImageError,"NoImagesWereFound",filenames)
+        ThrowXWindowException(ImageError,"NoImagesWereFound",filenames)
       else
-        ThrowXWindowFatalException(ResourceLimitError,"MemoryAllocationFailed",
+        ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed",
           filenames);
       return((Image *) NULL);
     }
@@ -13664,14 +13657,14 @@ static Image *XVisualDirectoryImage(Display *display,
   */
   background_resources=(*resource_info);
   background_resources.window_id=AcquireString("");
-  (void) FormatLocaleString(background_resources.window_id,MaxTextExtent,
+  (void) FormatLocaleString(background_resources.window_id,MagickPathExtent,
     "0x%lx",windows->image.id);
   background_resources.backdrop=MagickTrue;
   /*
     Read each image and convert them to a tile.
   */
-  backdrop=(windows->visual_info->klass == TrueColor) ||
-    (windows->visual_info->klass == DirectColor) ? MagickTrue : MagickFalse;
+  backdrop=((windows->visual_info->klass == TrueColor) ||
+    (windows->visual_info->klass == DirectColor)) ? MagickTrue : MagickFalse;
   read_info=CloneImageInfo(resource_info->image_info);
   (void) SetImageOption(read_info,"jpeg:size","120x120");
   (void) CloneString(&read_info->size,DefaultTileGeometry);
@@ -13682,7 +13675,7 @@ static Image *XVisualDirectoryImage(Display *display,
   XCheckRefreshWindows(display,windows);
   for (i=0; i < (int) number_files; i++)
   {
-    (void) CopyMagickString(read_info->filename,filelist[i],MaxTextExtent);
+    (void) CopyMagickString(read_info->filename,filelist[i],MagickPathExtent);
     filelist[i]=DestroyString(filelist[i]);
     *read_info->magick='\0';
     next_image=ReadImage(read_info,exception);
@@ -13715,7 +13708,7 @@ static Image *XVisualDirectoryImage(Display *display,
 
             proceed=SetImageProgress(images,LoadImageTag,(MagickOffsetType) i,
               (MagickSizeType) number_files);
-            if (proceed == MagickFalse)
+            if (IfMagickFalse(proceed) )
               break;
           }
       }
@@ -13725,7 +13718,7 @@ static Image *XVisualDirectoryImage(Display *display,
     {
       read_info=DestroyImageInfo(read_info);
       XSetCursorState(display,windows,MagickFalse);
-      ThrowXWindowFatalException(ImageError,"NoImagesWereLoaded",filenames);
+      ThrowXWindowException(ImageError,"NoImagesWereLoaded",filenames);
       return((Image *) NULL);
     }
   /*
@@ -13735,7 +13728,7 @@ static Image *XVisualDirectoryImage(Display *display,
   montage_info->pointsize=10;
   if (resource_info->font != (char *) NULL)
     (void) CloneString(&montage_info->font,resource_info->font);
-  (void) CopyMagickString(montage_info->filename,filename,MaxTextExtent);
+  (void) CopyMagickString(montage_info->filename,filename,MagickPathExtent);
   montage_image=MontageImageList(read_info,montage_info,GetFirstImageInList(
     images),exception);
   images=DestroyImageList(images);
@@ -13783,8 +13776,8 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   XResourceInfo *resource_info,Image *image,ExceptionInfo *exception)
 {
   char
-    geometry[MaxTextExtent],
-    visual_type[MaxTextExtent];
+    geometry[MagickPathExtent],
+    visual_type[MagickPathExtent];
 
   int
     height,
@@ -13825,8 +13818,8 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
     Determine target window.
   */
   assert(image != (Image *) NULL);
-  assert(image->signature == MagickSignature);
-  if (image->debug != MagickFalse)
+  assert(image->signature == MagickCoreSignature);
+  if (IfMagickTrue(image->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   resources=(*resource_info);
   window_info.id=(Window) NULL;
@@ -13835,7 +13828,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
     window_info.id=root_window;
   else
     {
-      if (isdigit((unsigned char) *resources.window_id) != 0)
+      if (isdigit((int) ((unsigned char) *resources.window_id)) != 0)
         window_info.id=XWindowByID(display,root_window,
           (Window) strtol((char *) resources.window_id,(char **) NULL,0));
       if (window_info.id == (Window) NULL)
@@ -13843,7 +13836,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
     }
   if (window_info.id == (Window) NULL)
     {
-      ThrowXWindowFatalException(XServerError,"NoWindowWithSpecifiedIDExists",
+      ThrowXWindowException(XServerError,"NoWindowWithSpecifiedIDExists",
         resources.window_id);
       return(MagickFalse);
     }
@@ -13852,10 +13845,10 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   */
   window_attributes.width=XDisplayWidth(display,XDefaultScreen(display));
   window_attributes.height=XDisplayHeight(display,XDefaultScreen(display));
-  (void) CopyMagickString(visual_type,"default",MaxTextExtent);
+  (void) CopyMagickString(visual_type,"default",MagickPathExtent);
   status=XGetWindowAttributes(display,window_info.id,&window_attributes);
   if (status != 0)
-    (void) FormatLocaleString(visual_type,MaxTextExtent,"0x%lx",
+    (void) FormatLocaleString(visual_type,MagickPathExtent,"0x%lx",
       XVisualIDFromVisual(window_attributes.visual));
   if (visual_info == (XVisualInfo *) NULL)
     {
@@ -13922,7 +13915,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
       (image->rows != window_info.height))
     ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
       image->filename);
-  (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>",
     window_attributes.width,window_attributes.height);
   geometry_info.width=window_info.width;
   geometry_info.height=window_info.height;
@@ -13936,12 +13929,12 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   window_info.y=(int) geometry_info.y;
   status=XMakeImage(display,&resources,&window_info,image,window_info.width,
     window_info.height,exception);
-  if (status == MagickFalse)
+  if (IfMagickFalse(status) )
     ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
       image->filename);
   window_info.x=0;
   window_info.y=0;
-  if (image->debug != MagickFalse)
+  if (IfMagickTrue(image->debug) )
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
         "Image: %s[%.20g] %.20gx%.20g ",image->filename,(double) image->scene,
@@ -13956,7 +13949,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   */
   width=(int) window_info.width;
   height=(int) window_info.height;
-  if (resources.backdrop != MagickFalse)
+  if (IfMagickTrue(resources.backdrop) )
     {
       /*
         Center image on window.
@@ -13972,7 +13965,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
       (*resources.image_geometry != '\0'))
     {
       char
-        default_geometry[MaxTextExtent];
+        default_geometry[MagickPathExtent];
 
       int
         flags,
@@ -13989,7 +13982,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
         ThrowXWindowFatalException(ResourceLimitFatalError,
           "MemoryAllocationFailed",image->filename);
       size_hints->flags=0L;
-      (void) FormatLocaleString(default_geometry,MaxTextExtent,"%dx%d",
+      (void) FormatLocaleString(default_geometry,MagickPathExtent,"%dx%d",
         width,height);
       flags=XWMGeometry(display,visual_info->screen,resources.image_geometry,
         default_geometry,window_info.border_width,size_hints,&window_info.x,
@@ -14421,10 +14414,10 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     };
 
   char
-    command[MaxTextExtent],
+    command[MagickPathExtent],
     *directory,
-    geometry[MaxTextExtent],
-    resource_name[MaxTextExtent];
+    geometry[MagickPathExtent],
+    resource_name[MagickPathExtent];
 
   CommandType
     command_type;
@@ -14451,7 +14444,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     i;
 
   static char
-    working_directory[MaxTextExtent];
+    working_directory[MagickPathExtent];
 
   static XPoint
     vid_info;
@@ -14520,8 +14513,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     *manager_hints;
 
   assert(image != (Image **) NULL);
-  assert((*image)->signature == MagickSignature);
-  if ((*image)->debug != MagickFalse)
+  assert((*image)->signature == MagickCoreSignature);
+  if (IfMagickTrue((*image)->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
   display_image=(*image);
   warning_handler=(WarningHandler) NULL;
@@ -14531,6 +14524,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       int
         status;
 
+      if (*working_directory == '\0')
+        (void) CopyMagickString(working_directory,".",MagickPathExtent);
       status=chdir(working_directory);
       if (status == -1)
         (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -14592,7 +14587,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints=windows->manager_hints;
   root_window=XRootWindow(display,visual_info->screen);
   nexus=NewImageList();
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     {
       (void) LogMagickEvent(X11Event,GetMagickModule(),
         "Image: %s[%.20g] %.20gx%.20g ",display_image->filename,
@@ -14621,7 +14616,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->initial_state=WithdrawnState;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->context);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (context)",windows->context.id);
   context_values.background=pixel->background_color.pixel;
@@ -14672,7 +14667,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->initial_state=IconicState;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->icon);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (icon)",
       windows->icon.id);
   /*
@@ -14694,7 +14689,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   XGetWindowInfo(display,visual_info,map_info,pixel,font_info,resource_info,
     &windows->image);
   windows->image.shape=MagickTrue;  /* non-rectangular shape hint */
-  if (resource_info->use_shared_memory == MagickFalse)
+  if (IfMagickFalse(resource_info->use_shared_memory) )
     windows->image.shared_memory=MagickFalse;
   if ((resource_info->title != (char *) NULL) && !(*state & MontageImageState))
     {
@@ -14703,34 +14698,34 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
 
       title=InterpretImageProperties(resource_info->image_info,display_image,
         resource_info->title,exception);
-      (void) CopyMagickString(windows->image.name,title,MaxTextExtent);
-      (void) CopyMagickString(windows->image.icon_name,title,MaxTextExtent);
+      (void) CopyMagickString(windows->image.name,title,MagickPathExtent);
+      (void) CopyMagickString(windows->image.icon_name,title,MagickPathExtent);
       title=DestroyString(title);
     }
   else
     {
       char
-        filename[MaxTextExtent];
+        filename[MagickPathExtent];
 
       /*
         Window name is the base of the filename.
       */
       GetPathComponent(display_image->magick_filename,TailPath,filename);
       if (display_image->scene == 0)
-        (void) FormatLocaleString(windows->image.name,MaxTextExtent,
+        (void) FormatLocaleString(windows->image.name,MagickPathExtent,
           "%s: %s",MagickPackageName,filename);
       else
-        (void) FormatLocaleString(windows->image.name,MaxTextExtent,
+        (void) FormatLocaleString(windows->image.name,MagickPathExtent,
           "%s: %s[scene: %.20g frames: %.20g]",MagickPackageName,filename,
           (double) display_image->scene,(double) GetImageListLength(
           display_image));
-      (void) CopyMagickString(windows->image.icon_name,filename,MaxTextExtent);
+      (void) CopyMagickString(windows->image.icon_name,filename,MagickPathExtent);
     }
   if (resource_info->immutable)
     windows->image.immutable=MagickTrue;
   windows->image.use_pixmap=resource_info->use_pixmap;
   windows->image.geometry=resource_info->image_geometry;
-  (void) FormatLocaleString(geometry,MaxTextExtent,"%ux%u+0+0>!",
+  (void) FormatLocaleString(geometry,MagickPathExtent,"%ux%u+0+0>!",
     XDisplayWidth(display,visual_info->screen),
     XDisplayHeight(display,visual_info->screen));
   geometry_info.width=display_image->columns;
@@ -14773,7 +14768,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         NormalState;
       XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
         &windows->backdrop);
-      if (display_image->debug != MagickFalse)
+      if (IfMagickTrue(display_image->debug) )
         (void) LogMagickEvent(X11Event,GetMagickModule(),
           "Window id: 0x%lx (backdrop)",windows->backdrop.id);
       (void) XMapWindow(display,windows->backdrop.id);
@@ -14805,7 +14800,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       manager_hints->flags|=WindowGroupHint;
       manager_hints->window_group=windows->group_leader.id;
       (void) XSelectInput(display,windows->group_leader.id,StructureNotifyMask);
-      if (display_image->debug != MagickFalse)
+      if (IfMagickTrue(display_image->debug) )
         (void) LogMagickEvent(X11Event,GetMagickModule(),
           "Window id: 0x%lx (group leader)",windows->group_leader.id);
     }
@@ -14817,7 +14812,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   if (windows->group_leader.id != (Window) NULL)
     (void) XSetTransientForHint(display,windows->image.id,
       windows->group_leader.id);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (image)",
       windows->image.id);
   /*
@@ -14845,9 +14840,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->info.shadow_stipple=XCreateBitmapFromData(display,
     windows->info.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->info.id,windows->image.id);
-  if (windows->image.mapped != MagickFalse)
+  if (IfMagickTrue(windows->image.mapped) )
     (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (info)",
       windows->info.id);
   /*
@@ -14857,7 +14852,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     resource_info,&windows->command);
   windows->command.data=MagickMenus;
   (void) XCommandWidget(display,windows,CommandMenu,(XEvent *) NULL);
-  (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.command",
+  (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.command",
     resource_info->client_name);
   windows->command.geometry=XGetResourceClass(resource_info->resource_database,
     resource_name,"geometry",(char *) NULL);
@@ -14879,9 +14874,9 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->command.shadow_stipple=XCreateBitmapFromData(display,
     windows->command.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->command.id,windows->image.id);
-  if (windows->command.mapped != MagickFalse)
+  if (IfMagickTrue(windows->command.mapped) )
     (void) XMapRaised(display,windows->command.id);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (command)",windows->command.id);
   /*
@@ -14889,7 +14884,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   */
   XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
     resource_info,&windows->widget);
-  (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.widget",
+  (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.widget",
     resource_info->client_name);
   windows->widget.geometry=XGetResourceClass(resource_info->resource_database,
     resource_name,"geometry",(char *) NULL);
@@ -14910,7 +14905,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->widget.shadow_stipple=XCreateBitmapFromData(display,
     windows->widget.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->widget.id,windows->image.id);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (widget)",windows->widget.id);
   /*
@@ -14934,7 +14929,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   windows->popup.shadow_stipple=XCreateBitmapFromData(display,
     windows->popup.id,(char *) ShadowBitmap,ShadowWidth,ShadowHeight);
   (void) XSetTransientForHint(display,windows->popup.id,windows->image.id);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (pop up)",windows->popup.id);
   /*
@@ -14942,13 +14937,13 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   */
   XGetWindowInfo(display,visual_info,map_info,pixel,font_info,
     resource_info,&windows->magnify);
-  if (resource_info->use_shared_memory == MagickFalse)
+  if (IfMagickFalse(resource_info->use_shared_memory) )
     windows->magnify.shared_memory=MagickFalse;
-  (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.magnify",
+  (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.magnify",
     resource_info->client_name);
   windows->magnify.geometry=XGetResourceClass(resource_info->resource_database,
     resource_name,"geometry",(char *) NULL);
-  (void) FormatLocaleString(windows->magnify.name,MaxTextExtent,"Magnify %uX",
+  (void) FormatLocaleString(windows->magnify.name,MagickPathExtent,"Magnify %uX",
     resource_info->magnify);
   if (windows->magnify.cursor != (Cursor) NULL)
     (void) XFreeCursor(display,windows->magnify.cursor);
@@ -14976,7 +14971,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->window_group=windows->image.id;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->magnify);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),
       "Window id: 0x%lx (magnify)",windows->magnify.id);
   (void) XSetTransientForHint(display,windows->magnify.id,windows->image.id);
@@ -14988,7 +14983,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   (void) CloneString(&windows->pan.name,"Pan Icon");
   windows->pan.width=windows->icon.width;
   windows->pan.height=windows->icon.height;
-  (void) FormatLocaleString(resource_name,MaxTextExtent,"%s.pan",
+  (void) FormatLocaleString(resource_name,MagickPathExtent,"%s.pan",
     resource_info->client_name);
   windows->pan.geometry=XGetResourceClass(resource_info->resource_database,
     resource_name,"geometry",(char *) NULL);
@@ -15005,13 +15000,13 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   manager_hints->window_group=windows->image.id;
   XMakeWindow(display,root_window,argv,argc,class_hints,manager_hints,
     &windows->pan);
-  if (display_image->debug != MagickFalse)
+  if (IfMagickTrue(display_image->debug) )
     (void) LogMagickEvent(X11Event,GetMagickModule(),"Window id: 0x%lx (pan)",
       windows->pan.id);
   (void) XSetTransientForHint(display,windows->pan.id,windows->image.id);
-  if (windows->info.mapped != MagickFalse)
+  if (IfMagickTrue(windows->info.mapped) )
     (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
-  if ((windows->image.mapped == MagickFalse) ||
+  if (IfMagickFalse(windows->image.mapped) ||
       (windows->backdrop.id != (Window) NULL))
     (void) XMapWindow(display,windows->image.id);
   /*
@@ -15037,17 +15032,17 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       display_image->filename);
   status=XMakeImage(display,resource_info,&windows->image,display_image,
     width,height,exception);
-  if (status == MagickFalse)
+  if (IfMagickFalse(status) )
     ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
       display_image->filename);
   status=XMakeImage(display,resource_info,&windows->magnify,(Image *) NULL,
     windows->magnify.width,windows->magnify.height,exception);
-  if (status == MagickFalse)
+  if (IfMagickFalse(status))
     ThrowXWindowFatalException(XServerFatalError,"UnableToCreateXImage",
       display_image->filename);
-  if (windows->magnify.mapped != MagickFalse)
+  if (IfMagickTrue(windows->magnify.mapped) )
     (void) XMapRaised(display,windows->magnify.id);
-  if (windows->pan.mapped != MagickFalse)
+  if (IfMagickTrue(windows->pan.mapped) )
     (void) XMapRaised(display,windows->pan.id);
   windows->image.window_changes.width=(int) display_image->columns;
   windows->image.window_changes.height=(int) display_image->rows;
@@ -15060,7 +15055,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   delay=display_image->delay/MagickMax(display_image->ticks_per_second,1L);
   timer=time((time_t *) NULL)+(delay == 0 ? 1 : delay)+1;
   update_time=0;
-  if (resource_info->update != MagickFalse)
+  if (IfMagickTrue(resource_info->update) )
     {
       MagickBooleanType
         status;
@@ -15069,7 +15064,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         Determine when file data was last modified.
       */
       status=GetPathAttributes(display_image->filename,&attributes);
-      if (status != MagickFalse)
+      if (IfMagickTrue(status) )
         update_time=attributes.st_mtime;
     }
   *state&=(~FormerImageState);
@@ -15080,12 +15075,12 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     /*
       Handle a window event.
     */
-    if (windows->image.mapped != MagickFalse)
+    if (IfMagickTrue(windows->image.mapped) )
       if ((display_image->delay != 0) || (resource_info->update != 0))
         {
           if (timer < time((time_t *) NULL))
             {
-              if (resource_info->update == MagickFalse)
+              if (IfMagickFalse(resource_info->update) )
                 *state|=NextImageState | ExitState;
               else
                 {
@@ -15096,22 +15091,19 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                     Determine if image file was modified.
                   */
                   status=GetPathAttributes(display_image->filename,&attributes);
-                  if (status != MagickFalse)
+                  if (IfMagickTrue(status) )
                     if (update_time != attributes.st_mtime)
                       {
                         /*
                           Redisplay image.
                         */
                         (void) FormatLocaleString(
-                          resource_info->image_info->filename,MaxTextExtent,
+                          resource_info->image_info->filename,MagickPathExtent,
                           "%s:%s",display_image->magick,
                           display_image->filename);
                         nexus=ReadImage(resource_info->image_info,exception);
                         if (nexus != (Image *) NULL)
-                          {
-                            nexus=DestroyImage(nexus);
-                            *state|=NextImageState | ExitState;
-                          }
+                          *state|=NextImageState | ExitState;
                       }
                   delay=display_image->delay/MagickMax(
                     display_image->ticks_per_second,1L);
@@ -15129,12 +15121,15 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         }
     timestamp=time((time_t *) NULL);
     (void) XNextEvent(display,&event);
-    if (windows->image.stasis == MagickFalse)
-      windows->image.stasis=(time((time_t *) NULL)-timestamp) > 0 ?
-        MagickTrue : MagickFalse;
-    if (windows->magnify.stasis == MagickFalse)
-      windows->magnify.stasis=(time((time_t *) NULL)-timestamp) > 0 ?
-        MagickTrue : MagickFalse;
+    if ((windows->image.stasis == MagickFalse) ||
+        (windows->magnify.stasis == MagickFalse))
+      {
+        if ((time((time_t *) NULL)-timestamp) > 0)
+          {
+            windows->image.stasis=MagickTrue;
+            windows->magnify.stasis=MagickTrue;
+          }
+      }
     if (event.xany.window == windows->command.id)
       {
         /*
@@ -15143,7 +15138,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         id=XCommandWidget(display,windows,CommandMenu,&event);
         if (id < 0)
           continue;
-        (void) CopyMagickString(command,CommandMenu[id],MaxTextExtent);
+        (void) CopyMagickString(command,CommandMenu[id],MagickPathExtent);
         command_type=CommandMenus[id];
         if (id < MagickMenus)
           {
@@ -15154,7 +15149,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
               command);
             if (entry < 0)
               continue;
-            (void) CopyMagickString(command,Menus[id][entry],MaxTextExtent);
+            (void) CopyMagickString(command,Menus[id][entry],MagickPathExtent);
             command_type=Commands[id][entry];
           }
         if (command_type != NullCommand)
@@ -15166,7 +15161,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     {
       case ButtonPress:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Press: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -15206,7 +15201,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 /*
                   Map/unmap Command widget.
                 */
-                if (windows->command.mapped != MagickFalse)
+                if (IfMagickTrue(windows->command.mapped) )
                   (void) XWithdrawWindow(display,windows->command.id,
                     windows->command.screen);
                 else
@@ -15361,7 +15356,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ButtonRelease:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Button Release: 0x%lx %u +%d+%d",event.xbutton.window,
             event.xbutton.button,event.xbutton.x,event.xbutton.y);
@@ -15369,7 +15364,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ClientMessage:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Client Message: 0x%lx 0x%lx %d 0x%lx",event.xclient.window,
             event.xclient.message_type,event.xclient.format,(unsigned long)
@@ -15415,7 +15410,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                     (unsigned long) magick_windows[i]->mask,
                     &magick_windows[i]->attributes);
                 }
-                if (windows->pan.mapped != MagickFalse)
+                if (IfMagickTrue(windows->pan.mapped) )
                   {
                     (void) XSetWindowBackgroundPixmap(display,windows->pan.id,
                       windows->pan.pixmap);
@@ -15472,7 +15467,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
               break;
             selection=XInternAtom(display,"DndSelection",MagickFalse);
             status=XGetWindowProperty(display,root_window,selection,0L,(long)
-              MaxTextExtent,MagickFalse,(Atom) AnyPropertyType,&type,&format,
+              MagickPathExtent,MagickFalse,(Atom) AnyPropertyType,&type,&format,
               &length,&after,&data);
             if ((status != Success) || (length == 0))
               break;
@@ -15482,7 +15477,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                   Offix DND.
                 */
                 (void) CopyMagickString(resource_info->image_info->filename,
-                  (char *) data,MaxTextExtent);
+                  (char *) data,MagickPathExtent);
               }
             else
               {
@@ -15495,7 +15490,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                     break;
                   }
                 (void) CopyMagickString(resource_info->image_info->filename,
-                  ((char *) data)+5,MaxTextExtent);
+                  ((char *) data)+5,MagickPathExtent);
               }
             nexus=ReadImage(resource_info->image_info,exception);
             CatchException(exception);
@@ -15532,7 +15527,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ConfigureNotify:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Configure Notify: 0x%lx %dx%d+%d+%d %d",event.xconfigure.window,
             event.xconfigure.width,event.xconfigure.height,event.xconfigure.x,
@@ -15551,7 +15546,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                   Position the transient windows relative of the Image window.
                 */
                 if (windows->command.geometry == (char *) NULL)
-                  if (windows->command.mapped == MagickFalse)
+                  if (IfMagickFalse(windows->command.mapped) )
                     {
                       windows->command.x=event.xconfigure.x-
                         windows->command.width-25;
@@ -15564,7 +15559,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                         &window_changes);
                     }
                 if (windows->widget.geometry == (char *) NULL)
-                  if (windows->widget.mapped == MagickFalse)
+                  if (IfMagickFalse(windows->widget.mapped) )
                     {
                       windows->widget.x=event.xconfigure.x+
                         event.xconfigure.width/10;
@@ -15578,7 +15573,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                         &window_changes);
                     }
                 if (windows->magnify.geometry == (char *) NULL)
-                  if (windows->magnify.mapped == MagickFalse)
+                  if (IfMagickFalse(windows->magnify.mapped) )
                     {
                       windows->magnify.x=event.xconfigure.x+
                         event.xconfigure.width+25;
@@ -15591,7 +15586,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                         &window_changes);
                     }
                 if (windows->pan.geometry == (char *) NULL)
-                  if (windows->pan.mapped == MagickFalse)
+                  if (IfMagickFalse(windows->pan.mapped) )
                     {
                       windows->pan.x=event.xconfigure.x+
                         event.xconfigure.width+25;
@@ -15617,8 +15612,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 windows->image.x=vid_info.x;
                 windows->image.y=vid_info.y;
               }
-            if ((windows->image.mapped != MagickFalse) &&
-                (windows->image.stasis != MagickFalse))
+            if (IfMagickTrue(windows->image.mapped) &&
+                IfMagickTrue(windows->image.stasis) )
               {
                 /*
                   Update image window configuration.
@@ -15638,7 +15633,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                 XDrawPanRectangle(display,windows);
               }
             else
-              if (windows->pan.mapped != MagickFalse)
+              if (IfMagickTrue(windows->pan.mapped) )
                 (void) XWithdrawWindow(display,windows->pan.id,
                   windows->pan.screen);
             break;
@@ -15653,7 +15648,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
             */
             windows->magnify.width=(unsigned int) event.xconfigure.width;
             windows->magnify.height=(unsigned int) event.xconfigure.height;
-            if (windows->magnify.mapped == MagickFalse)
+            if (IfMagickFalse(windows->magnify.mapped) )
               break;
             magnify=1;
             while ((int) magnify <= event.xconfigure.width)
@@ -15671,8 +15666,8 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                   &window_changes);
                 break;
               }
-            if ((windows->magnify.mapped != MagickFalse) &&
-                (windows->magnify.stasis != MagickFalse))
+            if (IfMagickTrue(windows->magnify.mapped) &&
+                IfMagickTrue(windows->magnify.stasis) )
               {
                 status=XMakeImage(display,resource_info,&windows->magnify,
                   display_image,windows->magnify.width,windows->magnify.height,
@@ -15681,7 +15676,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
               }
             break;
           }
-        if ((windows->magnify.mapped != MagickFalse) &&
+        if (IfMagickTrue(windows->magnify.mapped) &&
             (event.xconfigure.window == windows->pan.id))
           {
             /*
@@ -15712,7 +15707,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         /*
           Group leader has exited.
         */
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Destroy Notify: 0x%lx",event.xdestroywindow.window);
         if (event.xdestroywindow.window == windows->group_leader.id)
@@ -15734,7 +15729,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case Expose:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Expose: 0x%lx %dx%d+%d+%d",event.xexpose.window,
             event.xexpose.width,event.xexpose.height,event.xexpose.x,
@@ -15743,7 +15738,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           Refresh windows that are now exposed.
         */
         if ((event.xexpose.window == windows->image.id) &&
-            (windows->image.mapped != MagickFalse))
+            IfMagickTrue(windows->image.mapped) )
           {
             XRefreshWindow(display,&windows->image,&event);
             delay=display_image->delay/MagickMax(
@@ -15752,7 +15747,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
             break;
           }
         if ((event.xexpose.window == windows->magnify.id) &&
-            (windows->magnify.mapped != MagickFalse))
+            IfMagickTrue(windows->magnify.mapped))
           {
             XMakeMagnifyImage(display,windows,exception);
             break;
@@ -15780,7 +15775,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         length=XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
         *(command+length)='\0';
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key press: %d 0x%lx (%s)",event.xkey.state,(unsigned long)
             key_symbol,command);
@@ -15819,7 +15814,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         */
         (void) XLookupString((XKeyEvent *) &event.xkey,command,(int)
           sizeof(command),&key_symbol,(XComposeStatus *) NULL);
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Key release: 0x%lx (%c)",(unsigned long) key_symbol,*command);
         break;
@@ -15836,7 +15831,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case MapNotify:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Map Notify: 0x%lx",
             event.xmap.window);
         if (event.xmap.window == windows->backdrop.id)
@@ -15944,7 +15939,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           after,
           length;
 
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Property Notify: 0x%lx 0x%lx %d",event.xproperty.window,
             event.xproperty.atom,event.xproperty.state);
@@ -15954,7 +15949,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
           Display image named by the remote command protocol.
         */
         status=XGetWindowProperty(display,event.xproperty.window,
-          event.xproperty.atom,0L,(long) MaxTextExtent,MagickFalse,(Atom)
+          event.xproperty.atom,0L,(long) MagickPathExtent,MagickFalse,(Atom)
           AnyPropertyType,&type,&format,&length,&after,&data);
         if ((status != Success) || (length == 0))
           break;
@@ -15966,7 +15961,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
             break;
           }
         (void) CopyMagickString(resource_info->image_info->filename,
-          (char *) data,MaxTextExtent);
+          (char *) data,MagickPathExtent);
         (void) XFree((void *) data);
         nexus=ReadImage(resource_info->image_info,exception);
         CatchException(exception);
@@ -15976,7 +15971,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case ReparentNotify:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Reparent Notify: 0x%lx=>0x%lx",event.xreparent.parent,
             event.xreparent.window);
@@ -15984,7 +15979,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       case UnmapNotify:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),
             "Unmap Notify: 0x%lx",event.xunmap.window);
         if (event.xunmap.window == windows->backdrop.id)
@@ -16047,7 +16042,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       }
       default:
       {
-        if (display_image->debug != MagickFalse)
+        if (IfMagickTrue(display_image->debug) )
           (void) LogMagickEvent(X11Event,GetMagickModule(),"Event type: %d",
             event.type);
         break;
@@ -16058,13 +16053,13 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     (void) XMagickCommand(display,resource_info,windows,FreeBuffersCommand,
       &display_image,exception);
   else
-    if (resource_info->confirm_edit != MagickFalse)
+    if (IfMagickTrue(resource_info->confirm_edit) )
       {
         /*
           Query user if image has changed.
         */
-        if ((resource_info->immutable == MagickFalse) &&
-            (display_image->taint != MagickFalse))
+        if (IfMagickFalse(resource_info->immutable) &&
+            IfMagickTrue(display_image->taint))
           {
             int
               status;
@@ -16086,18 +16081,18 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
       /*
         Withdraw pan and Magnify window.
       */
-      if (windows->info.mapped != MagickFalse)
+      if (IfMagickTrue(windows->info.mapped) )
         (void) XWithdrawWindow(display,windows->info.id,windows->info.screen);
-      if (windows->magnify.mapped != MagickFalse)
+      if (IfMagickTrue(windows->magnify.mapped) )
         (void) XWithdrawWindow(display,windows->magnify.id,
           windows->magnify.screen);
-      if (windows->command.mapped != MagickFalse)
+      if (IfMagickTrue(windows->command.mapped) )
         (void) XWithdrawWindow(display,windows->command.id,
           windows->command.screen);
     }
-  if (windows->pan.mapped != MagickFalse)
+  if (IfMagickTrue(windows->pan.mapped) )
     (void) XWithdrawWindow(display,windows->pan.id,windows->pan.screen);
-  if (resource_info->backdrop == MagickFalse)
+  if (IfMagickFalse(resource_info->backdrop) )
     if (windows->backdrop.mapped)
       {
         (void) XWithdrawWindow(display,windows->backdrop.id,
@@ -16140,12 +16135,14 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
   /*
     Change to home directory.
   */
-  directory=getcwd(working_directory,MaxTextExtent);
+  directory=getcwd(working_directory,MagickPathExtent);
   (void) directory;
   {
     int
       status;
 
+    if (*resource_info->home_directory == '\0')
+      (void) CopyMagickString(resource_info->home_directory,".",MagickPathExtent);
     status=chdir(resource_info->home_directory);
     if (status == -1)
       (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -16189,13 +16186,14 @@ MagickExport MagickBooleanType DisplayImages(const ImageInfo *image_info,
   Image *image,ExceptionInfo *exception)
 {
   assert(image_info != (const ImageInfo *) NULL);
-  assert(image_info->signature == MagickSignature);
+  assert(image_info->signature == MagickCoreSignature);
   assert(image != (Image *) NULL);
-  assert(image->signature == MagickSignature);
-  if (image->debug != MagickFalse)
+  assert(image->signature == MagickCoreSignature);
+  (void) image_info;
+  if (IfMagickTrue(image->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
-    "DelegateLibrarySupportNotBuiltIn","`%s' (X11)",image->filename);
+    "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image->filename);
   return(MagickFalse);
 }
 \f
@@ -16233,12 +16231,12 @@ MagickExport MagickBooleanType RemoteDisplayCommand(const ImageInfo *image_info,
   const char *window,const char *filename,ExceptionInfo *exception)
 {
   assert(image_info != (const ImageInfo *) NULL);
-  assert(image_info->signature == MagickSignature);
+  assert(image_info->signature == MagickCoreSignature);
   assert(filename != (char *) NULL);
   (void) window;
   (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",filename);
   (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
-    "DelegateLibrarySupportNotBuiltIn","`%s' (X11)",image_info->filename);
+    "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
   return(MagickFalse);
 }
 #endif