display.c revision e5b39652d8d21bc3940d83b8d6088d4070a8a34a
13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               DDDD   IIIII  SSSSS  PPPP   L       AAA   Y   Y               %
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               D   D    I    SS     P   P  L      A   A   Y Y                %
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               D   D    I     SSS   PPPP   L      AAAAA    Y                 %
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               D   D    I       SS  P      L      A   A    Y                 %
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%               DDDD   IIIII  SSSSS  P      LLLLL  A   A    Y                 %
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%              Methods to Interactively Display and Edit an Image             %
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                             Software Design                                 %
163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                               John Cristy                                   %
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                July 1992                                    %
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
201454be7db7a897f42cd40e4165f945d77196a6f8cristy%  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization      %
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  dedicated to making software imaging solutions freely available.           %
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  You may not use this file except in compliance with the License.  You may  %
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  obtain a copy of the License at                                            %
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    http://www.imagemagick.org/script/license.php                            %
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Unless required by applicable law or agreed to in writing, software        %
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  distributed under the License is distributed on an "AS IS" BASIS,          %
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  See the License for the specific language governing permissions and        %
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  limitations under the License.                                             %
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  Use the display program to display an image or image sequence on any X
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  server.
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Include declarations.
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
444c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/studio.h"
454c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/MagickWand.h"
464c08aed51c5899665ade97263692328eea4af106cristy#include "MagickWand/mogrify-private.h"
474c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/display-private.h"
482c5fc27ae5b613b7fb9fd69c12a47b99c7d4d471cristy#include "MagickCore/nt-base-private.h"
494c08aed51c5899665ade97263692328eea4af106cristy#include "MagickCore/string-private.h"
507832dc2d904c471770087cce18a9a2d76c2216a3cristy#include "MagickCore/xwindow-private.h"
513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy+   D i s p l a y I m a g e C o m m a n d                                     %
583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%                                                                             %
613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  DisplayImageCommand() displays a sequence of images on any workstation
643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  display running an X server.  Display first determines the hardware
653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  capabilities of the workstation. If the number of unique colors in an image
663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  is less than or equal to the number the workstation can support, the image
673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  is displayed in an X window. Otherwise the number of colors in the image is
683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  first reduced to match the color resolution of the workstation before it is
693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  displayed.
703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  This means that a continuous-tone 24 bits/pixel image can display on a 8
723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  bit pseudo-color device or monochrome device. In most instances the reduced
733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  color image closely resembles the original. Alternatively, a monochrome or
743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  device.
763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  The format of the DisplayImageCommand method is:
783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%      MagickBooleanType DisplayImageCommand(ImageInfo *image_info,int argc,
803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%        char **argv,char **metadata,ExceptionInfo *exception)
813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%  A description of each parameter follows:
833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o image_info: the image info.
853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o argc: the number of elements in the argument vector.
873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o argv: A text array containing the command line arguments.
893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o metadata: any metadata is returned here.
913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%    o exception: return any errors or warnings in this structure.
933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy%
943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
963ed852eea50f9d4cd633efb8c2b054b8e33c253cristystatic MagickBooleanType DisplayUsage(void)
973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  const char
993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    **p;
1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  static const char
1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *buttons[]=
1033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "1    press to map or unmap the Command widget",
1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "2    press and drag to magnify a region of an image",
1063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "3    press to load an image from a visual image directory",
1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (char *) NULL
1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    },
1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *miscellaneous[]=
1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-debug events        display copious debugging information",
1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-help                print program options",
1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-list type           print a list of supported option arguments",
1143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-log format          format of debugging information",
1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-version             print version information",
1163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (char *) NULL
1173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    },
1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *operators[]=
1193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
1203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-auto-orient         automagically orient image",
1213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-border geometry     surround image with a border of color",
122cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy      "-clip                clip along the first path from the 8BIM profile",
123cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy      "-clip-path id        clip along a named path from the 8BIM profile",
1243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-colors value        preferred number of colors in the image",
1253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-contrast            enhance or reduce the image contrast",
1263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-crop geometry       preferred size and location of the cropped image",
1273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-decipher filename   convert cipher pixels to plain pixels",
1283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-deskew threshold    straighten an image",
1293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-despeckle           reduce the speckles within an image",
1303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-edge factor         apply a filter to detect edges in the image",
1313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-enhance             apply a digital filter to enhance a noisy image",
1323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-equalize            perform histogram equalization to an image",
1333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-extract geometry    extract area from image",
1343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-flip                flip image in the vertical direction",
1353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-flop                flop image in the horizontal direction",
1363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-frame geometry      surround image with an ornamental border",
1373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-fuzz distance       colors within this distance are considered equal",
1383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-gamma value         level of gamma correction",
1393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-monochrome          transform image to black and white",
1403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-negate              replace every pixel with its complementary color",
1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-normalize           transform image to span the full range of colors",
1423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-raise value         lighten/darken image edges to create a 3-D effect",
1433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-resample geometry   change the resolution of an image",
1443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-resize geometry     resize the image",
1453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-roll geometry       roll an image vertically or horizontally",
1463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-rotate degrees      apply Paeth rotation to the image",
1473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-sample geometry     scale image with pixel sampling",
1483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-segment value       segment an image",
1493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-sharpen geometry    sharpen the image",
1503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-strip               strip image of all profiles and comments",
1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-threshold value     threshold the image",
152e4cbe744d58ba0b08df933d7259a62250278f4accristy      "-thumbnail geometry  create a thumbnail of the image",
1533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-trim                trim image edges",
1543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (char *) NULL
1553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    },
1563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *settings[]=
1573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
1583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-alpha option        on, activate, off, deactivate, set, opaque, copy",
1593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     transparent, extract, background, or shape",
1603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-antialias           remove pixel-aliasing",
1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-authenticate password",
1623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     decipher image with this password",
1633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-backdrop            display image centered on a backdrop",
1643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-channel type        apply option to select image channels",
1653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-colormap type       Shared or Private",
1663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-colorspace type     alternate image colorspace",
1673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-comment string      annotate image with comment",
1683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-compress type       type of pixel compression when writing the image",
1693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-define format:option",
1703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     define one or more image format options",
1713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-delay value         display the next image after pausing",
1723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-density geometry    horizontal and vertical density of the image",
1733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-depth value         image depth",
1743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-display server      display image to this X server",
1753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-dispose method      layer disposal method",
1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-dither method       apply error diffusion to image",
1773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-endian type         endianness (MSB or LSB) of the image",
1783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-filter type         use this filter when resizing an image",
1793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-format string     output formatted image characteristics",
1803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-geometry geometry   preferred size and location of the Image window",
1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-gravity type        horizontal and vertical backdrop placement",
1823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-identify            identify the format and characteristics of the image",
1833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-immutable           displayed image cannot be modified",
1843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-interlace type      type of image interlacing scheme",
1853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-interpolate method  pixel color interpolation method",
1863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-label string        assign a label to an image",
1873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-limit type value    pixel cache resource limit",
1883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-loop iterations     loop images then exit",
1893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-map type            display image using this Standard Colormap",
1903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-monitor             monitor progress",
1913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-page geometry       size and location of an image canvas",
1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-profile filename    add, delete, or apply an image profile",
1933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-quality value       JPEG/MIFF/PNG compression level",
1943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-quantize colorspace reduce colors in this colorspace",
1953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-quiet               suppress all warning messages",
1963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-regard-warnings     pay attention to warning messages",
1973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-remote command      execute a command in an remote display process",
1983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-repage geometry     size and location of an image canvas (operator)",
1993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-respect-parentheses settings remain in effect until parenthesis boundary",
2003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-sampling-factor geometry",
2013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     horizontal and vertical sampling factor",
2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-seed value          seed a new sequence of pseudo-random numbers",
2033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-set property value  set an image property",
2043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-size geometry       width and height of image",
2053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-texture filename    name of texture to tile onto the image background",
2063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-transparent-color color",
2073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     transparent color",
2083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-treedepth value     color tree depth",
2093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-update seconds      detect when image file is modified and redisplay",
2103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-verbose             print detailed information about the image",
2113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-visual type         display image using this visual type",
2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-virtual-pixel method",
2133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "                     virtual pixel access method",
2143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-window id           display image to background of this window",
2153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-window-group id     exit program when this window id is destroyed",
2163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-write filename      write image to a file",
2173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (char *) NULL
2183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    },
2193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *sequence_operators[]=
2203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-coalesce            merge a sequence of images",
2223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      "-flatten             flatten a sequence of images",
2233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (char *) NULL
2243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    };
2253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
226bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
227610b2e2a651ec5a071deebba6d577344d6362df9cristy  (void) printf("Copyright: %s\n",GetMagickCopyright());
228610b2e2a651ec5a071deebba6d577344d6362df9cristy  (void) printf("Features: %s\n\n",GetMagickFeatures());
2293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
2303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    GetClientName());
2313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("\nImage Settings:\n");
2323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for (p=settings; *p != (char *) NULL; p++)
2333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) printf("  %s\n",*p);
2343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("\nImage Operators:\n");
2353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for (p=operators; *p != (char *) NULL; p++)
2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) printf("  %s\n",*p);
2373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("\nImage Sequence Operators:\n");
2383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for (p=sequence_operators; *p != (char *) NULL; p++)
2393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) printf("  %s\n",*p);
2403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("\nMiscellaneous Options:\n");
2413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for (p=miscellaneous; *p != (char *) NULL; p++)
2423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) printf("  %s\n",*p);
2433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "\nIn addition to those listed above, you can specify these standard X\n");
2453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "resources as command line options:  -background, -bordercolor,\n");
2473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
2493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("-name, -shared-memory, -usePixmap, or -title.\n");
2503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
251e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony    "\nBy default, the image format of 'file' is determined by its magic\n");
2523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "number.  To specify a particular image format, precede the filename\n");
2543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "with an image format name and a colon (i.e. ps:image) or specify the\n");
2563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf(
2573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "image type as the filename suffix (i.e. image.ps).  Specify 'file' as\n");
2583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("'-' for standard input or output.\n");
2593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) printf("\nButtons: \n");
2603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  for (p=buttons; *p != (char *) NULL; p++)
2613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) printf("  %s\n",*p);
2623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(MagickFalse);
2633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2653ed852eea50f9d4cd633efb8c2b054b8e33c253cristyWandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
2663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
2673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
2683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#if defined(MAGICKCORE_X11_DELEGATE)
2693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define DestroyDisplay() \
2703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \
2713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if ((state & ExitState) == 0) \
2723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    DestroyXResources(); \
2733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (display != (Display *) NULL) \
2743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    { \
2753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      XCloseDisplay(display); \
2763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      display=(Display *) NULL; \
2773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    } \
2783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  XDestroyResourceInfo(&resource_info); \
2793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DestroyImageStack(); \
280bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  if (image_marker != (size_t *) NULL) \
281bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    image_marker=(size_t *) RelinquishMagickMemory(image_marker); \
282bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  for (i=0; i < (ssize_t) argc; i++) \
2833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    argv[i]=DestroyString(argv[i]); \
2843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  argv=(char **) RelinquishMagickMemory(argv); \
2853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define ThrowDisplayException(asperity,tag,option) \
2873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \
288e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony  (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"'%s'", \
2893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    option); \
2903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DestroyDisplay(); \
2913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(MagickFalse); \
2923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define ThrowDisplayInvalidArgumentException(option,argument) \
2943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{ \
2953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
296e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony    "InvalidArgument","'%s': %s",option,argument); \
2973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DestroyDisplay(); \
2983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(MagickFalse); \
2993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  char
3023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *resource_value,
3033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *server_name;
3043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  const char
3063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *option;
3073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Display
3093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *display;
3103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Image
3123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *image;
3133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ImageStack
3153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    image_stack[MaxImageStackDepth+1];
3163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickBooleanType
318ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy    fire,
319ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy    pend,
320ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy    respect_parenthesis;
3213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickStatusType
3233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    status;
3243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  QuantizeInfo
3263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *quantize_info;
3273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
328bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  register ssize_t
3293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    i;
3303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
331bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  size_t
3323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    *image_marker,
3333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    iterations,
3343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    last_image,
3353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    state;
3363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3379d314ff2c17a77996c05413c2013880387e50f0ecristy  ssize_t
3389d314ff2c17a77996c05413c2013880387e50f0ecristy    image_number,
3399d314ff2c17a77996c05413c2013880387e50f0ecristy    iteration,
3409d314ff2c17a77996c05413c2013880387e50f0ecristy    j,
3419d314ff2c17a77996c05413c2013880387e50f0ecristy    k,
3429d314ff2c17a77996c05413c2013880387e50f0ecristy    l;
3439d314ff2c17a77996c05413c2013880387e50f0ecristy
3443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  XResourceInfo
3453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    resource_info;
3463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  XrmDatabase
3483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    resource_database;
3493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
3513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Set defaults.
3523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
3533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(image_info != (ImageInfo *) NULL);
3543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(image_info->signature == MagickSignature);
3553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image_info->debug != MagickFalse)
3563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
3573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  assert(exception != (ExceptionInfo *) NULL);
3583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (argc == 2)
3593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
3603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      option=argv[1];
3613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if ((LocaleCompare("version",option+1) == 0) ||
3623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          (LocaleCompare("-version",option+1) == 0))
3633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
364b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy          (void) FormatLocaleFile(stdout,"Version: %s\n",
365bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            GetMagickVersion((size_t *) NULL));
3661e604812fad85bb96f757a2393015ae3d061c39acristy          (void) FormatLocaleFile(stdout,"Copyright: %s\n",
3671e604812fad85bb96f757a2393015ae3d061c39acristy            GetMagickCopyright());
3681e604812fad85bb96f757a2393015ae3d061c39acristy          (void) FormatLocaleFile(stdout,"Features: %s\n\n",
3691e604812fad85bb96f757a2393015ae3d061c39acristy            GetMagickFeatures());
3703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          return(MagickFalse);
3713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        }
3723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
3733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  SetNotifyHandlers;
3743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  display=(Display *) NULL;
3753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  j=1;
3763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  k=0;
377bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  image_marker=(size_t *) NULL;
3783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  image_number=0;
3793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  last_image=0;
3803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  NewImageStack();
3813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  option=(char *) NULL;
3823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  pend=MagickFalse;
383ebbcfea9ab0a5066ff5f0b5257c9598ca77579d3cristy  respect_parenthesis=MagickFalse;
3843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_database=(XrmDatabase) NULL;
3853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
3863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  server_name=(char *) NULL;
3873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  state=0;
3883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  status=MagickTrue;
3893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ReadCommandlLine(argc,&argv);
3903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  status=ExpandFilenames(&argc,&argv);
3913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (status == MagickFalse)
3923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
3933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      GetExceptionMessage(errno));
394bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  image_marker=(size_t *) AcquireQuantumMemory((size_t) argc+1UL,
3953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    sizeof(*image_marker));
396bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  if (image_marker == (size_t *) NULL)
3973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
3983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      GetExceptionMessage(errno));
399cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy  for (i=0; i <= (ssize_t) argc; i++)
400bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    image_marker[i]=(size_t) argc;
4013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
4023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Check for server name specified on the command line.
4033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
404bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  for (i=1; i < (ssize_t) argc; i++)
4053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  {
4063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    /*
4073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      Check command line for server name.
4083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    */
4093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    option=argv[i];
4103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (LocaleCompare("display",option+1) == 0)
4113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
4123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        /*
4133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          User specified server name.
4143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        */
4153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        i++;
416bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy        if (i == (ssize_t) argc)
4173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          ThrowDisplayException(OptionError,"MissingArgument",option);
4183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        server_name=argv[i];
4193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
4203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if ((LocaleCompare("help",option+1) == 0) ||
4213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (LocaleCompare("-help",option+1) == 0))
4223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      return(DisplayUsage());
4233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  }
4243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
4253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Get user defaults from X resource database.
4263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
4273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  display=XOpenDisplay(server_name);
4283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (display == (Display *) NULL)
4293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowDisplayException(XServerError,"UnableToOpenXServer",
4303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      XDisplayName(server_name));
4313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) XSetErrorHandler(XError);
4323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_database=XGetResourceDatabase(display,GetClientName());
4333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  XGetResourceInfo(image_info,resource_database,GetClientName(),
4343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    &resource_info);
4353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  quantize_info=resource_info.quantize_info;
4363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  image_info->density=XGetResourceInstance(resource_database,GetClientName(),
4373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "density",(char *) NULL);
4383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (image_info->density == (char *) NULL)
4393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    image_info->density=XGetScreenDensity(display);
4403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_value=XGetResourceInstance(resource_database,GetClientName(),
4413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "interlace","none");
4423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  image_info->interlace=(InterlaceType)
443042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy    ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value);
4443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  image_info->page=XGetResourceInstance(resource_database,GetClientName(),
4453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "pageGeometry",(char *) NULL);
4463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_value=XGetResourceInstance(resource_database,GetClientName(),
4473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "quality","75");
448e27293e706ca05b6b121e9512a83b16f7ad887f2cristy  image_info->quality=StringToUnsignedLong(resource_value);
4493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_value=XGetResourceInstance(resource_database,GetClientName(),
4503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "verbose","False");
4512e4501b56bdc589397786ecc59f8c2d206547a36anthony  image_info->verbose=IsStringTrue(resource_value);
4523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  resource_value=XGetResourceInstance(resource_database,GetClientName(),
4533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    "dither","True");
4542e4501b56bdc589397786ecc59f8c2d206547a36anthony  quantize_info->dither=IsStringTrue(resource_value);
4553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  /*
4563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    Parse command line.
4573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  */
4583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  iteration=0;
459bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  for (i=1; ((i <= (ssize_t) argc) && ((state & ExitState) == 0)); i++)
4603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  {
461bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy    if (i < (ssize_t) argc)
4623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      option=argv[i];
4633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    else
4643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      if (image != (Image *) NULL)
4653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        break;
4663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      else
4673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (isatty(STDIN_FILENO) != MagickFalse)
4683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          option="logo:";
4693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        else
4703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
4713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            int
4723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              c;
4733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            c=getc(stdin);
4753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (c == EOF)
4763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
4773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            else
4783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
4793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                c=ungetc(c,stdin);
4803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                option="-";
4813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
4823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
4833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (LocaleCompare(option,"(") == 0)
4843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
4853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        FireImageStack(MagickFalse,MagickTrue,pend);
4863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (k == MaxImageStackDepth)
4873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply",
4883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            option);
4893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        PushImageStack();
4903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        continue;
4913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
4923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (LocaleCompare(option,")") == 0)
4933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
4943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        FireImageStack(MagickFalse,MagickTrue,MagickTrue);
4953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (k == 0)
4963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          ThrowDisplayException(OptionError,"UnableToParseExpression",option);
4973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        PopImageStack();
4983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        continue;
4993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
500042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy    if (IsCommandOption(option) == MagickFalse)
5013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
5023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        const char
5033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          *filename;
5043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        Image
5065ca515760d11d78913ed38d03b6c14ad34068d32cristy          *display_image,
5070d2c4cef237086ef14aebe809fea475453a09374cristy          *image_list,
5083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          *images;
5093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        /*
5113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          Option is a file name.
5123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        */
5133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        FireImageStack(MagickFalse,MagickFalse,pend);
5143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        filename=option;
515cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy        if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
5163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
5173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            option=argv[++i];
5183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            filename=option;
5193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
5203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
5213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        images=ReadImage(image_info,exception);
5223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        CatchException(exception);
5233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        status&=(images != (Image *) NULL) &&
5243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          (exception->severity < ErrorException);
5253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (images == (Image *) NULL)
5263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          continue;
5273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        AppendImageStack(images);
5283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        FinalizeImageSettings(image_info,image,MagickFalse);
529f381638d20fad1367315df9b79eae3a89582fea2cristy        iterations=0;
530cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy        if (i == (ssize_t) (argc-1))
531f381638d20fad1367315df9b79eae3a89582fea2cristy          iterations=image->iterations;
5320d2c4cef237086ef14aebe809fea475453a09374cristy        image_list=CloneImageList(image,exception);
5330d2c4cef237086ef14aebe809fea475453a09374cristy        if (image_list == (Image *) NULL)
5345ca515760d11d78913ed38d03b6c14ad34068d32cristy          ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
5355ca515760d11d78913ed38d03b6c14ad34068d32cristy            GetExceptionMessage(errno));
5360d2c4cef237086ef14aebe809fea475453a09374cristy        display_image=image_list;
5373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        do
5383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        {
5393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          /*
5403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            Transmogrify image as defined by the image processing options.
5413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          */
5423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          resource_info.quantum=1;
5433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          if (resource_info.window_id != (char *) NULL)
5443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
5453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              /*
5463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                Display image to a specified X window.
5473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              */
5485ca515760d11d78913ed38d03b6c14ad34068d32cristy              status=XDisplayBackgroundImage(display,&resource_info,
549051718b74ad68f8584cdac01d0192974ec777f1bcristy                display_image,exception);
5503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              if (status != MagickFalse)
5513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                {
5523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  state|=RetainColorsState;
5533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  status=MagickFalse;
5543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                }
5553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
5563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          else
5573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            do
5583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
5593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              Image
5603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                *nexus;
5613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              /*
5633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                Display image to X server.
5643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              */
565588e8b91b002fd58328031cc4d4f23777b209622cristy              if (resource_info.delay != 1)
5665ca515760d11d78913ed38d03b6c14ad34068d32cristy                display_image->delay=resource_info.delay;
5675ca515760d11d78913ed38d03b6c14ad34068d32cristy              nexus=XDisplayImage(display,&resource_info,argv,argc,
568051718b74ad68f8584cdac01d0192974ec777f1bcristy                &display_image,&state,exception);
5693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              status&=nexus != (Image *) NULL;
5703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              if (nexus == (Image *) NULL)
5713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
5723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
5733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
5743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                Image
5753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  *next;
5763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                if (nexus->montage != (char *) NULL)
5783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  {
5793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    /*
5803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      User selected a visual directory image (montage).
5813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    */
5825ca515760d11d78913ed38d03b6c14ad34068d32cristy                    display_image=nexus;
5833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    break;
5843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  }
5853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                next=XDisplayImage(display,&resource_info,argv,argc,&nexus,
586051718b74ad68f8584cdac01d0192974ec777f1bcristy                  &state,exception);
5873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                if ((next == (Image *) NULL) &&
5883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    (GetNextImageInList(nexus) != (Image *) NULL))
5893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  {
5905ca515760d11d78913ed38d03b6c14ad34068d32cristy                    display_image=GetNextImageInList(nexus);
5913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    nexus=NewImageList();
5923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  }
5933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                else
5943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  {
5955ca515760d11d78913ed38d03b6c14ad34068d32cristy                    if (nexus != display_image)
5963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                      nexus=DestroyImageList(nexus);
5973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    nexus=next;
5983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  }
5993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
6003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            } while ((state & ExitState) == 0);
6013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          if (resource_info.write_filename != (char *) NULL)
6023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
6033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              /*
6043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                Write image.
6053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              */
6065ca515760d11d78913ed38d03b6c14ad34068d32cristy              (void) CopyMagickString(display_image->filename,
6073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                resource_info.write_filename,MaxTextExtent);
608c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy              (void) SetImageInfo(image_info,1,exception);
609c82a27bb8e3138ff9bbf0f696663bdf3e704cedecristy              status&=WriteImage(image_info,display_image,exception);
6103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
6113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          /*
6123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            Proceed to next/previous image.
6133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          */
6143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          if ((state & FormerImageState) != 0)
615cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy            for (l=0; l < (ssize_t) resource_info.quantum; l++)
6163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
6175ca515760d11d78913ed38d03b6c14ad34068d32cristy              display_image=GetPreviousImageInList(display_image);
6185ca515760d11d78913ed38d03b6c14ad34068d32cristy              if (display_image == (Image *) NULL)
6193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
6203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
6213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          else
622cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy            for (l=0; l < (ssize_t) resource_info.quantum; l++)
6233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            {
6245ca515760d11d78913ed38d03b6c14ad34068d32cristy              display_image=GetNextImageInList(display_image);
6255ca515760d11d78913ed38d03b6c14ad34068d32cristy              if (display_image == (Image *) NULL)
6263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
6273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            }
6285ca515760d11d78913ed38d03b6c14ad34068d32cristy        } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
6293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        /*
6303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          Free image resources.
6313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        */
6325ca515760d11d78913ed38d03b6c14ad34068d32cristy        display_image=DestroyImageList(display_image);
6330d2c4cef237086ef14aebe809fea475453a09374cristy        if (image_list != display_image)
6340d2c4cef237086ef14aebe809fea475453a09374cristy          image_list=DestroyImageList(image_list);
6353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if ((state & FormerImageState) == 0)
6363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
637bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            last_image=(size_t) image_number;
638bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            image_marker[i]=(size_t) image_number++;
6393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
6403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        else
6413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
6423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            /*
6433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              Proceed to previous image.
6443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            */
6453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            for (i--; i > 0; i--)
646bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy              if (image_marker[i] == (size_t) (image_number-2))
6473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
6483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            image_number--;
6493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
650bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy        if ((i == (ssize_t) (argc-1)) && ((state & ExitState) == 0))
6513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          i=0;
6523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if ((state & ExitState) != 0)
6533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
6543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        /*
6553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          Determine if we should proceed to the first image.
6563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        */
6573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (image_number < 0)
6583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
6593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if ((state & FormerImageState) != 0)
6603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
6613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
662cee9711bbc334b5677d5ec4ea1cc70340d35ee35cristy                for (i=1; i < (ssize_t) (argc-2); i++)
6633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  if (last_image == image_marker[i])
6643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                    break;
665bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy                image_number=(ssize_t) image_marker[i]+1;
6663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
6673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            continue;
6683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
6693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (resource_info.window_id != (char *) NULL)
6703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          state|=ExitState;
671bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy        if ((iterations != 0) && (++iteration == (ssize_t) iterations))
6723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          state|=ExitState;
6733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare(filename,"-") == 0)
6743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          state|=ExitState;
6759a48b17ace21f903496c0f5d0870f997e1bc3ba8cristy        RemoveAllImageStack();
6763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        continue;
6773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
6783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
6793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    switch (*(option+1))
6803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
6813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'a':
6823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
6833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("alpha",option+1) == 0)
6843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
685bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
6863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              type;
6873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
6893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
6903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
691bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
6923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
693042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            type=ParseCommandOption(MagickAlphaOptions,MagickFalse,argv[i]);
6943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (type < 0)
6953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelType",
6963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
6973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
6983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
6993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("antialias",option+1) == 0)
7003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("authenticate",option+1) == 0)
7023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
706bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("auto-orient",option+1) == 0)
7113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
7133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
7143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'b':
7153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
7163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("backdrop",option+1) == 0)
7173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
7193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("background",option+1) == 0)
7223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
726bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.background_color=argv[i];
7293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("border",option+1) == 0)
7323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
736bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
7393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
7403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("bordercolor",option+1) == 0)
7433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
747bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.border_color=argv[i];
7503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("borderwidth",option+1) == 0)
7533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.border_width=0;
7553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
758bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
7613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
762b70a486d55c723ec6da7e74c04edcec0598393cbcristy            resource_info.border_width=(unsigned int)
763b70a486d55c723ec6da7e74c04edcec0598393cbcristy              StringToUnsignedLong(argv[i]);
7643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
7673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
7683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'c':
7693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
7703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("cache",option+1) == 0)
7713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
7723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
775bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
7763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
7783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
7793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("channel",option+1) == 0)
7823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
783bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
7843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              channel;
7853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
7873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
7883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
789bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
7903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
7913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            channel=ParseChannelOption(argv[i]);
7923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (channel < 0)
7933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedChannelType",
7943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
7953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
7963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
7973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("clip",option+1) == 0)
7983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
7993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("clip-path",option+1) == 0)
8003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
8013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
802bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
8043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("coalesce",option+1) == 0)
8073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
8083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("colormap",option+1) == 0)
8093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
8103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.colormap=PrivateColormap;
8113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
814bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
8163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.colormap=UndefinedColormap;
8173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (LocaleCompare("private",argv[i]) == 0)
8183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              resource_info.colormap=PrivateColormap;
8193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (LocaleCompare("shared",argv[i]) == 0)
8203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              resource_info.colormap=SharedColormap;
8213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (resource_info.colormap == UndefinedColormap)
8223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedColormapType",
8233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
8243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("colors",option+1) == 0)
8273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
8283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->number_colors=0;
8293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
832bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
8343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
8353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
836e27293e706ca05b6b121e9512a83b16f7ad887f2cristy            quantize_info->number_colors=StringToUnsignedLong(argv[i]);
8373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("colorspace",option+1) == 0)
8403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
841bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
8423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              colorspace;
8433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
847bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
849042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            colorspace=ParseCommandOption(MagickColorspaceOptions,
8503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              MagickFalse,argv[i]);
8513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (colorspace < 0)
8523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedColorspace",
8533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
8543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("comment",option+1) == 0)
8573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
8583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
861bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
8633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("compress",option+1) == 0)
8663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
867bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
8683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              compress;
8693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
873bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
875042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
8763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
8773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (compress < 0)
8783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
8793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
8803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8822287975e02162155f1500d91ccce6e0fde5de7c8cristy        if (LocaleCompare("concurrent",option+1) == 0)
8832287975e02162155f1500d91ccce6e0fde5de7c8cristy          break;
8843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("contrast",option+1) == 0)
8853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
8863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("crop",option+1) == 0)
8873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
8883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
8893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
8903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
891bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
8923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
8933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
8943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
8953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
8963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
8973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
8983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
8993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'd':
9003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
9013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("debug",option+1) == 0)
9023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
903bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
9043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              event;
9053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
909bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
911042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
9123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (event < 0)
9133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedEventType",
9143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
9153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (void) SetLogEventMask(argv[i]);
9163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("decipher",option+1) == 0)
9193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
923bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
9243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("define",option+1) == 0)
9283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
930bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
9343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                const char
9353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  *define;
9363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                define=GetImageOption(image_info,argv[i]);
9383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                if (define == (const char *) NULL)
9393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
9403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                break;
9413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
9423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("delay",option+1) == 0)
9453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
949bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
9523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
9533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("density",option+1) == 0)
9563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
960bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
9633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
9643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("depth",option+1) == 0)
9673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
971bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
9743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
9753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("deskew",option+1) == 0)
9783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
982bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
9833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
9853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
9863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("despeckle",option+1) == 0)
9893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
9903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("display",option+1) == 0)
9913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
9923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
9933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
9943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
995bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
9963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
9973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
9983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
9993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("dispose",option+1) == 0)
10003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1001bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
10023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              dispose;
10033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
10043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
10053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
10063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1007bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
10083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1009042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
10103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (dispose < 0)
10113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
10123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
10133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
10143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("dither",option+1) == 0)
10163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1017bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
10183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              method;
10193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
10203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->dither=MagickFalse;
10213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
10223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
10233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1024bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
10253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1026042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
10273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (method < 0)
10283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
10293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
10303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->dither=MagickTrue;
10313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->dither_method=(DitherMethod) method;
10323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
10333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10342287975e02162155f1500d91ccce6e0fde5de7c8cristy        if (LocaleCompare("duration",option+1) == 0)
10352287975e02162155f1500d91ccce6e0fde5de7c8cristy          {
10362287975e02162155f1500d91ccce6e0fde5de7c8cristy            if (*option == '+')
10372287975e02162155f1500d91ccce6e0fde5de7c8cristy              break;
10382287975e02162155f1500d91ccce6e0fde5de7c8cristy            i++;
1039bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
10402287975e02162155f1500d91ccce6e0fde5de7c8cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
10412287975e02162155f1500d91ccce6e0fde5de7c8cristy            if (IsGeometry(argv[i]) == MagickFalse)
10422287975e02162155f1500d91ccce6e0fde5de7c8cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
10432287975e02162155f1500d91ccce6e0fde5de7c8cristy            break;
10442287975e02162155f1500d91ccce6e0fde5de7c8cristy          }
10453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
10463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
10473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'e':
10483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
10493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("edge",option+1) == 0)
10503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
10513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
10523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
10533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1054bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
10553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
10563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
10573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
10583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
10593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("endian",option+1) == 0)
10613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1062bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
10633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              endian;
10643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
10653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
10663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
10673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1068bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
10693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1070042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
10713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
10723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (endian < 0)
10733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedEndianType",
10743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
10753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
10763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("enhance",option+1) == 0)
10783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
10793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("equalize",option+1) == 0)
10803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
10813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("extract",option+1) == 0)
10823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
10833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
10843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
10853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1086bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
10873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
10883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
10893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
10903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
10913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
10923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
10933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
10943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'f':
10953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
10963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("filter",option+1) == 0)
10973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1098bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
10993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              filter;
11003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1104bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1106042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
11073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (filter < 0)
11083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
11093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
11103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("flatten",option+1) == 0)
11133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
11143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("flip",option+1) == 0)
11153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
11163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("flop",option+1) == 0)
11173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
11183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("font",option+1) == 0)
11193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1123bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.font=XGetResourceClass(resource_database,
11263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              GetClientName(),"font",argv[i]);
11273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("foreground",option+1) == 0)
11303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1134bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.foreground_color=argv[i];
11373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("format",option+1) == 0)
11403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1144bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
11453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("frame",option+1) == 0)
11493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1153bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
11563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
11573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("fuzz",option+1) == 0)
11603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1164bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
11653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
11673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
11683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
11713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
11723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'g':
11733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
11743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("gamma",option+1) == 0)
11753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1177bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
11803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
11813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("geometry",option+1) == 0)
11843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
11853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.image_geometry=(char *) NULL;
11863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
11873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
11883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
11893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1190bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
11913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
11923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
11933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
11943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.image_geometry=ConstantString(argv[i]);
11953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
11963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
11973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("gravity",option+1) == 0)
11983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1199bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
12003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              gravity;
12013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
12033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
12043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1205bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
12063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1207042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
12083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
12093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (gravity < 0)
12103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedGravityType",
12113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
12123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
12153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
12163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'h':
12173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
12183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if ((LocaleCompare("help",option+1) == 0) ||
12193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (LocaleCompare("-help",option+1) == 0))
12203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
12213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
12223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
12233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'i':
12243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
12253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("identify",option+1) == 0)
12263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
12273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("iconGeometry",option+1) == 0)
12283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.icon_geometry=(char *) NULL;
12303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
12313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
12323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1233bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
12343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
12353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
12363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
12373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.icon_geometry=argv[i];
12383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("iconic",option+1) == 0)
12413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
12433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("immutable",option+1) == 0)
12463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
12483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("interlace",option+1) == 0)
12513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1252bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
12533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              interlace;
12543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
12563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
12573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1258bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
12593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1260042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
12613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
12623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (interlace < 0)
12633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
12643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
12653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("interpolate",option+1) == 0)
12683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1269bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
12703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              interpolate;
12713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
12733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
12743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1275bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
12763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1277042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
12783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
12793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (interpolate < 0)
12803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
12813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
12823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
12853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
12863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'l':
12873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
12883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("label",option+1) == 0)
12893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
12913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
12923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1293bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
12943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
12953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
12963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
12973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("limit",option+1) == 0)
12983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
12993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            char
13003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              *p;
13013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
13023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            double
13033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              value;
13043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1305bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
13063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              resource;
13073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
13083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1311bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
13123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1313042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
13143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
13153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (resource < 0)
13163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedResourceType",
13173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
13183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1319bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
13203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1321dbdd0e35efc03c9bccda644f5407db38b7c17eeccristy            value=StringToDouble(argv[i],&p);
1322da16f16767eb31921af855f17bda465fffc4e000cristy            (void) value;
13233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
13243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
13253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
13263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("list",option+1) == 0)
13283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1329bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
13303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              list;
13313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
13323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1335bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
13363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1337042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
13383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (list < 0)
13393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1340aeb2cbc4eb61cc6a04744db1dc52f5319c466e29cristy            status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
13413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv+j,exception);
13423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            DestroyDisplay();
1343aeb2cbc4eb61cc6a04744db1dc52f5319c466e29cristy            return(status != 0 ? MagickFalse : MagickTrue);
13443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("log",option+1) == 0)
13463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
13473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1350bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if ((i == (ssize_t) argc) ||
13513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                (strchr(argv[i],'%') == (char *) NULL))
13523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
13533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
13543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("loop",option+1) == 0)
13563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
13573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1360bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
13613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
13623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
13633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
1364e27293e706ca05b6b121e9512a83b16f7ad887f2cristy            iterations=StringToUnsignedLong(argv[i]);
13653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
13663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
13683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
13693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'm':
13703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
13713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("magnify",option+1) == 0)
13723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
13733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.magnify=2;
13743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1377bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
13783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
13793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
13803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
1381e27293e706ca05b6b121e9512a83b16f7ad887f2cristy            resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
13823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
13833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("map",option+1) == 0)
13853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
13863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.map_type=(char *) NULL;
13873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
13883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
13893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (void) strcpy(argv[i]+1,"san");
13903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1391bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
13923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
13933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.map_type=argv[i];
13943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
13953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
13963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("matte",option+1) == 0)
13973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
13983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("mattecolor",option+1) == 0)
13993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1403bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
14043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
14053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.matte_color=argv[i];
14063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("monitor",option+1) == 0)
14093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
14103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("monochrome",option+1) == 0)
14113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->number_colors=2;
14153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->colorspace=GRAYColorspace;
14163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
14193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
14203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'n':
14213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
14223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("name",option+1) == 0)
14233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.name=(char *) NULL;
14253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1428bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
14293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
14303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.name=ConstantString(argv[i]);
14313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("negate",option+1) == 0)
14343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
14353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("noop",option+1) == 0)
14363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
14373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("normalize",option+1) == 0)
14383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
14393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
14403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
14413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'p':
14423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
14433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("page",option+1) == 0)
14443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.image_geometry=(char *) NULL;
14463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1449bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
14503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
14513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.image_geometry=ConstantString(argv[i]);
14523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("profile",option+1) == 0)
14553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1457bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
14583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
14593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
14623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
14633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'q':
14643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
14653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("quality",option+1) == 0)
14663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
14673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1470bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
14713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
14723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
14733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
14743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("quantize",option+1) == 0)
14773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1478bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
14793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              colorspace;
14803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
14813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
14823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
14833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1484bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
14853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1486042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            colorspace=ParseCommandOption(MagickColorspaceOptions,
14873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              MagickFalse,argv[i]);
14883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (colorspace < 0)
14893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"UnrecognizedColorspace",
14903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                argv[i]);
14913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
14923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
14933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("quiet",option+1) == 0)
14943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
14953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
14963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
14973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'r':
14983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
14993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("raise",option+1) == 0)
15003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1502bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("regard-warnings",option+1) == 0)
15093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
15103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("remote",option+1) == 0)
15113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1513bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
15163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              return(MagickFalse);
15173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i--;
15183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("repage",option+1) == 0)
15213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1525bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("resample",option+1) == 0)
15323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1536bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
15373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("resize",option+1) == 0)
15433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1547bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
15543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
15563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("roll",option+1) == 0)
15593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1563bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("rotate",option+1) == 0)
15703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1572bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
15793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
15803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 's':
15813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
15823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("sample",option+1) == 0)
15833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1587bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
15893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
15903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
15913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
15923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
15933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("sampling-factor",option+1) == 0)
15943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
15953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
15963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
15973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1598bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
15993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
16013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("scenes",option+1) == 0)
16053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1609bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
16123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("seed",option+1) == 0)
16163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1620bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
16213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
16233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("segment",option+1) == 0)
16273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1631bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
16343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("set",option+1) == 0)
16383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1640bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1645bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("sharpen",option+1) == 0)
16503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1654bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
16573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("shared-memory",option+1) == 0)
16613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
16633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              MagickFalse;
16643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("size",option+1) == 0)
16673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1671bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
16743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
16753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("strip",option+1) == 0)
16783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
16793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("support",option+1) == 0)
16803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;  /* deprecated */
16823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
16843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
16853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
16863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 't':
16873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
16883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("text-font",option+1) == 0)
16893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
16903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.text_font=(char *) NULL;
16913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
16923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
16933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1694bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
16953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
16963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.text_font=XGetResourceClass(resource_database,
16973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              GetClientName(),"font",argv[i]);
16983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
16993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("texture",option+1) == 0)
17013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1705bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("threshold",option+1) == 0)
17103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1714bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
17173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
17183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("thumbnail",option+1) == 0)
17213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1725bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
17283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
17293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("title",option+1) == 0)
17323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.title=(char *) NULL;
17343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1737bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.title=argv[i];
17403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("transparent-color",option+1) == 0)
17433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1747bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
17483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("treedepth",option+1) == 0)
17523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            quantize_info->tree_depth=0;
17543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1757bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
17603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
1761e27293e706ca05b6b121e9512a83b16f7ad887f2cristy            quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
17623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("trim",option+1) == 0)
17653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
17663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
17673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
17683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'u':
17693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
17703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("update",option+1) == 0)
17713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.update=(unsigned int) (*option == '-');
17733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
17743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
17753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1776bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
17773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
17783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsGeometry(argv[i]) == MagickFalse)
17793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayInvalidArgumentException(option,argv[i]);
1780e27293e706ca05b6b121e9512a83b16f7ad887f2cristy            resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
17813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("use-pixmap",option+1) == 0)
17843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
17853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.use_pixmap=(*option == '-') ? MagickTrue :
17863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              MagickFalse;
17873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
17883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
17893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
17903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
17913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'v':
17923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
17933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("verbose",option+1) == 0)
17943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          break;
17953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if ((LocaleCompare("version",option+1) == 0) ||
17963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            (LocaleCompare("-version",option+1) == 0))
17973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1798b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy            (void) FormatLocaleFile(stdout,"Version: %s\n",
1799bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy              GetMagickVersion((size_t *) NULL));
18001e604812fad85bb96f757a2393015ae3d061c39acristy            (void) FormatLocaleFile(stdout,"Copyright: %s\n",
18011e604812fad85bb96f757a2393015ae3d061c39acristy              GetMagickCopyright());
18021e604812fad85bb96f757a2393015ae3d061c39acristy            (void) FormatLocaleFile(stdout,"Features: %s\n\n",
18031e604812fad85bb96f757a2393015ae3d061c39acristy              GetMagickFeatures());
18043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("visual",option+1) == 0)
18073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
18083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.visual_type=(char *) NULL;
18093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
18103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
18113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1812bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
18133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
18143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.visual_type=argv[i];
18153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("virtual-pixel",option+1) == 0)
18183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
1819bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            ssize_t
18203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              method;
18213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
18223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
18233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
18243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1825bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) (argc-1))
18263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1827042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy            method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
18283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              argv[i]);
18293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (method < 0)
18303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,
18313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                "UnrecognizedVirtualPixelMethod",argv[i]);
18323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
18353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
18363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case 'w':
18373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      {
18383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("window",option+1) == 0)
18393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
18403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.window_id=(char *) NULL;
18413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
18423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
18433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1844bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
18453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
18463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.window_id=argv[i];
18473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("window-group",option+1) == 0)
18503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
18513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.window_group=(char *) NULL;
18523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
18533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
18543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1855bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
18563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
1857dbdd0e35efc03c9bccda644f5407db38b7c17eeccristy            if (StringToDouble(argv[i],(char **) NULL) != 0)
18583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              resource_info.window_group=argv[i];
18593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        if (LocaleCompare("write",option+1) == 0)
18623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          {
18633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.write_filename=(char *) NULL;
18643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (*option == '+')
18653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              break;
18663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            i++;
1867bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy            if (i == (ssize_t) argc)
18683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              ThrowDisplayException(OptionError,"MissingArgument",option);
18693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            resource_info.write_filename=argv[i];
18703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
18713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              {
18723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                char
18733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  answer[2],
18743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  *p;
18753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1876b51dff5c0d16a4c1b69ff683e786cb3b4c467694cristy                (void) FormatLocaleFile(stderr,"Overwrite %s? ",
18773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  resource_info.write_filename);
18783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                p=fgets(answer,(int) sizeof(answer),stdin);
1879da16f16767eb31921af855f17bda465fffc4e000cristy                (void) p;
18803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                if (((*answer != 'y') && (*answer != 'Y')))
18813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy                  return(MagickFalse);
18823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy              }
18833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy            break;
18843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy          }
18853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
18863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      }
18873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      case '?':
18883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        break;
18893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      default:
18903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy        ThrowDisplayException(OptionError,"UnrecognizedOption",option);
18913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
1892042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy    fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1893042ee78fa9004bf1ac6a95f09d9d1faca631dda1cristy      FireOptionFlag) == 0 ?  MagickFalse : MagickTrue;
18943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    if (fire != MagickFalse)
18953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      FireImageStack(MagickFalse,MagickTrue,MagickTrue);
18963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  }
18973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (k != 0)
18983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
18993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (state & RetainColorsState)
19003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
19013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
19023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      (void) XSync(display,MagickFalse);
19033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
19043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DestroyDisplay();
19053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(status != 0 ? MagickTrue : MagickFalse);
19063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#else
19073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) argc;
19083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) argv;
19093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1910e5b39652d8d21bc3940d83b8d6088d4070a8a34aanthony    "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
19113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  return(DisplayUsage());
19123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif
19133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1914