]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/display.c
Update web pages
[imagemagick] / MagickCore / display.c
index 3f1c55fa31630db496dd39647f40c67f7a76652c..7f3bf7aef64c260471f47bab47f58292f3dc1355 100644 (file)
@@ -1674,9 +1674,9 @@ 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);
+  assert(images->signature == MagickCoreSignature);
   if (IfMagickTrue(images->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
   display=XOpenDisplay(image_info->server_name);
@@ -1754,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);
@@ -1767,7 +1767,7 @@ MagickExport MagickBooleanType RemoteDisplayCommand(const ImageInfo *image_info,
   (void) XSetErrorHandler(XError);
   status=XRemoteCommand(display,window,filename);
   (void) XCloseDisplay(display);
-  return(IsMagickTrue(status));
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -1802,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)
@@ -1867,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];
@@ -1941,7 +1927,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
         /*
           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);
       }
@@ -1985,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.
@@ -2034,7 +2020,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
             if (pen_number == (MaxNumberPens-1))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -2079,7 +2065,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
             if (pen_number == (MaxNumberPens-1))
               {
                 static char
-                  color_name[MaxTextExtent] = "gray";
+                  color_name[MagickPathExtent] = "gray";
 
                 /*
                   Select a pen color from a dialog.
@@ -2106,7 +2092,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display,
               entry;
 
             static char
-              angle[MaxTextExtent] = "30.0";
+              angle[MagickPathExtent] = "30.0";
 
             static const char
               *RotateMenu[] =
@@ -2605,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))
@@ -2729,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);
@@ -2806,7 +2792,7 @@ static MagickBooleanType XBackgroundImage(Display *display,
     status;
 
   static char
-    window_id[MaxTextExtent] = "root";
+    window_id[MagickPathExtent] = "root";
 
   XResourceInfo
     background_resources;
@@ -2825,7 +2811,7 @@ static MagickBooleanType XBackgroundImage(Display *display,
   XCheckRefreshWindows(display,windows);
   background_resources=(*resource_info);
   background_resources.window_id=window_id;
-  background_resources.backdrop=IsMagickTrue(status);
+  background_resources.backdrop=status != 0 ? MagickTrue : MagickFalse;
   status=XDisplayBackgroundImage(display,&background_resources,*image,
     exception);
   if (IfMagickTrue(status))
@@ -2899,7 +2885,7 @@ static MagickBooleanType XChopImage(Display *display,
     };
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Image
     *chop_image;
@@ -2945,6 +2931,7 @@ 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 (IfMagickTrue(windows->info.mapped) )
@@ -2952,7 +2939,7 @@ static MagickBooleanType XChopImage(Display *display,
         /*
           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);
       }
@@ -2973,7 +2960,7 @@ static MagickBooleanType XChopImage(Display *display,
           case ChopDirectionCommand:
           {
             char
-              command[MaxTextExtent];
+              command[MagickPathExtent];
 
             static const char
               *Directions[] =
@@ -3036,7 +3023,7 @@ static MagickBooleanType XChopImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -3124,7 +3111,7 @@ static MagickBooleanType XChopImage(Display *display,
         */
         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);
@@ -3332,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;
@@ -3394,7 +3381,7 @@ static MagickBooleanType XColorEditImage(Display *display,
         /*
           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);
       }
@@ -3459,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.
@@ -3505,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.
@@ -3525,7 +3512,7 @@ static MagickBooleanType XColorEditImage(Display *display,
           case ColorEditFuzzCommand:
           {
             static char
-              fuzz[MaxTextExtent];
+              fuzz[MagickPathExtent];
 
             static const char
               *FuzzMenu[] =
@@ -3552,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;
@@ -3840,7 +3827,7 @@ static MagickBooleanType XColorEditImage(Display *display,
               AllCompliance,&draw_info->fill,exception);
             (void) FloodfillPaintImage(*image,draw_info,&target,
               (ssize_t)x_offset,(ssize_t)y_offset,
-              IsMagickFalse(method == FloodfillMethod),exception);
+              method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
             draw_info=DestroyDrawInfo(draw_info);
             break;
           }
@@ -3921,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[] =
@@ -3949,7 +3936,7 @@ static MagickBooleanType XCompositeImage(Display *display,
     };
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -3993,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);
@@ -4029,7 +4016,7 @@ static MagickBooleanType XCompositeImage(Display *display,
         /*
           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);
       }
@@ -4057,7 +4044,7 @@ static MagickBooleanType XCompositeImage(Display *display,
           case CompositeOperatorsCommand:
           {
             char
-              command[MaxTextExtent],
+              command[MagickPathExtent],
               **operators;
 
             /*
@@ -4077,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.
@@ -4182,7 +4169,7 @@ static MagickBooleanType XCompositeImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -4411,7 +4398,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    geometry[MaxTextExtent];
+    geometry[MagickPathExtent];
 
   MagickStatusType
     status;
@@ -4468,10 +4455,10 @@ static MagickBooleanType XConfigureImage(Display *display,
     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);
@@ -4540,7 +4527,7 @@ static MagickBooleanType XConfigureImage(Display *display,
   (void) XReconfigureWMWindow(display,windows->icon.id,windows->icon.screen,
     (unsigned int) (CWWidth | CWHeight),&window_changes);
   XSetCursorState(display,windows,MagickFalse);
-  return(IsMagickTrue(status));
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -4617,8 +4604,8 @@ static MagickBooleanType XCropImage(Display *display,
     *image_view;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -4700,7 +4687,7 @@ static MagickBooleanType XCropImage(Display *display,
         /*
           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);
       }
@@ -4895,7 +4882,7 @@ static MagickBooleanType XCropImage(Display *display,
           */
           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);
@@ -4988,7 +4975,7 @@ static MagickBooleanType XCropImage(Display *display,
           /*
             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);
@@ -5165,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:
@@ -5274,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));
@@ -5457,8 +5444,8 @@ static MagickBooleanType XDrawEditImage(Display *display,
     line_width = 1;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -5548,7 +5535,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
           /*
             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);
         }
@@ -5630,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.
@@ -5664,7 +5651,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
                 status;
 
               static char
-                filename[MaxTextExtent] = "\0";
+                filename[MagickPathExtent] = "\0";
 
               static const char
                 *StipplesMenu[] =
@@ -5752,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);
@@ -5775,7 +5762,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
             case DrawWidthCommand:
             {
               static char
-                width[MaxTextExtent] = "0";
+                width[MagickPathExtent] = "0";
 
               static const char
                 *WidthsMenu[] =
@@ -5953,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);
@@ -5969,7 +5956,7 @@ 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,
@@ -5989,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);
@@ -6013,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);
@@ -6041,7 +6028,7 @@ 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,
@@ -6285,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);
@@ -6341,7 +6328,7 @@ static MagickBooleanType XDrawEditImage(Display *display,
   }
   XSetCursorState(display,windows,MagickFalse);
   coordinate_info=(XPoint *) RelinquishMagickMemory(coordinate_info);
-  return(IsMagickTrue(status));
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -6468,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.
@@ -6482,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);
@@ -6627,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)
         {
@@ -6727,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";
@@ -7117,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;
@@ -7148,7 +7135,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     i;
 
   static char
-    color[MaxTextExtent] = "gray";
+    color[MagickPathExtent] = "gray";
 
   unsigned int
     height,
@@ -7205,7 +7192,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       */
       if (*resource_info->home_directory == '\0')
         (void) CopyMagickString(resource_info->home_directory,".",
-          MaxTextExtent);
+          MagickPathExtent);
       status=chdir(resource_info->home_directory);
       if (status == -1)
         (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -7222,9 +7209,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       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 :
             "");
@@ -7242,9 +7229,9 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       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 :
             "");
@@ -7256,7 +7243,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
     case DeleteCommand:
     {
       static char
-        filename[MaxTextExtent] = "\0";
+        filename[MagickPathExtent] = "\0";
 
       /*
         Delete image file.
@@ -7275,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";
@@ -7296,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);
@@ -7418,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;
@@ -7435,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) &&
@@ -7449,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);
@@ -7543,7 +7530,7 @@ 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 (IfMagickTrue(windows->image.orphan) )
@@ -7578,7 +7565,7 @@ 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 (IfMagickTrue(windows->image.orphan) )
@@ -7634,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.
@@ -7681,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.
@@ -7719,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')
@@ -7745,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.
@@ -7759,9 +7746,9 @@ 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 (IfMagickTrue(windows->image.orphan) )
@@ -7773,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.
@@ -7787,9 +7774,9 @@ 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 (IfMagickTrue(windows->image.orphan) )
@@ -7801,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.
@@ -7816,7 +7803,7 @@ 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 (IfMagickTrue(windows->image.orphan) )
@@ -7828,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.
@@ -7842,7 +7829,7 @@ 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 (IfMagickTrue(windows->image.orphan) )
         break;
@@ -7887,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.
@@ -7928,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.
@@ -8009,7 +7996,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info,
       XSetCursorState(display,windows,MagickTrue);
       XCheckRefreshWindows(display,windows);
       (void) SetImageType(*image,(*image)->alpha_trait == UndefinedPixelTrait ?
-        GrayscaleType : GrayscaleMatteType,exception);
+        GrayscaleType : GrayscaleAlphaType,exception);
       XSetCursorState(display,windows,MagickFalse);
       if (IfMagickTrue(windows->image.orphan) )
         break;
@@ -8023,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.
@@ -8036,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)
         {
@@ -8057,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.
@@ -8112,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.
@@ -8150,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.
@@ -8189,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.
@@ -8226,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.
@@ -8262,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.
@@ -8298,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.
@@ -8327,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.
@@ -8362,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.
@@ -8400,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.
@@ -8417,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,IsMagickTrue(status),
+      shade_image=ShadeImage(*image,status != 0 ? MagickTrue : MagickFalse,
         geometry_info.rho,geometry_info.sigma,exception);
       if (shade_image != (Image *) NULL)
         {
@@ -8435,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.
@@ -8463,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.
@@ -8498,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.
@@ -8533,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.
@@ -8562,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.
@@ -8598,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.
@@ -8634,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.
@@ -8677,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.
@@ -8715,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.
@@ -8751,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.
@@ -8862,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.
@@ -8911,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.
@@ -9027,7 +9014,7 @@ 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 (IfMagickFalse(status) )
@@ -9081,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.
@@ -9106,15 +9093,15 @@ 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);
@@ -9139,15 +9126,15 @@ 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);
@@ -9178,15 +9165,15 @@ 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);
@@ -9214,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.
@@ -9269,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);
@@ -9350,7 +9337,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
   ExceptionInfo *exception)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   register int
     x,
@@ -9388,7 +9375,7 @@ static void XMagnifyImage(Display *display,XWindows *windows,XEvent *event,
         /*
           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);
       }
@@ -9663,7 +9650,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
   ExceptionInfo *exception)
 {
   static char
-    matte[MaxTextExtent] = "0";
+    matte[MagickPathExtent] = "0";
 
   static const char
     *MatteEditMenu[] =
@@ -9697,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;
@@ -9756,7 +9743,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
         /*
           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);
       }
@@ -9821,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.
@@ -9841,7 +9828,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
           case MatteEditFuzzCommand:
           {
             static char
-              fuzz[MaxTextExtent];
+              fuzz[MagickPathExtent];
 
             static const char
               *FuzzMenu[] =
@@ -9868,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;
@@ -9881,7 +9868,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
           case MatteEditValueCommand:
           {
             static char
-              message[MaxTextExtent];
+              message[MagickPathExtent];
 
             static const char
               *MatteMenu[] =
@@ -9901,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);
@@ -9986,7 +9973,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -10178,7 +10165,7 @@ static MagickBooleanType XMatteEditImage(Display *display,
             channel_mask=SetImageChannelMask(*image,AlphaChannel);
             (void) FloodfillPaintImage(*image,draw_info,&target,(ssize_t)
               x_offset,(ssize_t) y_offset,
-              IsMagickFalse(method == FloodfillMethod),exception);
+              method != FloodfillMethod ? MagickTrue : MagickFalse,exception);
             (void) SetPixelChannelMask(*image,channel_mask);
             draw_info=DestroyDrawInfo(draw_info);
             break;
@@ -10267,7 +10254,7 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
     *image_info;
 
   static char
-    filename[MaxTextExtent] = "\0";
+    filename[MagickPathExtent] = "\0";
 
   /*
     Request file name from user.
@@ -10320,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')
@@ -10340,17 +10327,17 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
     }
   magick_info=GetMagickInfo(image_info->magick,exception);
   if ((magick_info != (const MagickInfo *) NULL) &&
-      IfMagickTrue(magick_info->raw))
+      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);
@@ -10360,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);
@@ -10383,12 +10370,12 @@ static Image *XOpenImage(Display *display,XResourceInfo *resource_info,
       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);
@@ -10438,7 +10425,7 @@ static void XPanImage(Display *display,XWindows *windows,XEvent *event,
   ExceptionInfo *exception)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -10548,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);
@@ -10633,7 +10620,7 @@ static MagickBooleanType XPasteImage(Display *display,
     compose = CopyCompositeOp;
 
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   Cursor
     cursor;
@@ -10700,7 +10687,7 @@ static MagickBooleanType XPasteImage(Display *display,
         /*
           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);
       }
@@ -10728,7 +10715,7 @@ static MagickBooleanType XPasteImage(Display *display,
           case PasteOperatorsCommand:
           {
             char
-              command[MaxTextExtent],
+              command[MagickPathExtent],
               **operators;
 
             /*
@@ -10822,7 +10809,7 @@ static MagickBooleanType XPasteImage(Display *display,
       case KeyPress:
       {
         char
-          command[MaxTextExtent];
+          command[MagickPathExtent];
 
         KeySym
           key_symbol;
@@ -10983,8 +10970,8 @@ static MagickBooleanType XPrintImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    filename[MaxTextExtent],
-    geometry[MaxTextExtent];
+    filename[MagickPathExtent],
+    geometry[MagickPathExtent];
 
   Image
     *print_image;
@@ -10999,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')
@@ -11015,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);
@@ -11023,14 +11010,14 @@ 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);
   print_image=DestroyImage(print_image);
   image_info=DestroyImageInfo(image_info);
   XSetCursorState(display,windows,MagickFalse);
-  return(IsMagickTrue(status));
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -11279,8 +11266,8 @@ static MagickBooleanType XROIImage(Display *display,
     };
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   CommandType
     command_type;
@@ -11346,7 +11333,7 @@ static MagickBooleanType XROIImage(Display *display,
         /*
           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);
       }
@@ -11504,7 +11491,7 @@ static MagickBooleanType XROIImage(Display *display,
           */
           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);
@@ -11602,7 +11589,7 @@ static MagickBooleanType XROIImage(Display *display,
           /*
             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);
@@ -11703,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)
                 {
@@ -11715,7 +11702,7 @@ static MagickBooleanType XROIImage(Display *display,
                   if (entry >= 0)
                     {
                       (void) CopyMagickString(command,Menus[id][entry],
-                        MaxTextExtent);
+                        MagickPathExtent);
                       command_type=Commands[id][entry];
                     }
                 }
@@ -11945,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));
@@ -12054,8 +12041,8 @@ static MagickBooleanType XRotateImage(Display *display,
     pen_id = 0;
 
   char
-    command[MaxTextExtent],
-    text[MaxTextExtent];
+    command[MagickPathExtent],
+    text[MagickPathExtent];
 
   Image
     *rotate_image;
@@ -12159,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.
@@ -12246,7 +12233,7 @@ static MagickBooleanType XRotateImage(Display *display,
           case KeyPress:
           {
             char
-              command[MaxTextExtent];
+              command[MagickPathExtent];
 
             KeySym
               key_symbol;
@@ -12321,7 +12308,7 @@ static MagickBooleanType XRotateImage(Display *display,
             */
             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,
@@ -12438,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;
@@ -12448,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;
         }
@@ -12457,7 +12444,7 @@ 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;
         }
@@ -12535,8 +12522,8 @@ static MagickBooleanType XSaveImage(Display *display,
   ExceptionInfo *exception)
 {
   char
-    filename[MaxTextExtent],
-    geometry[MaxTextExtent];
+    filename[MagickPathExtent],
+    geometry[MagickPathExtent];
 
   Image
     *save_image;
@@ -12552,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;
@@ -12587,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;
@@ -12601,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);
@@ -12616,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')
@@ -12639,21 +12626,21 @@ 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 (IfMagickTrue(status) )
     image->taint=MagickFalse;
   save_image=DestroyImage(save_image);
   image_info=DestroyImageInfo(image_info);
   XSetCursorState(display,windows,MagickFalse);
-  return(IsMagickTrue(status));
+  return(status != 0 ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -12852,7 +12839,7 @@ static void XScreenEvent(Display *display,XWindows *windows,XEvent *event,
     case KeyPress:
     {
       char
-        command[MaxTextExtent];
+        command[MagickPathExtent];
 
       KeySym
         key_symbol;
@@ -12965,7 +12952,7 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
   RectangleInfo *crop_info,Image *image)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   int
     x,
@@ -12983,7 +12970,7 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
       /*
         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);
@@ -13014,7 +13001,7 @@ static void XSetCropGeometry(Display *display,XWindows *windows,
   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
@@ -13082,8 +13069,8 @@ static Image *XTileImage(Display *display,XResourceInfo *resource_info,
     };
 
   char
-    command[MaxTextExtent],
-    filename[MaxTextExtent];
+    command[MagickPathExtent],
+    filename[MagickPathExtent];
 
   Image
     *tile_image;
@@ -13185,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);
@@ -13282,7 +13269,7 @@ 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 (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
@@ -13341,7 +13328,7 @@ static void XTranslateImage(Display *display,XWindows *windows,
   Image *image,const KeySym key_symbol)
 {
   char
-    text[MaxTextExtent];
+    text[MagickPathExtent];
 
   int
     x,
@@ -13414,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);
@@ -13631,8 +13618,8 @@ static Image *XVisualDirectoryImage(Display *display,
     i;
 
   static char
-    filename[MaxTextExtent] = "\0",
-    filenames[MaxTextExtent] = "*";
+    filename[MagickPathExtent] = "\0",
+    filenames[MagickPathExtent] = "*";
 
   XResourceInfo
     background_resources;
@@ -13670,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=IsMagickTrue( (windows->visual_info->klass == TrueColor) ||
-    (windows->visual_info->klass == DirectColor) );
+  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);
@@ -13688,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);
@@ -13741,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);
@@ -13789,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,
@@ -13831,7 +13818,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
     Determine target window.
   */
   assert(image != (Image *) NULL);
-  assert(image->signature == MagickSignature);
+  assert(image->signature == MagickCoreSignature);
   if (IfMagickTrue(image->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   resources=(*resource_info);
@@ -13858,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)
     {
@@ -13928,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;
@@ -13978,7 +13965,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
       (*resources.image_geometry != '\0'))
     {
       char
-        default_geometry[MaxTextExtent];
+        default_geometry[MagickPathExtent];
 
       int
         flags,
@@ -13995,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,
@@ -14031,7 +14018,7 @@ MagickExport MagickBooleanType XDisplayBackgroundImage(Display *display,
   delay=1000*image->delay/MagickMax(image->ticks_per_second,1L);
   XDelay(display,delay == 0UL ? 10UL : delay);
   (void) XSync(display,MagickFalse);
-  return(IsMagickTrue(window_info.id == root_window));
+  return(window_info.id == root_window ? MagickTrue : MagickFalse);
 }
 \f
 /*
@@ -14427,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;
@@ -14457,7 +14444,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     i;
 
   static char
-    working_directory[MaxTextExtent];
+    working_directory[MagickPathExtent];
 
   static XPoint
     vid_info;
@@ -14526,7 +14513,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     *manager_hints;
 
   assert(image != (Image **) NULL);
-  assert((*image)->signature == MagickSignature);
+  assert((*image)->signature == MagickCoreSignature);
   if (IfMagickTrue((*image)->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
   display_image=(*image);
@@ -14538,7 +14525,7 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         status;
 
       if (*working_directory == '\0')
-        (void) CopyMagickString(working_directory,".",MaxTextExtent);
+        (void) CopyMagickString(working_directory,".",MagickPathExtent);
       status=chdir(working_directory);
       if (status == -1)
         (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -14711,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;
@@ -14865,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);
@@ -14897,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);
@@ -14952,11 +14939,11 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
     resource_info,&windows->magnify);
   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);
@@ -14996,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);
@@ -15111,15 +15098,12 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
                           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);
@@ -15137,10 +15121,15 @@ MagickExport Image *XDisplayImage(Display *display,XResourceInfo *resource_info,
         }
     timestamp=time((time_t *) NULL);
     (void) XNextEvent(display,&event);
-    if (IfMagickFalse(windows->image.stasis) )
-      windows->image.stasis=IsMagickTrue((time((time_t *) NULL)-timestamp) > 0);
-    if (IfMagickFalse(windows->magnify.stasis) )
-      windows->magnify.stasis=IsMagickTrue((time((time_t *) NULL)-timestamp) > 0);
+    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)
       {
         /*
@@ -15149,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)
           {
@@ -15160,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)
@@ -15478,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;
@@ -15488,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
               {
@@ -15501,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);
@@ -15960,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;
@@ -15972,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);
@@ -16146,14 +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,".",MaxTextExtent);
+      (void) CopyMagickString(resource_info->home_directory,".",MagickPathExtent);
     status=chdir(resource_info->home_directory);
     if (status == -1)
       (void) ThrowMagickException(exception,GetMagickModule(),FileOpenError,
@@ -16197,9 +16186,9 @@ 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);
+  assert(image->signature == MagickCoreSignature);
   (void) image_info;
   if (IfMagickTrue(image->debug) )
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
@@ -16242,7 +16231,7 @@ 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);