2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % DDDD IIIII SSSSS PPPP L AAA Y Y %
7 % D D I SS P P L A A Y Y %
8 % D D I SSS PPPP L AAAAA Y %
10 % DDDD IIIII SSSSS P LLLLL A A Y %
13 % Methods to Interactively Display and Edit an Image %
20 % Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
26 % http://www.imagemagick.org/script/license.php %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 % Use the display program to display an image or image sequence on any X
44 #include "MagickWand/studio.h"
45 #include "MagickWand/MagickWand.h"
46 #include "MagickWand/mogrify-private.h"
47 #include "MagickCore/display-private.h"
48 #include "MagickCore/string-private.h"
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55 + D i s p l a y I m a g e C o m m a n d %
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 % DisplayImageCommand() displays a sequence of images on any workstation
62 % display running an X server. Display first determines the hardware
63 % capabilities of the workstation. If the number of unique colors in an image
64 % is less than or equal to the number the workstation can support, the image
65 % is displayed in an X window. Otherwise the number of colors in the image is
66 % first reduced to match the color resolution of the workstation before it is
69 % This means that a continuous-tone 24 bits/pixel image can display on a 8
70 % bit pseudo-color device or monochrome device. In most instances the reduced
71 % color image closely resembles the original. Alternatively, a monochrome or
72 % pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
75 % The format of the DisplayImageCommand method is:
77 % MagickBooleanType DisplayImageCommand(ImageInfo *image_info,int argc,
78 % char **argv,char **metadata,ExceptionInfo *exception)
80 % A description of each parameter follows:
82 % o image_info: the image info.
84 % o argc: the number of elements in the argument vector.
86 % o argv: A text array containing the command line arguments.
88 % o metadata: any metadata is returned here.
90 % o exception: return any errors or warnings in this structure.
94 static MagickBooleanType DisplayUsage(void)
102 "1 press to map or unmap the Command widget",
103 "2 press and drag to magnify a region of an image",
104 "3 press to load an image from a visual image directory",
109 "-debug events display copious debugging information",
110 "-help print program options",
111 "-list type print a list of supported option arguments",
112 "-log format format of debugging information",
113 "-version print version information",
118 "-auto-orient automagically orient image",
119 "-border geometry surround image with a border of color",
120 "-clip clip along the first path from the 8BIM profile",
121 "-clip-path id clip along a named path from the 8BIM profile",
122 "-colors value preferred number of colors in the image",
123 "-contrast enhance or reduce the image contrast",
124 "-crop geometry preferred size and location of the cropped image",
125 "-decipher filename convert cipher pixels to plain pixels",
126 "-deskew threshold straighten an image",
127 "-despeckle reduce the speckles within an image",
128 "-edge factor apply a filter to detect edges in the image",
129 "-enhance apply a digital filter to enhance a noisy image",
130 "-equalize perform histogram equalization to an image",
131 "-extract geometry extract area from image",
132 "-flip flip image in the vertical direction",
133 "-flop flop image in the horizontal direction",
134 "-frame geometry surround image with an ornamental border",
135 "-fuzz distance colors within this distance are considered equal",
136 "-gamma value level of gamma correction",
137 "-monochrome transform image to black and white",
138 "-negate replace every pixel with its complementary color",
139 "-normalize transform image to span the full range of colors",
140 "-raise value lighten/darken image edges to create a 3-D effect",
141 "-resample geometry change the resolution of an image",
142 "-resize geometry resize the image",
143 "-roll geometry roll an image vertically or horizontally",
144 "-rotate degrees apply Paeth rotation to the image",
145 "-sample geometry scale image with pixel sampling",
146 "-segment value segment an image",
147 "-sharpen geometry sharpen the image",
148 "-strip strip image of all profiles and comments",
149 "-threshold value threshold the image",
150 "-thumbnail geometry create a thumbnail of the image",
151 "-trim trim image edges",
156 "-alpha option on, activate, off, deactivate, set, opaque, copy",
157 " transparent, extract, background, or shape",
158 "-antialias remove pixel-aliasing",
159 "-authenticate password",
160 " decipher image with this password",
161 "-backdrop display image centered on a backdrop",
162 "-channel type apply option to select image channels",
163 "-colormap type Shared or Private",
164 "-colorspace type alternate image colorspace",
165 "-comment string annotate image with comment",
166 "-compress type type of pixel compression when writing the image",
167 "-define format:option",
168 " define one or more image format options",
169 "-delay value display the next image after pausing",
170 "-density geometry horizontal and vertical density of the image",
171 "-depth value image depth",
172 "-display server display image to this X server",
173 "-dispose method layer disposal method",
174 "-dither method apply error diffusion to image",
175 "-endian type endianness (MSB or LSB) of the image",
176 "-filter type use this filter when resizing an image",
177 "-format string output formatted image characteristics",
178 "-geometry geometry preferred size and location of the Image window",
179 "-gravity type horizontal and vertical backdrop placement",
180 "-identify identify the format and characteristics of the image",
181 "-immutable displayed image cannot be modified",
182 "-interlace type type of image interlacing scheme",
183 "-interpolate method pixel color interpolation method",
184 "-label string assign a label to an image",
185 "-limit type value pixel cache resource limit",
186 "-loop iterations loop images then exit",
187 "-map type display image using this Standard Colormap",
188 "-matte store matte channel if the image has one",
189 "-monitor monitor progress",
190 "-page geometry size and location of an image canvas",
191 "-profile filename add, delete, or apply an image profile",
192 "-quality value JPEG/MIFF/PNG compression level",
193 "-quantize colorspace reduce colors in this colorspace",
194 "-quiet suppress all warning messages",
195 "-regard-warnings pay attention to warning messages",
196 "-remote command execute a command in an remote display process",
197 "-repage geometry size and location of an image canvas (operator)",
198 "-respect-parentheses settings remain in effect until parenthesis boundary",
199 "-sampling-factor geometry",
200 " horizontal and vertical sampling factor",
201 "-scenes range image scene range",
202 "-seed value seed a new sequence of pseudo-random numbers",
203 "-set property value set an image property",
204 "-size geometry width and height of image",
205 "-support factor resize support: > 1.0 is blurry, < 1.0 is sharp",
206 "-texture filename name of texture to tile onto the image background",
207 "-transparent-color color",
208 " transparent color",
209 "-treedepth value color tree depth",
210 "-update seconds detect when image file is modified and redisplay",
211 "-verbose print detailed information about the image",
212 "-visual type display image using this visual type",
213 "-virtual-pixel method",
214 " virtual pixel access method",
215 "-window id display image to background of this window",
216 "-window-group id exit program when this window id is destroyed",
217 "-write filename write image to a file",
220 *sequence_operators[]=
222 "-coalesce merge a sequence of images",
223 "-flatten flatten a sequence of images",
227 ListMagickVersion(stdout);
228 (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
230 (void) printf("\nImage Settings:\n");
231 for (p=settings; *p != (char *) NULL; p++)
232 (void) printf(" %s\n",*p);
233 (void) printf("\nImage Operators:\n");
234 for (p=operators; *p != (char *) NULL; p++)
235 (void) printf(" %s\n",*p);
236 (void) printf("\nImage Sequence Operators:\n");
237 for (p=sequence_operators; *p != (char *) NULL; p++)
238 (void) printf(" %s\n",*p);
239 (void) printf("\nMiscellaneous Options:\n");
240 for (p=miscellaneous; *p != (char *) NULL; p++)
241 (void) printf(" %s\n",*p);
243 "\nIn addition to those listed above, you can specify these standard X\n");
245 "resources as command line options: -background, -bordercolor,\n");
247 " -mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n");
248 (void) printf("-iconic, -name, -shared-memory, -usePixmap, or -title.\n");
250 "\nBy default, the image format of 'file' is determined by its magic\n");
252 "number. To specify a particular image format, precede the filename\n");
254 "with an image format name and a colon (i.e. ps:image) or specify the\n");
256 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
257 (void) printf("'-' for standard input or output.\n");
258 (void) printf("\nButtons: \n");
259 for (p=buttons; *p != (char *) NULL; p++)
260 (void) printf(" %s\n",*p);
264 WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
265 int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
267 #if defined(MAGICKCORE_X11_DELEGATE)
268 #define DestroyDisplay() \
270 if ((state & ExitState) == 0) \
271 DestroyXResources(); \
272 if (display != (Display *) NULL) \
274 XCloseDisplay(display); \
275 display=(Display *) NULL; \
277 XDestroyResourceInfo(&resource_info); \
278 DestroyImageStack(); \
279 if (image_marker != (size_t *) NULL) \
280 image_marker=(size_t *) RelinquishMagickMemory(image_marker); \
281 for (i=0; i < (ssize_t) argc; i++) \
282 argv[i]=DestroyString(argv[i]); \
283 argv=(char **) RelinquishMagickMemory(argv); \
285 #define ThrowDisplayException(asperity,tag,option) \
287 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
290 return(MagickFalse); \
292 #define ThrowDisplayInvalidArgumentException(option,argument) \
294 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
295 "InvalidArgument","'%s': %s",option,argument); \
297 return(MagickFalse); \
314 image_stack[MaxImageStackDepth+1];
352 assert(image_info != (ImageInfo *) NULL);
353 assert(image_info->signature == MagickCoreSignature);
354 if (image_info->debug != MagickFalse)
355 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
356 assert(exception != (ExceptionInfo *) NULL);
360 if ((LocaleCompare("version",option+1) == 0) ||
361 (LocaleCompare("-version",option+1) == 0))
363 ListMagickVersion(stdout);
368 display=(Display *) NULL;
371 image_marker=(size_t *) NULL;
375 option=(char *) NULL;
377 respect_parenthesis=MagickFalse;
378 resource_database=(XrmDatabase) NULL;
379 (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
380 server_name=(char *) NULL;
383 ReadCommandlLine(argc,&argv);
384 status=ExpandFilenames(&argc,&argv);
385 if (status == MagickFalse)
386 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
387 GetExceptionMessage(errno));
388 image_marker=(size_t *) AcquireQuantumMemory((size_t) argc+1UL,
389 sizeof(*image_marker));
390 if (image_marker == (size_t *) NULL)
391 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
392 GetExceptionMessage(errno));
393 for (i=0; i <= (ssize_t) argc; i++)
394 image_marker[i]=(size_t) argc;
396 Check for server name specified on the command line.
398 for (i=1; i < (ssize_t) argc; i++)
401 Check command line for server name.
404 if (LocaleCompare("display",option+1) == 0)
407 User specified server name.
410 if (i == (ssize_t) argc)
411 ThrowDisplayException(OptionError,"MissingArgument",option);
414 if ((LocaleCompare("help",option+1) == 0) ||
415 (LocaleCompare("-help",option+1) == 0))
416 return(DisplayUsage());
419 Get user defaults from X resource database.
421 display=XOpenDisplay(server_name);
422 if (display == (Display *) NULL)
423 ThrowDisplayException(XServerError,"UnableToOpenXServer",
424 XDisplayName(server_name));
425 (void) XSetErrorHandler(XError);
426 resource_database=XGetResourceDatabase(display,GetClientName());
427 XGetResourceInfo(image_info,resource_database,GetClientName(),
429 quantize_info=resource_info.quantize_info;
430 image_info->density=XGetResourceInstance(resource_database,GetClientName(),
431 "density",(char *) NULL);
432 if (image_info->density == (char *) NULL)
433 image_info->density=XGetScreenDensity(display);
434 resource_value=XGetResourceInstance(resource_database,GetClientName(),
436 image_info->interlace=(InterlaceType)
437 ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value);
438 image_info->page=XGetResourceInstance(resource_database,GetClientName(),
439 "pageGeometry",(char *) NULL);
440 resource_value=XGetResourceInstance(resource_database,GetClientName(),
442 image_info->quality=StringToUnsignedLong(resource_value);
443 resource_value=XGetResourceInstance(resource_database,GetClientName(),
445 image_info->verbose=IsStringTrue(resource_value);
446 resource_value=XGetResourceInstance(resource_database,GetClientName(),
448 quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ?
449 RiemersmaDitherMethod : NoDitherMethod;
454 for (i=1; ((i <= (ssize_t) argc) && ((state & ExitState) == 0)); i++)
456 if (i < (ssize_t) argc)
459 if (image != (Image *) NULL)
462 if (isatty(STDIN_FILENO) != MagickFalse)
466 if (LocaleCompare(option,"(") == 0)
468 FireImageStack(MagickFalse,MagickTrue,pend);
469 if (k == MaxImageStackDepth)
470 ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply",
475 if (LocaleCompare(option,")") == 0)
477 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
479 ThrowDisplayException(OptionError,"UnableToParseExpression",option);
483 if (IsCommandOption(option) == MagickFalse)
494 Option is a file name.
496 FireImageStack(MagickFalse,MagickFalse,pend);
498 if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
503 (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
504 images=ReadImage(image_info,exception);
505 CatchException(exception);
506 status&=(images != (Image *) NULL) &&
507 (exception->severity < ErrorException);
508 if (images == (Image *) NULL)
510 AppendImageStack(images);
511 FinalizeImageSettings(image_info,image,MagickFalse);
512 iterations=image->iterations;
513 image_list=CloneImageList(image,exception);
514 if (image_list == (Image *) NULL)
515 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
516 GetExceptionMessage(errno));
517 display_image=image_list;
521 Transmogrify image as defined by the image processing options.
523 resource_info.quantum=1;
524 if (resource_info.window_id != (char *) NULL)
527 Display image to a specified X window.
529 status=XDisplayBackgroundImage(display,&resource_info,
530 display_image,exception);
531 if (status != MagickFalse)
533 state|=RetainColorsState;
536 if (GetNextImageInList(display_image) == (Image *) NULL)
546 Display image to X server.
548 if (resource_info.delay != 1)
549 display_image->delay=resource_info.delay;
550 nexus=XDisplayImage(display,&resource_info,argv,argc,
551 &display_image,&state,exception);
552 if (nexus == (Image *) NULL)
554 while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
559 if (nexus->montage != (char *) NULL)
562 User selected a visual directory image (montage).
567 next=XDisplayImage(display,&resource_info,argv,argc,&nexus,
569 if ((next == (Image *) NULL) &&
570 (GetNextImageInList(nexus) != (Image *) NULL))
572 display_image=GetNextImageInList(nexus);
573 nexus=NewImageList();
577 if (nexus != display_image)
578 nexus=DestroyImageList(nexus);
582 } while ((state & ExitState) == 0);
583 if (resource_info.write_filename != (char *) NULL)
588 (void) CopyMagickString(display_image->filename,
589 resource_info.write_filename,MagickPathExtent);
590 (void) SetImageInfo(image_info,1,exception);
591 status&=WriteImage(image_info,display_image,exception);
594 Proceed to next/previous image.
596 if ((state & FormerImageState) != 0)
597 for (l=0; l < (ssize_t) resource_info.quantum; l++)
599 if (GetPreviousImageInList(display_image) == (Image *) NULL)
601 display_image=GetPreviousImageInList(display_image);
604 for (l=0; l < (ssize_t) resource_info.quantum; l++)
606 if (GetNextImageInList(display_image) == (Image *) NULL)
608 display_image=GetNextImageInList(display_image);
610 if (l < (ssize_t) resource_info.quantum)
612 } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
614 Free image resources.
616 display_image=DestroyImageList(display_image);
617 if ((state & FormerImageState) == 0)
619 last_image=(size_t) image_number;
620 image_marker[i]=(size_t) image_number++;
625 Proceed to previous image.
627 for (i--; i > 0; i--)
628 if (image_marker[i] == (size_t) (image_number-2))
632 if ((i == (ssize_t) argc) && ((state & ExitState) == 0))
634 if ((state & ExitState) != 0)
637 Determine if we should proceed to the first image.
639 if (image_number < 0)
641 if ((state & FormerImageState) != 0)
644 for (i=1; i < (ssize_t) (argc-2); i++)
645 if (last_image == image_marker[i])
647 image_number=(ssize_t) image_marker[i]+1;
651 if (resource_info.window_id != (char *) NULL)
655 if (++iteration == (ssize_t) iterations)
659 if (LocaleCompare(filename,"-") == 0)
661 RemoveAllImageStack();
664 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
669 if (LocaleCompare("alpha",option+1) == 0)
677 if (i == (ssize_t) argc)
678 ThrowDisplayException(OptionError,"MissingArgument",option);
679 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
682 ThrowDisplayException(OptionError,
683 "UnrecognizedAlphaChannelOption",argv[i]);
686 if (LocaleCompare("antialias",option+1) == 0)
688 if (LocaleCompare("authenticate",option+1) == 0)
693 if (i == (ssize_t) argc)
694 ThrowDisplayException(OptionError,"MissingArgument",option);
697 if (LocaleCompare("auto-orient",option+1) == 0)
699 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
703 if (LocaleCompare("backdrop",option+1) == 0)
705 resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
708 if (LocaleCompare("background",option+1) == 0)
713 if (i == (ssize_t) argc)
714 ThrowDisplayException(OptionError,"MissingArgument",option);
715 resource_info.background_color=argv[i];
718 if (LocaleCompare("border",option+1) == 0)
723 if (i == (ssize_t) argc)
724 ThrowDisplayException(OptionError,"MissingArgument",option);
725 if (IsGeometry(argv[i]) == MagickFalse)
726 ThrowDisplayInvalidArgumentException(option,argv[i]);
729 if (LocaleCompare("bordercolor",option+1) == 0)
734 if (i == (ssize_t) argc)
735 ThrowDisplayException(OptionError,"MissingArgument",option);
736 resource_info.border_color=argv[i];
739 if (LocaleCompare("borderwidth",option+1) == 0)
741 resource_info.border_width=0;
745 if (i == (ssize_t) argc)
746 ThrowDisplayException(OptionError,"MissingArgument",option);
747 if (IsGeometry(argv[i]) == MagickFalse)
748 ThrowDisplayInvalidArgumentException(option,argv[i]);
749 resource_info.border_width=(unsigned int)
750 StringToUnsignedLong(argv[i]);
753 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
757 if (LocaleCompare("cache",option+1) == 0)
762 if (i == (ssize_t) argc)
763 ThrowDisplayException(OptionError,"MissingArgument",option);
764 if (IsGeometry(argv[i]) == MagickFalse)
765 ThrowDisplayInvalidArgumentException(option,argv[i]);
768 if (LocaleCompare("channel",option+1) == 0)
776 if (i == (ssize_t) argc)
777 ThrowDisplayException(OptionError,"MissingArgument",option);
778 channel=ParseChannelOption(argv[i]);
780 ThrowDisplayException(OptionError,"UnrecognizedChannelType",
784 if (LocaleCompare("clip",option+1) == 0)
786 if (LocaleCompare("clip-path",option+1) == 0)
789 if (i == (ssize_t) argc)
790 ThrowDisplayException(OptionError,"MissingArgument",option);
793 if (LocaleCompare("coalesce",option+1) == 0)
795 if (LocaleCompare("colormap",option+1) == 0)
797 resource_info.colormap=PrivateColormap;
801 if (i == (ssize_t) argc)
802 ThrowDisplayException(OptionError,"MissingArgument",option);
803 resource_info.colormap=UndefinedColormap;
804 if (LocaleCompare("private",argv[i]) == 0)
805 resource_info.colormap=PrivateColormap;
806 if (LocaleCompare("shared",argv[i]) == 0)
807 resource_info.colormap=SharedColormap;
808 if (resource_info.colormap == UndefinedColormap)
809 ThrowDisplayException(OptionError,"UnrecognizedColormapType",
813 if (LocaleCompare("colors",option+1) == 0)
815 quantize_info->number_colors=0;
819 if (i == (ssize_t) argc)
820 ThrowDisplayException(OptionError,"MissingArgument",option);
821 if (IsGeometry(argv[i]) == MagickFalse)
822 ThrowDisplayInvalidArgumentException(option,argv[i]);
823 quantize_info->number_colors=StringToUnsignedLong(argv[i]);
826 if (LocaleCompare("colorspace",option+1) == 0)
834 if (i == (ssize_t) argc)
835 ThrowDisplayException(OptionError,"MissingArgument",option);
836 colorspace=ParseCommandOption(MagickColorspaceOptions,
837 MagickFalse,argv[i]);
839 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
843 if (LocaleCompare("comment",option+1) == 0)
848 if (i == (ssize_t) argc)
849 ThrowDisplayException(OptionError,"MissingArgument",option);
852 if (LocaleCompare("compress",option+1) == 0)
860 if (i == (ssize_t) argc)
861 ThrowDisplayException(OptionError,"MissingArgument",option);
862 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
865 ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
869 if (LocaleCompare("concurrent",option+1) == 0)
871 if (LocaleCompare("contrast",option+1) == 0)
873 if (LocaleCompare("crop",option+1) == 0)
878 if (i == (ssize_t) argc)
879 ThrowDisplayException(OptionError,"MissingArgument",option);
880 if (IsGeometry(argv[i]) == MagickFalse)
881 ThrowDisplayInvalidArgumentException(option,argv[i]);
884 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
888 if (LocaleCompare("debug",option+1) == 0)
896 if (i == (ssize_t) argc)
897 ThrowDisplayException(OptionError,"MissingArgument",option);
898 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
900 ThrowDisplayException(OptionError,"UnrecognizedEventType",
902 (void) SetLogEventMask(argv[i]);
905 if (LocaleCompare("decipher",option+1) == 0)
910 if (i == (ssize_t) argc)
911 ThrowDisplayException(OptionError,"MissingArgument",option);
914 if (LocaleCompare("define",option+1) == 0)
917 if (i == (ssize_t) argc)
918 ThrowDisplayException(OptionError,"MissingArgument",option);
924 define=GetImageOption(image_info,argv[i]);
925 if (define == (const char *) NULL)
926 ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
931 if (LocaleCompare("delay",option+1) == 0)
936 if (i == (ssize_t) argc)
937 ThrowDisplayException(OptionError,"MissingArgument",option);
938 if (IsGeometry(argv[i]) == MagickFalse)
939 ThrowDisplayInvalidArgumentException(option,argv[i]);
942 if (LocaleCompare("density",option+1) == 0)
947 if (i == (ssize_t) argc)
948 ThrowDisplayException(OptionError,"MissingArgument",option);
949 if (IsGeometry(argv[i]) == MagickFalse)
950 ThrowDisplayInvalidArgumentException(option,argv[i]);
953 if (LocaleCompare("depth",option+1) == 0)
958 if (i == (ssize_t) argc)
959 ThrowDisplayException(OptionError,"MissingArgument",option);
960 if (IsGeometry(argv[i]) == MagickFalse)
961 ThrowDisplayInvalidArgumentException(option,argv[i]);
964 if (LocaleCompare("deskew",option+1) == 0)
969 if (i == (ssize_t) argc)
970 ThrowDisplayException(OptionError,"MissingArgument",option);
971 if (IsGeometry(argv[i]) == MagickFalse)
972 ThrowDisplayInvalidArgumentException(option,argv[i]);
975 if (LocaleCompare("despeckle",option+1) == 0)
977 if (LocaleCompare("display",option+1) == 0)
982 if (i == (ssize_t) argc)
983 ThrowDisplayException(OptionError,"MissingArgument",option);
986 if (LocaleCompare("dispose",option+1) == 0)
994 if (i == (ssize_t) argc)
995 ThrowDisplayException(OptionError,"MissingArgument",option);
996 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
998 ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
1002 if (LocaleCompare("dither",option+1) == 0)
1007 quantize_info->dither_method=NoDitherMethod;
1011 if (i == (ssize_t) argc)
1012 ThrowDisplayException(OptionError,"MissingArgument",option);
1013 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1015 ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
1017 quantize_info->dither_method=(DitherMethod) method;
1020 if (LocaleCompare("duration",option+1) == 0)
1025 if (i == (ssize_t) argc)
1026 ThrowDisplayException(OptionError,"MissingArgument",option);
1027 if (IsGeometry(argv[i]) == MagickFalse)
1028 ThrowDisplayInvalidArgumentException(option,argv[i]);
1031 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1035 if (LocaleCompare("edge",option+1) == 0)
1040 if (i == (ssize_t) argc)
1041 ThrowDisplayException(OptionError,"MissingArgument",option);
1042 if (IsGeometry(argv[i]) == MagickFalse)
1043 ThrowDisplayInvalidArgumentException(option,argv[i]);
1046 if (LocaleCompare("endian",option+1) == 0)
1054 if (i == (ssize_t) argc)
1055 ThrowDisplayException(OptionError,"MissingArgument",option);
1056 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1059 ThrowDisplayException(OptionError,"UnrecognizedEndianType",
1063 if (LocaleCompare("enhance",option+1) == 0)
1065 if (LocaleCompare("equalize",option+1) == 0)
1067 if (LocaleCompare("extract",option+1) == 0)
1072 if (i == (ssize_t) argc)
1073 ThrowDisplayException(OptionError,"MissingArgument",option);
1074 if (IsGeometry(argv[i]) == MagickFalse)
1075 ThrowDisplayInvalidArgumentException(option,argv[i]);
1078 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1082 if (LocaleCompare("filter",option+1) == 0)
1090 if (i == (ssize_t) argc)
1091 ThrowDisplayException(OptionError,"MissingArgument",option);
1092 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1094 ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
1098 if (LocaleCompare("flatten",option+1) == 0)
1100 if (LocaleCompare("flip",option+1) == 0)
1102 if (LocaleCompare("flop",option+1) == 0)
1104 if (LocaleCompare("font",option+1) == 0)
1109 if (i == (ssize_t) argc)
1110 ThrowDisplayException(OptionError,"MissingArgument",option);
1111 resource_info.font=XGetResourceClass(resource_database,
1112 GetClientName(),"font",argv[i]);
1115 if (LocaleCompare("foreground",option+1) == 0)
1120 if (i == (ssize_t) argc)
1121 ThrowDisplayException(OptionError,"MissingArgument",option);
1122 resource_info.foreground_color=argv[i];
1125 if (LocaleCompare("format",option+1) == 0)
1130 if (i == (ssize_t) argc)
1131 ThrowDisplayException(OptionError,"MissingArgument",option);
1134 if (LocaleCompare("frame",option+1) == 0)
1139 if (i == (ssize_t) argc)
1140 ThrowDisplayException(OptionError,"MissingArgument",option);
1141 if (IsGeometry(argv[i]) == MagickFalse)
1142 ThrowDisplayInvalidArgumentException(option,argv[i]);
1145 if (LocaleCompare("fuzz",option+1) == 0)
1150 if (i == (ssize_t) argc)
1151 ThrowDisplayException(OptionError,"MissingArgument",option);
1152 if (IsGeometry(argv[i]) == MagickFalse)
1153 ThrowDisplayInvalidArgumentException(option,argv[i]);
1156 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1160 if (LocaleCompare("gamma",option+1) == 0)
1163 if (i == (ssize_t) argc)
1164 ThrowDisplayException(OptionError,"MissingArgument",option);
1165 if (IsGeometry(argv[i]) == MagickFalse)
1166 ThrowDisplayInvalidArgumentException(option,argv[i]);
1169 if (LocaleCompare("geometry",option+1) == 0)
1171 resource_info.image_geometry=(char *) NULL;
1174 (void) CopyMagickString(argv[i]+1,"sans",MagickPathExtent);
1176 if (i == (ssize_t) argc)
1177 ThrowDisplayException(OptionError,"MissingArgument",option);
1178 if (IsGeometry(argv[i]) == MagickFalse)
1179 ThrowDisplayInvalidArgumentException(option,argv[i]);
1180 resource_info.image_geometry=ConstantString(argv[i]);
1183 if (LocaleCompare("gravity",option+1) == 0)
1191 if (i == (ssize_t) argc)
1192 ThrowDisplayException(OptionError,"MissingArgument",option);
1193 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1196 ThrowDisplayException(OptionError,"UnrecognizedGravityType",
1200 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1204 if ((LocaleCompare("help",option+1) == 0) ||
1205 (LocaleCompare("-help",option+1) == 0))
1207 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1211 if (LocaleCompare("identify",option+1) == 0)
1213 if (LocaleCompare("iconGeometry",option+1) == 0)
1215 resource_info.icon_geometry=(char *) NULL;
1219 if (i == (ssize_t) argc)
1220 ThrowDisplayException(OptionError,"MissingArgument",option);
1221 if (IsGeometry(argv[i]) == MagickFalse)
1222 ThrowDisplayInvalidArgumentException(option,argv[i]);
1223 resource_info.icon_geometry=argv[i];
1226 if (LocaleCompare("iconic",option+1) == 0)
1228 resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
1231 if (LocaleCompare("immutable",option+1) == 0)
1233 resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
1236 if (LocaleCompare("interlace",option+1) == 0)
1244 if (i == (ssize_t) argc)
1245 ThrowDisplayException(OptionError,"MissingArgument",option);
1246 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1249 ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
1253 if (LocaleCompare("interpolate",option+1) == 0)
1261 if (i == (ssize_t) argc)
1262 ThrowDisplayException(OptionError,"MissingArgument",option);
1263 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1265 if (interpolate < 0)
1266 ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
1270 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1274 if (LocaleCompare("label",option+1) == 0)
1279 if (i == (ssize_t) argc)
1280 ThrowDisplayException(OptionError,"MissingArgument",option);
1283 if (LocaleCompare("limit",option+1) == 0)
1297 if (i == (ssize_t) argc)
1298 ThrowDisplayException(OptionError,"MissingArgument",option);
1299 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
1302 ThrowDisplayException(OptionError,"UnrecognizedResourceType",
1305 if (i == (ssize_t) argc)
1306 ThrowDisplayException(OptionError,"MissingArgument",option);
1307 value=StringToDouble(argv[i],&p);
1309 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
1310 ThrowDisplayInvalidArgumentException(option,argv[i]);
1313 if (LocaleCompare("list",option+1) == 0)
1321 if (i == (ssize_t) argc)
1322 ThrowDisplayException(OptionError,"MissingArgument",option);
1323 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
1325 ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1326 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
1329 return(status == 0 ? MagickTrue : MagickFalse);
1331 if (LocaleCompare("log",option+1) == 0)
1336 if ((i == (ssize_t) argc) ||
1337 (strchr(argv[i],'%') == (char *) NULL))
1338 ThrowDisplayException(OptionError,"MissingArgument",option);
1341 if (LocaleCompare("loop",option+1) == 0)
1346 if (i == (ssize_t) argc)
1347 ThrowDisplayException(OptionError,"MissingArgument",option);
1348 if (IsGeometry(argv[i]) == MagickFalse)
1349 ThrowDisplayInvalidArgumentException(option,argv[i]);
1350 iterations=StringToUnsignedLong(argv[i]);
1353 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1357 if (LocaleCompare("magnify",option+1) == 0)
1359 resource_info.magnify=2;
1363 if (i == (ssize_t) argc)
1364 ThrowDisplayException(OptionError,"MissingArgument",option);
1365 if (IsGeometry(argv[i]) == MagickFalse)
1366 ThrowDisplayInvalidArgumentException(option,argv[i]);
1367 resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
1370 if (LocaleCompare("map",option+1) == 0)
1372 resource_info.map_type=(char *) NULL;
1375 (void) strcpy(argv[i]+1,"san");
1377 if (i == (ssize_t) argc)
1378 ThrowDisplayException(OptionError,"MissingArgument",option);
1379 resource_info.map_type=argv[i];
1382 if (LocaleCompare("matte",option+1) == 0)
1384 if (LocaleCompare("mattecolor",option+1) == 0)
1389 if (i == (ssize_t) argc)
1390 ThrowDisplayException(OptionError,"MissingArgument",option);
1391 resource_info.matte_color=argv[i];
1394 if (LocaleCompare("monitor",option+1) == 0)
1396 if (LocaleCompare("monochrome",option+1) == 0)
1400 quantize_info->number_colors=2;
1401 quantize_info->colorspace=GRAYColorspace;
1404 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1408 if (LocaleCompare("name",option+1) == 0)
1410 resource_info.name=(char *) NULL;
1414 if (i == (ssize_t) argc)
1415 ThrowDisplayException(OptionError,"MissingArgument",option);
1416 resource_info.name=ConstantString(argv[i]);
1419 if (LocaleCompare("negate",option+1) == 0)
1421 if (LocaleCompare("noop",option+1) == 0)
1423 if (LocaleCompare("normalize",option+1) == 0)
1425 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1429 if (LocaleCompare("page",option+1) == 0)
1431 resource_info.image_geometry=(char *) NULL;
1435 if (i == (ssize_t) argc)
1436 ThrowDisplayException(OptionError,"MissingArgument",option);
1437 resource_info.image_geometry=ConstantString(argv[i]);
1440 if (LocaleCompare("profile",option+1) == 0)
1443 if (i == (ssize_t) argc)
1444 ThrowDisplayException(OptionError,"MissingArgument",option);
1447 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1451 if (LocaleCompare("quality",option+1) == 0)
1456 if (i == (ssize_t) argc)
1457 ThrowDisplayException(OptionError,"MissingArgument",option);
1458 if (IsGeometry(argv[i]) == MagickFalse)
1459 ThrowDisplayInvalidArgumentException(option,argv[i]);
1462 if (LocaleCompare("quantize",option+1) == 0)
1470 if (i == (ssize_t) argc)
1471 ThrowDisplayException(OptionError,"MissingArgument",option);
1472 colorspace=ParseCommandOption(MagickColorspaceOptions,
1473 MagickFalse,argv[i]);
1475 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
1479 if (LocaleCompare("quiet",option+1) == 0)
1481 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1485 if (LocaleCompare("raise",option+1) == 0)
1488 if (i == (ssize_t) argc)
1489 ThrowDisplayException(OptionError,"MissingArgument",option);
1490 if (IsGeometry(argv[i]) == MagickFalse)
1491 ThrowDisplayInvalidArgumentException(option,argv[i]);
1494 if (LocaleCompare("regard-warnings",option+1) == 0)
1496 if (LocaleCompare("remote",option+1) == 0)
1499 if (i == (ssize_t) argc)
1500 ThrowDisplayException(OptionError,"MissingArgument",option);
1501 if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1502 return(MagickFalse);
1506 if (LocaleCompare("repage",option+1) == 0)
1511 if (i == (ssize_t) argc)
1512 ThrowDisplayException(OptionError,"MissingArgument",option);
1513 if (IsGeometry(argv[i]) == MagickFalse)
1514 ThrowDisplayInvalidArgumentException(option,argv[i]);
1517 if (LocaleCompare("resample",option+1) == 0)
1522 if (i == (ssize_t) argc)
1523 ThrowDisplayException(OptionError,"MissingArgument",option);
1524 if (IsGeometry(argv[i]) == MagickFalse)
1525 ThrowDisplayInvalidArgumentException(option,argv[i]);
1528 if (LocaleCompare("resize",option+1) == 0)
1533 if (i == (ssize_t) argc)
1534 ThrowDisplayException(OptionError,"MissingArgument",option);
1535 if (IsGeometry(argv[i]) == MagickFalse)
1536 ThrowDisplayInvalidArgumentException(option,argv[i]);
1539 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1541 respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1544 if (LocaleCompare("roll",option+1) == 0)
1549 if (i == (ssize_t) argc)
1550 ThrowDisplayException(OptionError,"MissingArgument",option);
1551 if (IsGeometry(argv[i]) == MagickFalse)
1552 ThrowDisplayInvalidArgumentException(option,argv[i]);
1555 if (LocaleCompare("rotate",option+1) == 0)
1558 if (i == (ssize_t) argc)
1559 ThrowDisplayException(OptionError,"MissingArgument",option);
1560 if (IsGeometry(argv[i]) == MagickFalse)
1561 ThrowDisplayInvalidArgumentException(option,argv[i]);
1564 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1568 if (LocaleCompare("sample",option+1) == 0)
1573 if (i == (ssize_t) argc)
1574 ThrowDisplayException(OptionError,"MissingArgument",option);
1575 if (IsGeometry(argv[i]) == MagickFalse)
1576 ThrowDisplayInvalidArgumentException(option,argv[i]);
1579 if (LocaleCompare("sampling-factor",option+1) == 0)
1584 if (i == (ssize_t) argc)
1585 ThrowDisplayException(OptionError,"MissingArgument",option);
1586 if (IsGeometry(argv[i]) == MagickFalse)
1587 ThrowDisplayInvalidArgumentException(option,argv[i]);
1590 if (LocaleCompare("scenes",option+1) == 0)
1595 if (i == (ssize_t) argc)
1596 ThrowDisplayException(OptionError,"MissingArgument",option);
1597 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1598 ThrowDisplayInvalidArgumentException(option,argv[i]);
1601 if (LocaleCompare("seed",option+1) == 0)
1606 if (i == (ssize_t) argc)
1607 ThrowDisplayException(OptionError,"MissingArgument",option);
1608 if (IsGeometry(argv[i]) == MagickFalse)
1609 ThrowDisplayInvalidArgumentException(option,argv[i]);
1612 if (LocaleCompare("segment",option+1) == 0)
1617 if (i == (ssize_t) argc)
1618 ThrowDisplayException(OptionError,"MissingArgument",option);
1619 if (IsGeometry(argv[i]) == MagickFalse)
1620 ThrowDisplayInvalidArgumentException(option,argv[i]);
1623 if (LocaleCompare("set",option+1) == 0)
1626 if (i == (ssize_t) argc)
1627 ThrowDisplayException(OptionError,"MissingArgument",option);
1631 if (i == (ssize_t) argc)
1632 ThrowDisplayException(OptionError,"MissingArgument",option);
1635 if (LocaleCompare("sharpen",option+1) == 0)
1640 if (i == (ssize_t) argc)
1641 ThrowDisplayException(OptionError,"MissingArgument",option);
1642 if (IsGeometry(argv[i]) == MagickFalse)
1643 ThrowDisplayInvalidArgumentException(option,argv[i]);
1646 if (LocaleCompare("shared-memory",option+1) == 0)
1648 resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
1652 if (LocaleCompare("size",option+1) == 0)
1657 if (i == (ssize_t) argc)
1658 ThrowDisplayException(OptionError,"MissingArgument",option);
1659 if (IsGeometry(argv[i]) == MagickFalse)
1660 ThrowDisplayInvalidArgumentException(option,argv[i]);
1663 if (LocaleCompare("strip",option+1) == 0)
1665 if (LocaleCompare("support",option+1) == 0)
1667 i++; /* deprecated */
1670 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1674 if (LocaleCompare("text-font",option+1) == 0)
1676 resource_info.text_font=(char *) NULL;
1680 if (i == (ssize_t) argc)
1681 ThrowDisplayException(OptionError,"MissingArgument",option);
1682 resource_info.text_font=XGetResourceClass(resource_database,
1683 GetClientName(),"font",argv[i]);
1686 if (LocaleCompare("texture",option+1) == 0)
1691 if (i == (ssize_t) argc)
1692 ThrowDisplayException(OptionError,"MissingArgument",option);
1695 if (LocaleCompare("threshold",option+1) == 0)
1700 if (i == (ssize_t) argc)
1701 ThrowDisplayException(OptionError,"MissingArgument",option);
1702 if (IsGeometry(argv[i]) == MagickFalse)
1703 ThrowDisplayInvalidArgumentException(option,argv[i]);
1706 if (LocaleCompare("thumbnail",option+1) == 0)
1711 if (i == (ssize_t) argc)
1712 ThrowDisplayException(OptionError,"MissingArgument",option);
1713 if (IsGeometry(argv[i]) == MagickFalse)
1714 ThrowDisplayInvalidArgumentException(option,argv[i]);
1717 if (LocaleCompare("title",option+1) == 0)
1719 resource_info.title=(char *) NULL;
1723 if (i == (ssize_t) argc)
1724 ThrowDisplayException(OptionError,"MissingArgument",option);
1725 resource_info.title=argv[i];
1728 if (LocaleCompare("transparent-color",option+1) == 0)
1733 if (i == (ssize_t) argc)
1734 ThrowDisplayException(OptionError,"MissingArgument",option);
1737 if (LocaleCompare("treedepth",option+1) == 0)
1739 quantize_info->tree_depth=0;
1743 if (i == (ssize_t) argc)
1744 ThrowDisplayException(OptionError,"MissingArgument",option);
1745 if (IsGeometry(argv[i]) == MagickFalse)
1746 ThrowDisplayInvalidArgumentException(option,argv[i]);
1747 quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1750 if (LocaleCompare("trim",option+1) == 0)
1752 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1756 if (LocaleCompare("update",option+1) == 0)
1758 resource_info.update=(unsigned int) (*option == '-');
1762 if (i == (ssize_t) argc)
1763 ThrowDisplayException(OptionError,"MissingArgument",option);
1764 if (IsGeometry(argv[i]) == MagickFalse)
1765 ThrowDisplayInvalidArgumentException(option,argv[i]);
1766 resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
1769 if (LocaleCompare("use-pixmap",option+1) == 0)
1771 resource_info.use_pixmap=(*option == '-') ? MagickTrue :
1775 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1779 if (LocaleCompare("verbose",option+1) == 0)
1781 if ((LocaleCompare("version",option+1) == 0) ||
1782 (LocaleCompare("-version",option+1) == 0))
1784 ListMagickVersion(stdout);
1787 if (LocaleCompare("visual",option+1) == 0)
1789 resource_info.visual_type=(char *) NULL;
1793 if (i == (ssize_t) argc)
1794 ThrowDisplayException(OptionError,"MissingArgument",option);
1795 resource_info.visual_type=argv[i];
1798 if (LocaleCompare("virtual-pixel",option+1) == 0)
1806 if (i == (ssize_t) argc)
1807 ThrowDisplayException(OptionError,"MissingArgument",option);
1808 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1811 ThrowDisplayException(OptionError,
1812 "UnrecognizedVirtualPixelMethod",argv[i]);
1815 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1819 if (LocaleCompare("window",option+1) == 0)
1821 resource_info.window_id=(char *) NULL;
1825 if (i == (ssize_t) argc)
1826 ThrowDisplayException(OptionError,"MissingArgument",option);
1827 resource_info.window_id=argv[i];
1830 if (LocaleCompare("window-group",option+1) == 0)
1832 resource_info.window_group=(char *) NULL;
1836 if (i == (ssize_t) argc)
1837 ThrowDisplayException(OptionError,"MissingArgument",option);
1838 if (StringToDouble(argv[i],(char **) NULL) != 0)
1839 resource_info.window_group=argv[i];
1842 if (LocaleCompare("write",option+1) == 0)
1844 resource_info.write_filename=(char *) NULL;
1848 if (i == (ssize_t) argc)
1849 ThrowDisplayException(OptionError,"MissingArgument",option);
1850 resource_info.write_filename=argv[i];
1851 if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
1857 (void) FormatLocaleFile(stderr,"Overwrite %s? ",
1858 resource_info.write_filename);
1859 p=fgets(answer,(int) sizeof(answer),stdin);
1861 if (((*answer != 'y') && (*answer != 'Y')))
1862 return(MagickFalse);
1866 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1871 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1873 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1874 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1875 if (fire != MagickFalse)
1876 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1879 ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
1880 if (state & RetainColorsState)
1882 XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
1883 (void) XSync(display,MagickFalse);
1886 return(status != 0 ? MagickTrue : MagickFalse);
1888 wand_unreferenced(argc);
1889 wand_unreferenced(argv);
1890 wand_unreferenced(metadata);
1891 (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1892 "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1893 return(DisplayUsage());