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-2013 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/nt-base-private.h"
49 #include "MagickCore/string-private.h"
50 #include "MagickCore/xwindow-private.h"
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 + D i s p l a y I m a g e C o m m a n d %
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 % DisplayImageCommand() displays a sequence of images on any workstation
64 % display running an X server. Display first determines the hardware
65 % capabilities of the workstation. If the number of unique colors in an image
66 % is less than or equal to the number the workstation can support, the image
67 % is displayed in an X window. Otherwise the number of colors in the image is
68 % first reduced to match the color resolution of the workstation before it is
71 % This means that a continuous-tone 24 bits/pixel image can display on a 8
72 % bit pseudo-color device or monochrome device. In most instances the reduced
73 % color image closely resembles the original. Alternatively, a monochrome or
74 % pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
77 % The format of the DisplayImageCommand method is:
79 % MagickBooleanType DisplayImageCommand(ImageInfo *image_info,int argc,
80 % char **argv,char **metadata,ExceptionInfo *exception)
82 % A description of each parameter follows:
84 % o image_info: the image info.
86 % o argc: the number of elements in the argument vector.
88 % o argv: A text array containing the command line arguments.
90 % o metadata: any metadata is returned here.
92 % o exception: return any errors or warnings in this structure.
96 static MagickBooleanType DisplayUsage(void)
104 "1 press to map or unmap the Command widget",
105 "2 press and drag to magnify a region of an image",
106 "3 press to load an image from a visual image directory",
111 "-debug events display copious debugging information",
112 "-help print program options",
113 "-list type print a list of supported option arguments",
114 "-log format format of debugging information",
115 "-version print version information",
120 "-auto-orient automagically orient image",
121 "-border geometry surround image with a border of color",
122 "-clip clip along the first path from the 8BIM profile",
123 "-clip-path id clip along a named path from the 8BIM profile",
124 "-colors value preferred number of colors in the image",
125 "-contrast enhance or reduce the image contrast",
126 "-crop geometry preferred size and location of the cropped image",
127 "-decipher filename convert cipher pixels to plain pixels",
128 "-deskew threshold straighten an image",
129 "-despeckle reduce the speckles within an image",
130 "-edge factor apply a filter to detect edges in the image",
131 "-enhance apply a digital filter to enhance a noisy image",
132 "-equalize perform histogram equalization to an image",
133 "-extract geometry extract area from image",
134 "-flip flip image in the vertical direction",
135 "-flop flop image in the horizontal direction",
136 "-frame geometry surround image with an ornamental border",
137 "-fuzz distance colors within this distance are considered equal",
138 "-gamma value level of gamma correction",
139 "-monochrome transform image to black and white",
140 "-negate replace every pixel with its complementary color",
141 "-normalize transform image to span the full range of colors",
142 "-raise value lighten/darken image edges to create a 3-D effect",
143 "-resample geometry change the resolution of an image",
144 "-resize geometry resize the image",
145 "-roll geometry roll an image vertically or horizontally",
146 "-rotate degrees apply Paeth rotation to the image",
147 "-sample geometry scale image with pixel sampling",
148 "-segment value segment an image",
149 "-sharpen geometry sharpen the image",
150 "-strip strip image of all profiles and comments",
151 "-threshold value threshold the image",
152 "-thumbnail geometry create a thumbnail of the image",
153 "-trim trim image edges",
158 "-alpha option on, activate, off, deactivate, set, opaque, copy",
159 " transparent, extract, background, or shape",
160 "-antialias remove pixel-aliasing",
161 "-authenticate password",
162 " decipher image with this password",
163 "-backdrop display image centered on a backdrop",
164 "-channel type apply option to select image channels",
165 "-colormap type Shared or Private",
166 "-colorspace type alternate image colorspace",
167 "-comment string annotate image with comment",
168 "-compress type type of pixel compression when writing the image",
169 "-define format:option",
170 " define one or more image format options",
171 "-delay value display the next image after pausing",
172 "-density geometry horizontal and vertical density of the image",
173 "-depth value image depth",
174 "-display server display image to this X server",
175 "-dispose method layer disposal method",
176 "-dither method apply error diffusion to image",
177 "-endian type endianness (MSB or LSB) of the image",
178 "-filter type use this filter when resizing an image",
179 "-format string output formatted image characteristics",
180 "-geometry geometry preferred size and location of the Image window",
181 "-gravity type horizontal and vertical backdrop placement",
182 "-identify identify the format and characteristics of the image",
183 "-immutable displayed image cannot be modified",
184 "-interlace type type of image interlacing scheme",
185 "-interpolate method pixel color interpolation method",
186 "-label string assign a label to an image",
187 "-limit type value pixel cache resource limit",
188 "-loop iterations loop images then exit",
189 "-map type display image using this Standard Colormap",
190 "-monitor monitor progress",
191 "-page geometry size and location of an image canvas",
192 "-profile filename add, delete, or apply an image profile",
193 "-quality value JPEG/MIFF/PNG compression level",
194 "-quantize colorspace reduce colors in this colorspace",
195 "-quiet suppress all warning messages",
196 "-regard-warnings pay attention to warning messages",
197 "-remote command execute a command in an remote display process",
198 "-repage geometry size and location of an image canvas (operator)",
199 "-respect-parentheses settings remain in effect until parenthesis boundary",
200 "-sampling-factor geometry",
201 " horizontal and vertical sampling factor",
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 "-texture filename name of texture to tile onto the image background",
206 "-transparent-color color",
207 " transparent color",
208 "-treedepth value color tree depth",
209 "-update seconds detect when image file is modified and redisplay",
210 "-verbose print detailed information about the image",
211 "-visual type display image using this visual type",
212 "-virtual-pixel method",
213 " virtual pixel access method",
214 "-window id display image to background of this window",
215 "-window-group id exit program when this window id is destroyed",
216 "-write filename write image to a file",
219 *sequence_operators[]=
221 "-coalesce merge a sequence of images",
222 "-flatten flatten a sequence of images",
226 ListMagickVersion(stdout);
227 (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
229 (void) printf("\nImage Settings:\n");
230 for (p=settings; *p != (char *) NULL; p++)
231 (void) printf(" %s\n",*p);
232 (void) printf("\nImage Operators:\n");
233 for (p=operators; *p != (char *) NULL; p++)
234 (void) printf(" %s\n",*p);
235 (void) printf("\nImage Sequence Operators:\n");
236 for (p=sequence_operators; *p != (char *) NULL; p++)
237 (void) printf(" %s\n",*p);
238 (void) printf("\nMiscellaneous Options:\n");
239 for (p=miscellaneous; *p != (char *) NULL; p++)
240 (void) printf(" %s\n",*p);
242 "\nIn addition to those listed above, you can specify these standard X\n");
244 "resources as command line options: -background, -bordercolor,\n");
246 "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
247 (void) printf("-name, -shared-memory, -usePixmap, or -title.\n");
249 "\nBy default, the image format of 'file' is determined by its magic\n");
251 "number. To specify a particular image format, precede the filename\n");
253 "with an image format name and a colon (i.e. ps:image) or specify the\n");
255 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
256 (void) printf("'-' for standard input or output.\n");
257 (void) printf("\nButtons: \n");
258 for (p=buttons; *p != (char *) NULL; p++)
259 (void) printf(" %s\n",*p);
263 WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
264 int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
266 #if defined(MAGICKCORE_X11_DELEGATE)
267 #define DestroyDisplay() \
269 if ((state & ExitState) == 0) \
270 DestroyXResources(); \
271 if (display != (Display *) NULL) \
273 XCloseDisplay(display); \
274 display=(Display *) NULL; \
276 XDestroyResourceInfo(&resource_info); \
277 DestroyImageStack(); \
278 if (image_marker != (size_t *) NULL) \
279 image_marker=(size_t *) RelinquishMagickMemory(image_marker); \
280 for (i=0; i < (ssize_t) argc; i++) \
281 argv[i]=DestroyString(argv[i]); \
282 argv=(char **) RelinquishMagickMemory(argv); \
284 #define ThrowDisplayException(asperity,tag,option) \
286 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
289 return(MagickFalse); \
291 #define ThrowDisplayInvalidArgumentException(option,argument) \
293 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
294 "InvalidArgument","'%s': %s",option,argument); \
296 return(MagickFalse); \
313 image_stack[MaxImageStackDepth+1];
351 assert(image_info != (ImageInfo *) NULL);
352 assert(image_info->signature == MagickSignature);
353 if (image_info->debug != MagickFalse)
354 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
355 assert(exception != (ExceptionInfo *) NULL);
359 if ((LocaleCompare("version",option+1) == 0) ||
360 (LocaleCompare("-version",option+1) == 0))
362 ListMagickVersion(stdout);
367 display=(Display *) NULL;
370 image_marker=(size_t *) NULL;
374 option=(char *) NULL;
376 respect_parenthesis=MagickFalse;
377 resource_database=(XrmDatabase) NULL;
378 (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
379 server_name=(char *) NULL;
382 ReadCommandlLine(argc,&argv);
383 status=ExpandFilenames(&argc,&argv);
384 if (status == MagickFalse)
385 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
386 GetExceptionMessage(errno));
387 image_marker=(size_t *) AcquireQuantumMemory((size_t) argc+1UL,
388 sizeof(*image_marker));
389 if (image_marker == (size_t *) NULL)
390 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
391 GetExceptionMessage(errno));
392 for (i=0; i <= (ssize_t) argc; i++)
393 image_marker[i]=(size_t) argc;
395 Check for server name specified on the command line.
397 for (i=1; i < (ssize_t) argc; i++)
400 Check command line for server name.
403 if (LocaleCompare("display",option+1) == 0)
406 User specified server name.
409 if (i == (ssize_t) argc)
410 ThrowDisplayException(OptionError,"MissingArgument",option);
413 if ((LocaleCompare("help",option+1) == 0) ||
414 (LocaleCompare("-help",option+1) == 0))
415 return(DisplayUsage());
418 Get user defaults from X resource database.
420 display=XOpenDisplay(server_name);
421 if (display == (Display *) NULL)
422 ThrowDisplayException(XServerError,"UnableToOpenXServer",
423 XDisplayName(server_name));
424 (void) XSetErrorHandler(XError);
425 resource_database=XGetResourceDatabase(display,GetClientName());
426 XGetResourceInfo(image_info,resource_database,GetClientName(),
428 quantize_info=resource_info.quantize_info;
429 image_info->density=XGetResourceInstance(resource_database,GetClientName(),
430 "density",(char *) NULL);
431 if (image_info->density == (char *) NULL)
432 image_info->density=XGetScreenDensity(display);
433 resource_value=XGetResourceInstance(resource_database,GetClientName(),
435 image_info->interlace=(InterlaceType)
436 ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value);
437 image_info->page=XGetResourceInstance(resource_database,GetClientName(),
438 "pageGeometry",(char *) NULL);
439 resource_value=XGetResourceInstance(resource_database,GetClientName(),
441 image_info->quality=StringToUnsignedLong(resource_value);
442 resource_value=XGetResourceInstance(resource_database,GetClientName(),
444 image_info->verbose=IsStringTrue(resource_value);
445 resource_value=XGetResourceInstance(resource_database,GetClientName(),
447 quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ?
448 RiemersmaDitherMethod : NoDitherMethod;
453 for (i=1; ((i <= (ssize_t) argc) && ((state & ExitState) == 0)); i++)
455 if (i < (ssize_t) argc)
458 if (image != (Image *) NULL)
461 if (isatty(STDIN_FILENO) != MagickFalse)
477 if (LocaleCompare(option,"(") == 0)
479 FireImageStack(MagickFalse,MagickTrue,pend);
480 if (k == MaxImageStackDepth)
481 ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply",
486 if (LocaleCompare(option,")") == 0)
488 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
490 ThrowDisplayException(OptionError,"UnableToParseExpression",option);
494 if (IsCommandOption(option) == MagickFalse)
505 Option is a file name.
507 FireImageStack(MagickFalse,MagickFalse,pend);
509 if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
514 (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
515 images=ReadImage(image_info,exception);
516 CatchException(exception);
517 status&=(images != (Image *) NULL) &&
518 (exception->severity < ErrorException);
519 if (images == (Image *) NULL)
521 AppendImageStack(images);
522 FinalizeImageSettings(image_info,image,MagickFalse);
524 if (i == (ssize_t) (argc-1))
525 iterations=image->iterations;
526 image_list=CloneImageList(image,exception);
527 if (image_list == (Image *) NULL)
528 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
529 GetExceptionMessage(errno));
530 display_image=image_list;
534 Transmogrify image as defined by the image processing options.
536 resource_info.quantum=1;
537 if (resource_info.window_id != (char *) NULL)
540 Display image to a specified X window.
542 status=XDisplayBackgroundImage(display,&resource_info,
543 display_image,exception);
544 if (status != MagickFalse)
546 state|=RetainColorsState;
557 Display image to X server.
559 if (resource_info.delay != 1)
560 display_image->delay=resource_info.delay;
561 nexus=XDisplayImage(display,&resource_info,argv,argc,
562 &display_image,&state,exception);
563 status&=nexus != (Image *) NULL;
564 if (nexus == (Image *) NULL)
566 while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
571 if (nexus->montage != (char *) NULL)
574 User selected a visual directory image (montage).
579 next=XDisplayImage(display,&resource_info,argv,argc,&nexus,
581 if ((next == (Image *) NULL) &&
582 (GetNextImageInList(nexus) != (Image *) NULL))
584 display_image=GetNextImageInList(nexus);
585 nexus=NewImageList();
589 if (nexus != display_image)
590 nexus=DestroyImageList(nexus);
594 } while ((state & ExitState) == 0);
595 if (resource_info.write_filename != (char *) NULL)
600 (void) CopyMagickString(display_image->filename,
601 resource_info.write_filename,MaxTextExtent);
602 (void) SetImageInfo(image_info,1,exception);
603 status&=WriteImage(image_info,display_image,exception);
606 Proceed to next/previous image.
608 if ((state & FormerImageState) != 0)
609 for (l=0; l < (ssize_t) resource_info.quantum; l++)
611 if (GetPreviousImageInList(display_image) == (Image *) NULL)
613 display_image=GetPreviousImageInList(display_image);
616 for (l=0; l < (ssize_t) resource_info.quantum; l++)
618 if (GetNextImageInList(display_image) == (Image *) NULL)
620 display_image=GetNextImageInList(display_image);
622 } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
624 Free image resources.
626 display_image=DestroyImageList(display_image);
627 if ((state & FormerImageState) == 0)
629 last_image=(size_t) image_number;
630 image_marker[i]=(size_t) image_number++;
635 Proceed to previous image.
637 for (i--; i > 0; i--)
638 if (image_marker[i] == (size_t) (image_number-2))
642 if ((i == (ssize_t) (argc-1)) && ((state & ExitState) == 0))
644 if ((state & ExitState) != 0)
647 Determine if we should proceed to the first image.
649 if (image_number < 0)
651 if ((state & FormerImageState) != 0)
654 for (i=1; i < (ssize_t) (argc-2); i++)
655 if (last_image == image_marker[i])
657 image_number=(ssize_t) image_marker[i]+1;
661 if (resource_info.window_id != (char *) NULL)
663 if ((iterations != 0) && (++iteration == (ssize_t) iterations))
665 if (LocaleCompare(filename,"-") == 0)
667 RemoveAllImageStack();
670 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
675 if (LocaleCompare("alpha",option+1) == 0)
683 if (i == (ssize_t) argc)
684 ThrowDisplayException(OptionError,"MissingArgument",option);
685 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
687 ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
691 if (LocaleCompare("antialias",option+1) == 0)
693 if (LocaleCompare("authenticate",option+1) == 0)
698 if (i == (ssize_t) argc)
699 ThrowDisplayException(OptionError,"MissingArgument",option);
702 if (LocaleCompare("auto-orient",option+1) == 0)
704 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
708 if (LocaleCompare("backdrop",option+1) == 0)
710 resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
713 if (LocaleCompare("background",option+1) == 0)
718 if (i == (ssize_t) argc)
719 ThrowDisplayException(OptionError,"MissingArgument",option);
720 resource_info.background_color=argv[i];
723 if (LocaleCompare("border",option+1) == 0)
728 if (i == (ssize_t) argc)
729 ThrowDisplayException(OptionError,"MissingArgument",option);
730 if (IsGeometry(argv[i]) == MagickFalse)
731 ThrowDisplayInvalidArgumentException(option,argv[i]);
734 if (LocaleCompare("bordercolor",option+1) == 0)
739 if (i == (ssize_t) argc)
740 ThrowDisplayException(OptionError,"MissingArgument",option);
741 resource_info.border_color=argv[i];
744 if (LocaleCompare("borderwidth",option+1) == 0)
746 resource_info.border_width=0;
750 if (i == (ssize_t) argc)
751 ThrowDisplayException(OptionError,"MissingArgument",option);
752 if (IsGeometry(argv[i]) == MagickFalse)
753 ThrowDisplayInvalidArgumentException(option,argv[i]);
754 resource_info.border_width=(unsigned int)
755 StringToUnsignedLong(argv[i]);
758 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
762 if (LocaleCompare("cache",option+1) == 0)
767 if (i == (ssize_t) argc)
768 ThrowDisplayException(OptionError,"MissingArgument",option);
769 if (IsGeometry(argv[i]) == MagickFalse)
770 ThrowDisplayInvalidArgumentException(option,argv[i]);
773 if (LocaleCompare("channel",option+1) == 0)
781 if (i == (ssize_t) (argc-1))
782 ThrowDisplayException(OptionError,"MissingArgument",option);
783 channel=ParseChannelOption(argv[i]);
785 ThrowDisplayException(OptionError,"UnrecognizedChannelType",
789 if (LocaleCompare("clip",option+1) == 0)
791 if (LocaleCompare("clip-path",option+1) == 0)
794 if (i == (ssize_t) argc)
795 ThrowDisplayException(OptionError,"MissingArgument",option);
798 if (LocaleCompare("coalesce",option+1) == 0)
800 if (LocaleCompare("colormap",option+1) == 0)
802 resource_info.colormap=PrivateColormap;
806 if (i == (ssize_t) argc)
807 ThrowDisplayException(OptionError,"MissingArgument",option);
808 resource_info.colormap=UndefinedColormap;
809 if (LocaleCompare("private",argv[i]) == 0)
810 resource_info.colormap=PrivateColormap;
811 if (LocaleCompare("shared",argv[i]) == 0)
812 resource_info.colormap=SharedColormap;
813 if (resource_info.colormap == UndefinedColormap)
814 ThrowDisplayException(OptionError,"UnrecognizedColormapType",
818 if (LocaleCompare("colors",option+1) == 0)
820 quantize_info->number_colors=0;
824 if (i == (ssize_t) argc)
825 ThrowDisplayException(OptionError,"MissingArgument",option);
826 if (IsGeometry(argv[i]) == MagickFalse)
827 ThrowDisplayInvalidArgumentException(option,argv[i]);
828 quantize_info->number_colors=StringToUnsignedLong(argv[i]);
831 if (LocaleCompare("colorspace",option+1) == 0)
839 if (i == (ssize_t) argc)
840 ThrowDisplayException(OptionError,"MissingArgument",option);
841 colorspace=ParseCommandOption(MagickColorspaceOptions,
842 MagickFalse,argv[i]);
844 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
848 if (LocaleCompare("comment",option+1) == 0)
853 if (i == (ssize_t) argc)
854 ThrowDisplayException(OptionError,"MissingArgument",option);
857 if (LocaleCompare("compress",option+1) == 0)
865 if (i == (ssize_t) argc)
866 ThrowDisplayException(OptionError,"MissingArgument",option);
867 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
870 ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
874 if (LocaleCompare("concurrent",option+1) == 0)
876 if (LocaleCompare("contrast",option+1) == 0)
878 if (LocaleCompare("crop",option+1) == 0)
883 if (i == (ssize_t) argc)
884 ThrowDisplayException(OptionError,"MissingArgument",option);
885 if (IsGeometry(argv[i]) == MagickFalse)
886 ThrowDisplayInvalidArgumentException(option,argv[i]);
889 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
893 if (LocaleCompare("debug",option+1) == 0)
901 if (i == (ssize_t) argc)
902 ThrowDisplayException(OptionError,"MissingArgument",option);
903 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
905 ThrowDisplayException(OptionError,"UnrecognizedEventType",
907 (void) SetLogEventMask(argv[i]);
910 if (LocaleCompare("decipher",option+1) == 0)
915 if (i == (ssize_t) (argc-1))
916 ThrowDisplayException(OptionError,"MissingArgument",option);
919 if (LocaleCompare("define",option+1) == 0)
922 if (i == (ssize_t) argc)
923 ThrowDisplayException(OptionError,"MissingArgument",option);
929 define=GetImageOption(image_info,argv[i]);
930 if (define == (const char *) NULL)
931 ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
936 if (LocaleCompare("delay",option+1) == 0)
941 if (i == (ssize_t) argc)
942 ThrowDisplayException(OptionError,"MissingArgument",option);
943 if (IsGeometry(argv[i]) == MagickFalse)
944 ThrowDisplayInvalidArgumentException(option,argv[i]);
947 if (LocaleCompare("density",option+1) == 0)
952 if (i == (ssize_t) argc)
953 ThrowDisplayException(OptionError,"MissingArgument",option);
954 if (IsGeometry(argv[i]) == MagickFalse)
955 ThrowDisplayInvalidArgumentException(option,argv[i]);
958 if (LocaleCompare("depth",option+1) == 0)
963 if (i == (ssize_t) argc)
964 ThrowDisplayException(OptionError,"MissingArgument",option);
965 if (IsGeometry(argv[i]) == MagickFalse)
966 ThrowDisplayInvalidArgumentException(option,argv[i]);
969 if (LocaleCompare("deskew",option+1) == 0)
974 if (i == (ssize_t) (argc-1))
975 ThrowDisplayException(OptionError,"MissingArgument",option);
976 if (IsGeometry(argv[i]) == MagickFalse)
977 ThrowDisplayInvalidArgumentException(option,argv[i]);
980 if (LocaleCompare("despeckle",option+1) == 0)
982 if (LocaleCompare("display",option+1) == 0)
987 if (i == (ssize_t) argc)
988 ThrowDisplayException(OptionError,"MissingArgument",option);
991 if (LocaleCompare("dispose",option+1) == 0)
999 if (i == (ssize_t) argc)
1000 ThrowDisplayException(OptionError,"MissingArgument",option);
1001 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1003 ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
1007 if (LocaleCompare("dither",option+1) == 0)
1012 quantize_info->dither_method=NoDitherMethod;
1016 if (i == (ssize_t) argc)
1017 ThrowDisplayException(OptionError,"MissingArgument",option);
1018 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1020 ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
1022 quantize_info->dither_method=(DitherMethod) method;
1025 if (LocaleCompare("duration",option+1) == 0)
1030 if (i == (ssize_t) (argc-1))
1031 ThrowDisplayException(OptionError,"MissingArgument",option);
1032 if (IsGeometry(argv[i]) == MagickFalse)
1033 ThrowDisplayInvalidArgumentException(option,argv[i]);
1036 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1040 if (LocaleCompare("edge",option+1) == 0)
1045 if (i == (ssize_t) argc)
1046 ThrowDisplayException(OptionError,"MissingArgument",option);
1047 if (IsGeometry(argv[i]) == MagickFalse)
1048 ThrowDisplayInvalidArgumentException(option,argv[i]);
1051 if (LocaleCompare("endian",option+1) == 0)
1059 if (i == (ssize_t) argc)
1060 ThrowDisplayException(OptionError,"MissingArgument",option);
1061 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1064 ThrowDisplayException(OptionError,"UnrecognizedEndianType",
1068 if (LocaleCompare("enhance",option+1) == 0)
1070 if (LocaleCompare("equalize",option+1) == 0)
1072 if (LocaleCompare("extract",option+1) == 0)
1077 if (i == (ssize_t) argc)
1078 ThrowDisplayException(OptionError,"MissingArgument",option);
1079 if (IsGeometry(argv[i]) == MagickFalse)
1080 ThrowDisplayInvalidArgumentException(option,argv[i]);
1083 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1087 if (LocaleCompare("filter",option+1) == 0)
1095 if (i == (ssize_t) argc)
1096 ThrowDisplayException(OptionError,"MissingArgument",option);
1097 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1099 ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
1103 if (LocaleCompare("flatten",option+1) == 0)
1105 if (LocaleCompare("flip",option+1) == 0)
1107 if (LocaleCompare("flop",option+1) == 0)
1109 if (LocaleCompare("font",option+1) == 0)
1114 if (i == (ssize_t) argc)
1115 ThrowDisplayException(OptionError,"MissingArgument",option);
1116 resource_info.font=XGetResourceClass(resource_database,
1117 GetClientName(),"font",argv[i]);
1120 if (LocaleCompare("foreground",option+1) == 0)
1125 if (i == (ssize_t) argc)
1126 ThrowDisplayException(OptionError,"MissingArgument",option);
1127 resource_info.foreground_color=argv[i];
1130 if (LocaleCompare("format",option+1) == 0)
1135 if (i == (ssize_t) (argc-1))
1136 ThrowDisplayException(OptionError,"MissingArgument",option);
1139 if (LocaleCompare("frame",option+1) == 0)
1144 if (i == (ssize_t) argc)
1145 ThrowDisplayException(OptionError,"MissingArgument",option);
1146 if (IsGeometry(argv[i]) == MagickFalse)
1147 ThrowDisplayInvalidArgumentException(option,argv[i]);
1150 if (LocaleCompare("fuzz",option+1) == 0)
1155 if (i == (ssize_t) (argc-1))
1156 ThrowDisplayException(OptionError,"MissingArgument",option);
1157 if (IsGeometry(argv[i]) == MagickFalse)
1158 ThrowDisplayInvalidArgumentException(option,argv[i]);
1161 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1165 if (LocaleCompare("gamma",option+1) == 0)
1168 if (i == (ssize_t) argc)
1169 ThrowDisplayException(OptionError,"MissingArgument",option);
1170 if (IsGeometry(argv[i]) == MagickFalse)
1171 ThrowDisplayInvalidArgumentException(option,argv[i]);
1174 if (LocaleCompare("geometry",option+1) == 0)
1176 resource_info.image_geometry=(char *) NULL;
1179 (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
1181 if (i == (ssize_t) argc)
1182 ThrowDisplayException(OptionError,"MissingArgument",option);
1183 if (IsGeometry(argv[i]) == MagickFalse)
1184 ThrowDisplayInvalidArgumentException(option,argv[i]);
1185 resource_info.image_geometry=ConstantString(argv[i]);
1188 if (LocaleCompare("gravity",option+1) == 0)
1196 if (i == (ssize_t) (argc-1))
1197 ThrowDisplayException(OptionError,"MissingArgument",option);
1198 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1201 ThrowDisplayException(OptionError,"UnrecognizedGravityType",
1205 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1209 if ((LocaleCompare("help",option+1) == 0) ||
1210 (LocaleCompare("-help",option+1) == 0))
1212 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1216 if (LocaleCompare("identify",option+1) == 0)
1218 if (LocaleCompare("iconGeometry",option+1) == 0)
1220 resource_info.icon_geometry=(char *) NULL;
1224 if (i == (ssize_t) argc)
1225 ThrowDisplayException(OptionError,"MissingArgument",option);
1226 if (IsGeometry(argv[i]) == MagickFalse)
1227 ThrowDisplayInvalidArgumentException(option,argv[i]);
1228 resource_info.icon_geometry=argv[i];
1231 if (LocaleCompare("iconic",option+1) == 0)
1233 resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
1236 if (LocaleCompare("immutable",option+1) == 0)
1238 resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
1241 if (LocaleCompare("interlace",option+1) == 0)
1249 if (i == (ssize_t) argc)
1250 ThrowDisplayException(OptionError,"MissingArgument",option);
1251 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1254 ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
1258 if (LocaleCompare("interpolate",option+1) == 0)
1266 if (i == (ssize_t) argc)
1267 ThrowDisplayException(OptionError,"MissingArgument",option);
1268 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1270 if (interpolate < 0)
1271 ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
1275 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1279 if (LocaleCompare("label",option+1) == 0)
1284 if (i == (ssize_t) argc)
1285 ThrowDisplayException(OptionError,"MissingArgument",option);
1288 if (LocaleCompare("limit",option+1) == 0)
1302 if (i == (ssize_t) argc)
1303 ThrowDisplayException(OptionError,"MissingArgument",option);
1304 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
1307 ThrowDisplayException(OptionError,"UnrecognizedResourceType",
1310 if (i == (ssize_t) argc)
1311 ThrowDisplayException(OptionError,"MissingArgument",option);
1312 value=StringToDouble(argv[i],&p);
1314 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
1315 ThrowDisplayInvalidArgumentException(option,argv[i]);
1318 if (LocaleCompare("list",option+1) == 0)
1326 if (i == (ssize_t) argc)
1327 ThrowDisplayException(OptionError,"MissingArgument",option);
1328 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
1330 ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1331 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
1334 return(status != 0 ? MagickFalse : MagickTrue);
1336 if (LocaleCompare("log",option+1) == 0)
1341 if ((i == (ssize_t) argc) ||
1342 (strchr(argv[i],'%') == (char *) NULL))
1343 ThrowDisplayException(OptionError,"MissingArgument",option);
1346 if (LocaleCompare("loop",option+1) == 0)
1351 if (i == (ssize_t) (argc-1))
1352 ThrowDisplayException(OptionError,"MissingArgument",option);
1353 if (IsGeometry(argv[i]) == MagickFalse)
1354 ThrowDisplayInvalidArgumentException(option,argv[i]);
1355 iterations=StringToUnsignedLong(argv[i]);
1358 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1362 if (LocaleCompare("magnify",option+1) == 0)
1364 resource_info.magnify=2;
1368 if (i == (ssize_t) argc)
1369 ThrowDisplayException(OptionError,"MissingArgument",option);
1370 if (IsGeometry(argv[i]) == MagickFalse)
1371 ThrowDisplayInvalidArgumentException(option,argv[i]);
1372 resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
1375 if (LocaleCompare("map",option+1) == 0)
1377 resource_info.map_type=(char *) NULL;
1380 (void) strcpy(argv[i]+1,"san");
1382 if (i == (ssize_t) argc)
1383 ThrowDisplayException(OptionError,"MissingArgument",option);
1384 resource_info.map_type=argv[i];
1387 if (LocaleCompare("matte",option+1) == 0)
1389 if (LocaleCompare("mattecolor",option+1) == 0)
1394 if (i == (ssize_t) argc)
1395 ThrowDisplayException(OptionError,"MissingArgument",option);
1396 resource_info.matte_color=argv[i];
1399 if (LocaleCompare("monitor",option+1) == 0)
1401 if (LocaleCompare("monochrome",option+1) == 0)
1405 quantize_info->number_colors=2;
1406 quantize_info->colorspace=GRAYColorspace;
1409 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1413 if (LocaleCompare("name",option+1) == 0)
1415 resource_info.name=(char *) NULL;
1419 if (i == (ssize_t) argc)
1420 ThrowDisplayException(OptionError,"MissingArgument",option);
1421 resource_info.name=ConstantString(argv[i]);
1424 if (LocaleCompare("negate",option+1) == 0)
1426 if (LocaleCompare("noop",option+1) == 0)
1428 if (LocaleCompare("normalize",option+1) == 0)
1430 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1434 if (LocaleCompare("page",option+1) == 0)
1436 resource_info.image_geometry=(char *) NULL;
1440 if (i == (ssize_t) argc)
1441 ThrowDisplayException(OptionError,"MissingArgument",option);
1442 resource_info.image_geometry=ConstantString(argv[i]);
1445 if (LocaleCompare("profile",option+1) == 0)
1448 if (i == (ssize_t) argc)
1449 ThrowDisplayException(OptionError,"MissingArgument",option);
1452 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1456 if (LocaleCompare("quality",option+1) == 0)
1461 if (i == (ssize_t) argc)
1462 ThrowDisplayException(OptionError,"MissingArgument",option);
1463 if (IsGeometry(argv[i]) == MagickFalse)
1464 ThrowDisplayInvalidArgumentException(option,argv[i]);
1467 if (LocaleCompare("quantize",option+1) == 0)
1475 if (i == (ssize_t) (argc-1))
1476 ThrowDisplayException(OptionError,"MissingArgument",option);
1477 colorspace=ParseCommandOption(MagickColorspaceOptions,
1478 MagickFalse,argv[i]);
1480 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
1484 if (LocaleCompare("quiet",option+1) == 0)
1486 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1490 if (LocaleCompare("raise",option+1) == 0)
1493 if (i == (ssize_t) argc)
1494 ThrowDisplayException(OptionError,"MissingArgument",option);
1495 if (IsGeometry(argv[i]) == MagickFalse)
1496 ThrowDisplayInvalidArgumentException(option,argv[i]);
1499 if (LocaleCompare("regard-warnings",option+1) == 0)
1501 if (LocaleCompare("remote",option+1) == 0)
1504 if (i == (ssize_t) argc)
1505 ThrowDisplayException(OptionError,"MissingArgument",option);
1506 if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1507 return(MagickFalse);
1511 if (LocaleCompare("repage",option+1) == 0)
1516 if (i == (ssize_t) argc)
1517 ThrowDisplayException(OptionError,"MissingArgument",option);
1518 if (IsGeometry(argv[i]) == MagickFalse)
1519 ThrowDisplayInvalidArgumentException(option,argv[i]);
1522 if (LocaleCompare("resample",option+1) == 0)
1527 if (i == (ssize_t) (argc-1))
1528 ThrowDisplayException(OptionError,"MissingArgument",option);
1529 if (IsGeometry(argv[i]) == MagickFalse)
1530 ThrowDisplayInvalidArgumentException(option,argv[i]);
1533 if (LocaleCompare("resize",option+1) == 0)
1538 if (i == (ssize_t) argc)
1539 ThrowDisplayException(OptionError,"MissingArgument",option);
1540 if (IsGeometry(argv[i]) == MagickFalse)
1541 ThrowDisplayInvalidArgumentException(option,argv[i]);
1544 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1546 respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1549 if (LocaleCompare("roll",option+1) == 0)
1554 if (i == (ssize_t) argc)
1555 ThrowDisplayException(OptionError,"MissingArgument",option);
1556 if (IsGeometry(argv[i]) == MagickFalse)
1557 ThrowDisplayInvalidArgumentException(option,argv[i]);
1560 if (LocaleCompare("rotate",option+1) == 0)
1563 if (i == (ssize_t) argc)
1564 ThrowDisplayException(OptionError,"MissingArgument",option);
1565 if (IsGeometry(argv[i]) == MagickFalse)
1566 ThrowDisplayInvalidArgumentException(option,argv[i]);
1569 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1573 if (LocaleCompare("sample",option+1) == 0)
1578 if (i == (ssize_t) argc)
1579 ThrowDisplayException(OptionError,"MissingArgument",option);
1580 if (IsGeometry(argv[i]) == MagickFalse)
1581 ThrowDisplayInvalidArgumentException(option,argv[i]);
1584 if (LocaleCompare("sampling-factor",option+1) == 0)
1589 if (i == (ssize_t) argc)
1590 ThrowDisplayException(OptionError,"MissingArgument",option);
1591 if (IsGeometry(argv[i]) == MagickFalse)
1592 ThrowDisplayInvalidArgumentException(option,argv[i]);
1595 if (LocaleCompare("scenes",option+1) == 0)
1600 if (i == (ssize_t) argc)
1601 ThrowDisplayException(OptionError,"MissingArgument",option);
1602 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1603 ThrowDisplayInvalidArgumentException(option,argv[i]);
1606 if (LocaleCompare("seed",option+1) == 0)
1611 if (i == (ssize_t) (argc-1))
1612 ThrowDisplayException(OptionError,"MissingArgument",option);
1613 if (IsGeometry(argv[i]) == MagickFalse)
1614 ThrowDisplayInvalidArgumentException(option,argv[i]);
1617 if (LocaleCompare("segment",option+1) == 0)
1622 if (i == (ssize_t) argc)
1623 ThrowDisplayException(OptionError,"MissingArgument",option);
1624 if (IsGeometry(argv[i]) == MagickFalse)
1625 ThrowDisplayInvalidArgumentException(option,argv[i]);
1628 if (LocaleCompare("set",option+1) == 0)
1631 if (i == (ssize_t) argc)
1632 ThrowDisplayException(OptionError,"MissingArgument",option);
1636 if (i == (ssize_t) argc)
1637 ThrowDisplayException(OptionError,"MissingArgument",option);
1640 if (LocaleCompare("sharpen",option+1) == 0)
1645 if (i == (ssize_t) argc)
1646 ThrowDisplayException(OptionError,"MissingArgument",option);
1647 if (IsGeometry(argv[i]) == MagickFalse)
1648 ThrowDisplayInvalidArgumentException(option,argv[i]);
1651 if (LocaleCompare("shared-memory",option+1) == 0)
1653 resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
1657 if (LocaleCompare("size",option+1) == 0)
1662 if (i == (ssize_t) argc)
1663 ThrowDisplayException(OptionError,"MissingArgument",option);
1664 if (IsGeometry(argv[i]) == MagickFalse)
1665 ThrowDisplayInvalidArgumentException(option,argv[i]);
1668 if (LocaleCompare("strip",option+1) == 0)
1670 if (LocaleCompare("support",option+1) == 0)
1672 i++; /* deprecated */
1675 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1679 if (LocaleCompare("text-font",option+1) == 0)
1681 resource_info.text_font=(char *) NULL;
1685 if (i == (ssize_t) argc)
1686 ThrowDisplayException(OptionError,"MissingArgument",option);
1687 resource_info.text_font=XGetResourceClass(resource_database,
1688 GetClientName(),"font",argv[i]);
1691 if (LocaleCompare("texture",option+1) == 0)
1696 if (i == (ssize_t) argc)
1697 ThrowDisplayException(OptionError,"MissingArgument",option);
1700 if (LocaleCompare("threshold",option+1) == 0)
1705 if (i == (ssize_t) argc)
1706 ThrowDisplayException(OptionError,"MissingArgument",option);
1707 if (IsGeometry(argv[i]) == MagickFalse)
1708 ThrowDisplayInvalidArgumentException(option,argv[i]);
1711 if (LocaleCompare("thumbnail",option+1) == 0)
1716 if (i == (ssize_t) argc)
1717 ThrowDisplayException(OptionError,"MissingArgument",option);
1718 if (IsGeometry(argv[i]) == MagickFalse)
1719 ThrowDisplayInvalidArgumentException(option,argv[i]);
1722 if (LocaleCompare("title",option+1) == 0)
1724 resource_info.title=(char *) NULL;
1728 if (i == (ssize_t) argc)
1729 ThrowDisplayException(OptionError,"MissingArgument",option);
1730 resource_info.title=argv[i];
1733 if (LocaleCompare("transparent-color",option+1) == 0)
1738 if (i == (ssize_t) (argc-1))
1739 ThrowDisplayException(OptionError,"MissingArgument",option);
1742 if (LocaleCompare("treedepth",option+1) == 0)
1744 quantize_info->tree_depth=0;
1748 if (i == (ssize_t) argc)
1749 ThrowDisplayException(OptionError,"MissingArgument",option);
1750 if (IsGeometry(argv[i]) == MagickFalse)
1751 ThrowDisplayInvalidArgumentException(option,argv[i]);
1752 quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1755 if (LocaleCompare("trim",option+1) == 0)
1757 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1761 if (LocaleCompare("update",option+1) == 0)
1763 resource_info.update=(unsigned int) (*option == '-');
1767 if (i == (ssize_t) argc)
1768 ThrowDisplayException(OptionError,"MissingArgument",option);
1769 if (IsGeometry(argv[i]) == MagickFalse)
1770 ThrowDisplayInvalidArgumentException(option,argv[i]);
1771 resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
1774 if (LocaleCompare("use-pixmap",option+1) == 0)
1776 resource_info.use_pixmap=(*option == '-') ? MagickTrue :
1780 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1784 if (LocaleCompare("verbose",option+1) == 0)
1786 if ((LocaleCompare("version",option+1) == 0) ||
1787 (LocaleCompare("-version",option+1) == 0))
1789 ListMagickVersion(stdout);
1792 if (LocaleCompare("visual",option+1) == 0)
1794 resource_info.visual_type=(char *) NULL;
1798 if (i == (ssize_t) argc)
1799 ThrowDisplayException(OptionError,"MissingArgument",option);
1800 resource_info.visual_type=argv[i];
1803 if (LocaleCompare("virtual-pixel",option+1) == 0)
1811 if (i == (ssize_t) (argc-1))
1812 ThrowDisplayException(OptionError,"MissingArgument",option);
1813 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1816 ThrowDisplayException(OptionError,
1817 "UnrecognizedVirtualPixelMethod",argv[i]);
1820 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1824 if (LocaleCompare("window",option+1) == 0)
1826 resource_info.window_id=(char *) NULL;
1830 if (i == (ssize_t) argc)
1831 ThrowDisplayException(OptionError,"MissingArgument",option);
1832 resource_info.window_id=argv[i];
1835 if (LocaleCompare("window-group",option+1) == 0)
1837 resource_info.window_group=(char *) NULL;
1841 if (i == (ssize_t) argc)
1842 ThrowDisplayException(OptionError,"MissingArgument",option);
1843 if (StringToDouble(argv[i],(char **) NULL) != 0)
1844 resource_info.window_group=argv[i];
1847 if (LocaleCompare("write",option+1) == 0)
1849 resource_info.write_filename=(char *) NULL;
1853 if (i == (ssize_t) argc)
1854 ThrowDisplayException(OptionError,"MissingArgument",option);
1855 resource_info.write_filename=argv[i];
1856 if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
1862 (void) FormatLocaleFile(stderr,"Overwrite %s? ",
1863 resource_info.write_filename);
1864 p=fgets(answer,(int) sizeof(answer),stdin);
1866 if (((*answer != 'y') && (*answer != 'Y')))
1867 return(MagickFalse);
1871 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1876 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1878 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1879 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1880 if (fire != MagickFalse)
1881 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1884 ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
1885 if (state & RetainColorsState)
1887 XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
1888 (void) XSync(display,MagickFalse);
1891 return(status != 0 ? MagickTrue : MagickFalse);
1895 (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1896 "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1897 return(DisplayUsage());