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-2015 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 "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
248 (void) printf("-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);
513 if (i == (ssize_t) argc)
514 iterations=image->iterations;
515 image_list=CloneImageList(image,exception);
516 if (image_list == (Image *) NULL)
517 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
518 GetExceptionMessage(errno));
519 display_image=image_list;
523 Transmogrify image as defined by the image processing options.
525 resource_info.quantum=1;
526 if (resource_info.window_id != (char *) NULL)
529 Display image to a specified X window.
531 status=XDisplayBackgroundImage(display,&resource_info,
532 display_image,exception);
533 if (status != MagickFalse)
535 state|=RetainColorsState;
538 if (GetNextImageInList(display_image) == (Image *) NULL)
548 Display image to X server.
550 if (resource_info.delay != 1)
551 display_image->delay=resource_info.delay;
552 nexus=XDisplayImage(display,&resource_info,argv,argc,
553 &display_image,&state,exception);
554 if (nexus == (Image *) NULL)
556 while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
561 if (nexus->montage != (char *) NULL)
564 User selected a visual directory image (montage).
569 next=XDisplayImage(display,&resource_info,argv,argc,&nexus,
571 if ((next == (Image *) NULL) &&
572 (GetNextImageInList(nexus) != (Image *) NULL))
574 display_image=GetNextImageInList(nexus);
575 nexus=NewImageList();
579 if (nexus != display_image)
580 nexus=DestroyImageList(nexus);
584 } while ((state & ExitState) == 0);
585 if (resource_info.write_filename != (char *) NULL)
590 (void) CopyMagickString(display_image->filename,
591 resource_info.write_filename,MagickPathExtent);
592 (void) SetImageInfo(image_info,1,exception);
593 status&=WriteImage(image_info,display_image,exception);
596 Proceed to next/previous image.
598 if ((state & FormerImageState) != 0)
599 for (l=0; l < (ssize_t) resource_info.quantum; l++)
601 if (GetPreviousImageInList(display_image) == (Image *) NULL)
603 display_image=GetPreviousImageInList(display_image);
606 for (l=0; l < (ssize_t) resource_info.quantum; l++)
608 if (GetNextImageInList(display_image) == (Image *) NULL)
610 display_image=GetNextImageInList(display_image);
612 if (l < (ssize_t) resource_info.quantum)
614 } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
616 Free image resources.
618 display_image=DestroyImageList(display_image);
619 if ((state & FormerImageState) == 0)
621 last_image=(size_t) image_number;
622 image_marker[i]=(size_t) image_number++;
627 Proceed to previous image.
629 for (i--; i > 0; i--)
630 if (image_marker[i] == (size_t) (image_number-2))
634 if ((i == (ssize_t) argc) && ((state & ExitState) == 0))
636 if ((state & ExitState) != 0)
639 Determine if we should proceed to the first image.
641 if (image_number < 0)
643 if ((state & FormerImageState) != 0)
646 for (i=1; i < (ssize_t) (argc-2); i++)
647 if (last_image == image_marker[i])
649 image_number=(ssize_t) image_marker[i]+1;
653 if (resource_info.window_id != (char *) NULL)
655 if ((iterations != 0) && (++iteration == (ssize_t) iterations))
657 if (LocaleCompare(filename,"-") == 0)
659 RemoveAllImageStack();
662 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
667 if (LocaleCompare("alpha",option+1) == 0)
675 if (i == (ssize_t) argc)
676 ThrowDisplayException(OptionError,"MissingArgument",option);
677 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
679 ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
683 if (LocaleCompare("antialias",option+1) == 0)
685 if (LocaleCompare("authenticate",option+1) == 0)
690 if (i == (ssize_t) argc)
691 ThrowDisplayException(OptionError,"MissingArgument",option);
694 if (LocaleCompare("auto-orient",option+1) == 0)
696 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
700 if (LocaleCompare("backdrop",option+1) == 0)
702 resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
705 if (LocaleCompare("background",option+1) == 0)
710 if (i == (ssize_t) argc)
711 ThrowDisplayException(OptionError,"MissingArgument",option);
712 resource_info.background_color=argv[i];
715 if (LocaleCompare("border",option+1) == 0)
720 if (i == (ssize_t) argc)
721 ThrowDisplayException(OptionError,"MissingArgument",option);
722 if (IsGeometry(argv[i]) == MagickFalse)
723 ThrowDisplayInvalidArgumentException(option,argv[i]);
726 if (LocaleCompare("bordercolor",option+1) == 0)
731 if (i == (ssize_t) argc)
732 ThrowDisplayException(OptionError,"MissingArgument",option);
733 resource_info.border_color=argv[i];
736 if (LocaleCompare("borderwidth",option+1) == 0)
738 resource_info.border_width=0;
742 if (i == (ssize_t) argc)
743 ThrowDisplayException(OptionError,"MissingArgument",option);
744 if (IsGeometry(argv[i]) == MagickFalse)
745 ThrowDisplayInvalidArgumentException(option,argv[i]);
746 resource_info.border_width=(unsigned int)
747 StringToUnsignedLong(argv[i]);
750 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
754 if (LocaleCompare("cache",option+1) == 0)
759 if (i == (ssize_t) argc)
760 ThrowDisplayException(OptionError,"MissingArgument",option);
761 if (IsGeometry(argv[i]) == MagickFalse)
762 ThrowDisplayInvalidArgumentException(option,argv[i]);
765 if (LocaleCompare("channel",option+1) == 0)
773 if (i == (ssize_t) argc)
774 ThrowDisplayException(OptionError,"MissingArgument",option);
775 channel=ParseChannelOption(argv[i]);
777 ThrowDisplayException(OptionError,"UnrecognizedChannelType",
781 if (LocaleCompare("clip",option+1) == 0)
783 if (LocaleCompare("clip-path",option+1) == 0)
786 if (i == (ssize_t) argc)
787 ThrowDisplayException(OptionError,"MissingArgument",option);
790 if (LocaleCompare("coalesce",option+1) == 0)
792 if (LocaleCompare("colormap",option+1) == 0)
794 resource_info.colormap=PrivateColormap;
798 if (i == (ssize_t) argc)
799 ThrowDisplayException(OptionError,"MissingArgument",option);
800 resource_info.colormap=UndefinedColormap;
801 if (LocaleCompare("private",argv[i]) == 0)
802 resource_info.colormap=PrivateColormap;
803 if (LocaleCompare("shared",argv[i]) == 0)
804 resource_info.colormap=SharedColormap;
805 if (resource_info.colormap == UndefinedColormap)
806 ThrowDisplayException(OptionError,"UnrecognizedColormapType",
810 if (LocaleCompare("colors",option+1) == 0)
812 quantize_info->number_colors=0;
816 if (i == (ssize_t) argc)
817 ThrowDisplayException(OptionError,"MissingArgument",option);
818 if (IsGeometry(argv[i]) == MagickFalse)
819 ThrowDisplayInvalidArgumentException(option,argv[i]);
820 quantize_info->number_colors=StringToUnsignedLong(argv[i]);
823 if (LocaleCompare("colorspace",option+1) == 0)
831 if (i == (ssize_t) argc)
832 ThrowDisplayException(OptionError,"MissingArgument",option);
833 colorspace=ParseCommandOption(MagickColorspaceOptions,
834 MagickFalse,argv[i]);
836 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
840 if (LocaleCompare("comment",option+1) == 0)
845 if (i == (ssize_t) argc)
846 ThrowDisplayException(OptionError,"MissingArgument",option);
849 if (LocaleCompare("compress",option+1) == 0)
857 if (i == (ssize_t) argc)
858 ThrowDisplayException(OptionError,"MissingArgument",option);
859 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
862 ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
866 if (LocaleCompare("concurrent",option+1) == 0)
868 if (LocaleCompare("contrast",option+1) == 0)
870 if (LocaleCompare("crop",option+1) == 0)
875 if (i == (ssize_t) argc)
876 ThrowDisplayException(OptionError,"MissingArgument",option);
877 if (IsGeometry(argv[i]) == MagickFalse)
878 ThrowDisplayInvalidArgumentException(option,argv[i]);
881 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
885 if (LocaleCompare("debug",option+1) == 0)
893 if (i == (ssize_t) argc)
894 ThrowDisplayException(OptionError,"MissingArgument",option);
895 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
897 ThrowDisplayException(OptionError,"UnrecognizedEventType",
899 (void) SetLogEventMask(argv[i]);
902 if (LocaleCompare("decipher",option+1) == 0)
907 if (i == (ssize_t) argc)
908 ThrowDisplayException(OptionError,"MissingArgument",option);
911 if (LocaleCompare("define",option+1) == 0)
914 if (i == (ssize_t) argc)
915 ThrowDisplayException(OptionError,"MissingArgument",option);
921 define=GetImageOption(image_info,argv[i]);
922 if (define == (const char *) NULL)
923 ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
928 if (LocaleCompare("delay",option+1) == 0)
933 if (i == (ssize_t) argc)
934 ThrowDisplayException(OptionError,"MissingArgument",option);
935 if (IsGeometry(argv[i]) == MagickFalse)
936 ThrowDisplayInvalidArgumentException(option,argv[i]);
939 if (LocaleCompare("density",option+1) == 0)
944 if (i == (ssize_t) argc)
945 ThrowDisplayException(OptionError,"MissingArgument",option);
946 if (IsGeometry(argv[i]) == MagickFalse)
947 ThrowDisplayInvalidArgumentException(option,argv[i]);
950 if (LocaleCompare("depth",option+1) == 0)
955 if (i == (ssize_t) argc)
956 ThrowDisplayException(OptionError,"MissingArgument",option);
957 if (IsGeometry(argv[i]) == MagickFalse)
958 ThrowDisplayInvalidArgumentException(option,argv[i]);
961 if (LocaleCompare("deskew",option+1) == 0)
966 if (i == (ssize_t) argc)
967 ThrowDisplayException(OptionError,"MissingArgument",option);
968 if (IsGeometry(argv[i]) == MagickFalse)
969 ThrowDisplayInvalidArgumentException(option,argv[i]);
972 if (LocaleCompare("despeckle",option+1) == 0)
974 if (LocaleCompare("display",option+1) == 0)
979 if (i == (ssize_t) argc)
980 ThrowDisplayException(OptionError,"MissingArgument",option);
983 if (LocaleCompare("dispose",option+1) == 0)
991 if (i == (ssize_t) argc)
992 ThrowDisplayException(OptionError,"MissingArgument",option);
993 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
995 ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
999 if (LocaleCompare("dither",option+1) == 0)
1004 quantize_info->dither_method=NoDitherMethod;
1008 if (i == (ssize_t) argc)
1009 ThrowDisplayException(OptionError,"MissingArgument",option);
1010 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1012 ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
1014 quantize_info->dither_method=(DitherMethod) method;
1017 if (LocaleCompare("duration",option+1) == 0)
1022 if (i == (ssize_t) argc)
1023 ThrowDisplayException(OptionError,"MissingArgument",option);
1024 if (IsGeometry(argv[i]) == MagickFalse)
1025 ThrowDisplayInvalidArgumentException(option,argv[i]);
1028 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1032 if (LocaleCompare("edge",option+1) == 0)
1037 if (i == (ssize_t) argc)
1038 ThrowDisplayException(OptionError,"MissingArgument",option);
1039 if (IsGeometry(argv[i]) == MagickFalse)
1040 ThrowDisplayInvalidArgumentException(option,argv[i]);
1043 if (LocaleCompare("endian",option+1) == 0)
1051 if (i == (ssize_t) argc)
1052 ThrowDisplayException(OptionError,"MissingArgument",option);
1053 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1056 ThrowDisplayException(OptionError,"UnrecognizedEndianType",
1060 if (LocaleCompare("enhance",option+1) == 0)
1062 if (LocaleCompare("equalize",option+1) == 0)
1064 if (LocaleCompare("extract",option+1) == 0)
1069 if (i == (ssize_t) argc)
1070 ThrowDisplayException(OptionError,"MissingArgument",option);
1071 if (IsGeometry(argv[i]) == MagickFalse)
1072 ThrowDisplayInvalidArgumentException(option,argv[i]);
1075 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1079 if (LocaleCompare("filter",option+1) == 0)
1087 if (i == (ssize_t) argc)
1088 ThrowDisplayException(OptionError,"MissingArgument",option);
1089 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1091 ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
1095 if (LocaleCompare("flatten",option+1) == 0)
1097 if (LocaleCompare("flip",option+1) == 0)
1099 if (LocaleCompare("flop",option+1) == 0)
1101 if (LocaleCompare("font",option+1) == 0)
1106 if (i == (ssize_t) argc)
1107 ThrowDisplayException(OptionError,"MissingArgument",option);
1108 resource_info.font=XGetResourceClass(resource_database,
1109 GetClientName(),"font",argv[i]);
1112 if (LocaleCompare("foreground",option+1) == 0)
1117 if (i == (ssize_t) argc)
1118 ThrowDisplayException(OptionError,"MissingArgument",option);
1119 resource_info.foreground_color=argv[i];
1122 if (LocaleCompare("format",option+1) == 0)
1127 if (i == (ssize_t) argc)
1128 ThrowDisplayException(OptionError,"MissingArgument",option);
1131 if (LocaleCompare("frame",option+1) == 0)
1136 if (i == (ssize_t) argc)
1137 ThrowDisplayException(OptionError,"MissingArgument",option);
1138 if (IsGeometry(argv[i]) == MagickFalse)
1139 ThrowDisplayInvalidArgumentException(option,argv[i]);
1142 if (LocaleCompare("fuzz",option+1) == 0)
1147 if (i == (ssize_t) argc)
1148 ThrowDisplayException(OptionError,"MissingArgument",option);
1149 if (IsGeometry(argv[i]) == MagickFalse)
1150 ThrowDisplayInvalidArgumentException(option,argv[i]);
1153 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1157 if (LocaleCompare("gamma",option+1) == 0)
1160 if (i == (ssize_t) argc)
1161 ThrowDisplayException(OptionError,"MissingArgument",option);
1162 if (IsGeometry(argv[i]) == MagickFalse)
1163 ThrowDisplayInvalidArgumentException(option,argv[i]);
1166 if (LocaleCompare("geometry",option+1) == 0)
1168 resource_info.image_geometry=(char *) NULL;
1171 (void) CopyMagickString(argv[i]+1,"sans",MagickPathExtent);
1173 if (i == (ssize_t) argc)
1174 ThrowDisplayException(OptionError,"MissingArgument",option);
1175 if (IsGeometry(argv[i]) == MagickFalse)
1176 ThrowDisplayInvalidArgumentException(option,argv[i]);
1177 resource_info.image_geometry=ConstantString(argv[i]);
1180 if (LocaleCompare("gravity",option+1) == 0)
1188 if (i == (ssize_t) argc)
1189 ThrowDisplayException(OptionError,"MissingArgument",option);
1190 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1193 ThrowDisplayException(OptionError,"UnrecognizedGravityType",
1197 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1201 if ((LocaleCompare("help",option+1) == 0) ||
1202 (LocaleCompare("-help",option+1) == 0))
1204 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1208 if (LocaleCompare("identify",option+1) == 0)
1210 if (LocaleCompare("iconGeometry",option+1) == 0)
1212 resource_info.icon_geometry=(char *) NULL;
1216 if (i == (ssize_t) argc)
1217 ThrowDisplayException(OptionError,"MissingArgument",option);
1218 if (IsGeometry(argv[i]) == MagickFalse)
1219 ThrowDisplayInvalidArgumentException(option,argv[i]);
1220 resource_info.icon_geometry=argv[i];
1223 if (LocaleCompare("iconic",option+1) == 0)
1225 resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
1228 if (LocaleCompare("immutable",option+1) == 0)
1230 resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
1233 if (LocaleCompare("interlace",option+1) == 0)
1241 if (i == (ssize_t) argc)
1242 ThrowDisplayException(OptionError,"MissingArgument",option);
1243 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1246 ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
1250 if (LocaleCompare("interpolate",option+1) == 0)
1258 if (i == (ssize_t) argc)
1259 ThrowDisplayException(OptionError,"MissingArgument",option);
1260 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1262 if (interpolate < 0)
1263 ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
1267 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1271 if (LocaleCompare("label",option+1) == 0)
1276 if (i == (ssize_t) argc)
1277 ThrowDisplayException(OptionError,"MissingArgument",option);
1280 if (LocaleCompare("limit",option+1) == 0)
1294 if (i == (ssize_t) argc)
1295 ThrowDisplayException(OptionError,"MissingArgument",option);
1296 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
1299 ThrowDisplayException(OptionError,"UnrecognizedResourceType",
1302 if (i == (ssize_t) argc)
1303 ThrowDisplayException(OptionError,"MissingArgument",option);
1304 value=StringToDouble(argv[i],&p);
1306 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
1307 ThrowDisplayInvalidArgumentException(option,argv[i]);
1310 if (LocaleCompare("list",option+1) == 0)
1318 if (i == (ssize_t) argc)
1319 ThrowDisplayException(OptionError,"MissingArgument",option);
1320 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
1322 ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1323 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
1326 return(status == 0 ? MagickTrue : MagickFalse);
1328 if (LocaleCompare("log",option+1) == 0)
1333 if ((i == (ssize_t) argc) ||
1334 (strchr(argv[i],'%') == (char *) NULL))
1335 ThrowDisplayException(OptionError,"MissingArgument",option);
1338 if (LocaleCompare("loop",option+1) == 0)
1343 if (i == (ssize_t) argc)
1344 ThrowDisplayException(OptionError,"MissingArgument",option);
1345 if (IsGeometry(argv[i]) == MagickFalse)
1346 ThrowDisplayInvalidArgumentException(option,argv[i]);
1347 iterations=StringToUnsignedLong(argv[i]);
1350 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1354 if (LocaleCompare("magnify",option+1) == 0)
1356 resource_info.magnify=2;
1360 if (i == (ssize_t) argc)
1361 ThrowDisplayException(OptionError,"MissingArgument",option);
1362 if (IsGeometry(argv[i]) == MagickFalse)
1363 ThrowDisplayInvalidArgumentException(option,argv[i]);
1364 resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
1367 if (LocaleCompare("map",option+1) == 0)
1369 resource_info.map_type=(char *) NULL;
1372 (void) strcpy(argv[i]+1,"san");
1374 if (i == (ssize_t) argc)
1375 ThrowDisplayException(OptionError,"MissingArgument",option);
1376 resource_info.map_type=argv[i];
1379 if (LocaleCompare("matte",option+1) == 0)
1381 if (LocaleCompare("mattecolor",option+1) == 0)
1386 if (i == (ssize_t) argc)
1387 ThrowDisplayException(OptionError,"MissingArgument",option);
1388 resource_info.matte_color=argv[i];
1391 if (LocaleCompare("monitor",option+1) == 0)
1393 if (LocaleCompare("monochrome",option+1) == 0)
1397 quantize_info->number_colors=2;
1398 quantize_info->colorspace=GRAYColorspace;
1401 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1405 if (LocaleCompare("name",option+1) == 0)
1407 resource_info.name=(char *) NULL;
1411 if (i == (ssize_t) argc)
1412 ThrowDisplayException(OptionError,"MissingArgument",option);
1413 resource_info.name=ConstantString(argv[i]);
1416 if (LocaleCompare("negate",option+1) == 0)
1418 if (LocaleCompare("noop",option+1) == 0)
1420 if (LocaleCompare("normalize",option+1) == 0)
1422 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1426 if (LocaleCompare("page",option+1) == 0)
1428 resource_info.image_geometry=(char *) NULL;
1432 if (i == (ssize_t) argc)
1433 ThrowDisplayException(OptionError,"MissingArgument",option);
1434 resource_info.image_geometry=ConstantString(argv[i]);
1437 if (LocaleCompare("profile",option+1) == 0)
1440 if (i == (ssize_t) argc)
1441 ThrowDisplayException(OptionError,"MissingArgument",option);
1444 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1448 if (LocaleCompare("quality",option+1) == 0)
1453 if (i == (ssize_t) argc)
1454 ThrowDisplayException(OptionError,"MissingArgument",option);
1455 if (IsGeometry(argv[i]) == MagickFalse)
1456 ThrowDisplayInvalidArgumentException(option,argv[i]);
1459 if (LocaleCompare("quantize",option+1) == 0)
1467 if (i == (ssize_t) argc)
1468 ThrowDisplayException(OptionError,"MissingArgument",option);
1469 colorspace=ParseCommandOption(MagickColorspaceOptions,
1470 MagickFalse,argv[i]);
1472 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
1476 if (LocaleCompare("quiet",option+1) == 0)
1478 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1482 if (LocaleCompare("raise",option+1) == 0)
1485 if (i == (ssize_t) argc)
1486 ThrowDisplayException(OptionError,"MissingArgument",option);
1487 if (IsGeometry(argv[i]) == MagickFalse)
1488 ThrowDisplayInvalidArgumentException(option,argv[i]);
1491 if (LocaleCompare("regard-warnings",option+1) == 0)
1493 if (LocaleCompare("remote",option+1) == 0)
1496 if (i == (ssize_t) argc)
1497 ThrowDisplayException(OptionError,"MissingArgument",option);
1498 if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1499 return(MagickFalse);
1503 if (LocaleCompare("repage",option+1) == 0)
1508 if (i == (ssize_t) argc)
1509 ThrowDisplayException(OptionError,"MissingArgument",option);
1510 if (IsGeometry(argv[i]) == MagickFalse)
1511 ThrowDisplayInvalidArgumentException(option,argv[i]);
1514 if (LocaleCompare("resample",option+1) == 0)
1519 if (i == (ssize_t) argc)
1520 ThrowDisplayException(OptionError,"MissingArgument",option);
1521 if (IsGeometry(argv[i]) == MagickFalse)
1522 ThrowDisplayInvalidArgumentException(option,argv[i]);
1525 if (LocaleCompare("resize",option+1) == 0)
1530 if (i == (ssize_t) argc)
1531 ThrowDisplayException(OptionError,"MissingArgument",option);
1532 if (IsGeometry(argv[i]) == MagickFalse)
1533 ThrowDisplayInvalidArgumentException(option,argv[i]);
1536 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1538 respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1541 if (LocaleCompare("roll",option+1) == 0)
1546 if (i == (ssize_t) argc)
1547 ThrowDisplayException(OptionError,"MissingArgument",option);
1548 if (IsGeometry(argv[i]) == MagickFalse)
1549 ThrowDisplayInvalidArgumentException(option,argv[i]);
1552 if (LocaleCompare("rotate",option+1) == 0)
1555 if (i == (ssize_t) argc)
1556 ThrowDisplayException(OptionError,"MissingArgument",option);
1557 if (IsGeometry(argv[i]) == MagickFalse)
1558 ThrowDisplayInvalidArgumentException(option,argv[i]);
1561 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1565 if (LocaleCompare("sample",option+1) == 0)
1570 if (i == (ssize_t) argc)
1571 ThrowDisplayException(OptionError,"MissingArgument",option);
1572 if (IsGeometry(argv[i]) == MagickFalse)
1573 ThrowDisplayInvalidArgumentException(option,argv[i]);
1576 if (LocaleCompare("sampling-factor",option+1) == 0)
1581 if (i == (ssize_t) argc)
1582 ThrowDisplayException(OptionError,"MissingArgument",option);
1583 if (IsGeometry(argv[i]) == MagickFalse)
1584 ThrowDisplayInvalidArgumentException(option,argv[i]);
1587 if (LocaleCompare("scenes",option+1) == 0)
1592 if (i == (ssize_t) argc)
1593 ThrowDisplayException(OptionError,"MissingArgument",option);
1594 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1595 ThrowDisplayInvalidArgumentException(option,argv[i]);
1598 if (LocaleCompare("seed",option+1) == 0)
1603 if (i == (ssize_t) argc)
1604 ThrowDisplayException(OptionError,"MissingArgument",option);
1605 if (IsGeometry(argv[i]) == MagickFalse)
1606 ThrowDisplayInvalidArgumentException(option,argv[i]);
1609 if (LocaleCompare("segment",option+1) == 0)
1614 if (i == (ssize_t) argc)
1615 ThrowDisplayException(OptionError,"MissingArgument",option);
1616 if (IsGeometry(argv[i]) == MagickFalse)
1617 ThrowDisplayInvalidArgumentException(option,argv[i]);
1620 if (LocaleCompare("set",option+1) == 0)
1623 if (i == (ssize_t) argc)
1624 ThrowDisplayException(OptionError,"MissingArgument",option);
1628 if (i == (ssize_t) argc)
1629 ThrowDisplayException(OptionError,"MissingArgument",option);
1632 if (LocaleCompare("sharpen",option+1) == 0)
1637 if (i == (ssize_t) argc)
1638 ThrowDisplayException(OptionError,"MissingArgument",option);
1639 if (IsGeometry(argv[i]) == MagickFalse)
1640 ThrowDisplayInvalidArgumentException(option,argv[i]);
1643 if (LocaleCompare("shared-memory",option+1) == 0)
1645 resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
1649 if (LocaleCompare("size",option+1) == 0)
1654 if (i == (ssize_t) argc)
1655 ThrowDisplayException(OptionError,"MissingArgument",option);
1656 if (IsGeometry(argv[i]) == MagickFalse)
1657 ThrowDisplayInvalidArgumentException(option,argv[i]);
1660 if (LocaleCompare("strip",option+1) == 0)
1662 if (LocaleCompare("support",option+1) == 0)
1664 i++; /* deprecated */
1667 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1671 if (LocaleCompare("text-font",option+1) == 0)
1673 resource_info.text_font=(char *) NULL;
1677 if (i == (ssize_t) argc)
1678 ThrowDisplayException(OptionError,"MissingArgument",option);
1679 resource_info.text_font=XGetResourceClass(resource_database,
1680 GetClientName(),"font",argv[i]);
1683 if (LocaleCompare("texture",option+1) == 0)
1688 if (i == (ssize_t) argc)
1689 ThrowDisplayException(OptionError,"MissingArgument",option);
1692 if (LocaleCompare("threshold",option+1) == 0)
1697 if (i == (ssize_t) argc)
1698 ThrowDisplayException(OptionError,"MissingArgument",option);
1699 if (IsGeometry(argv[i]) == MagickFalse)
1700 ThrowDisplayInvalidArgumentException(option,argv[i]);
1703 if (LocaleCompare("thumbnail",option+1) == 0)
1708 if (i == (ssize_t) argc)
1709 ThrowDisplayException(OptionError,"MissingArgument",option);
1710 if (IsGeometry(argv[i]) == MagickFalse)
1711 ThrowDisplayInvalidArgumentException(option,argv[i]);
1714 if (LocaleCompare("title",option+1) == 0)
1716 resource_info.title=(char *) NULL;
1720 if (i == (ssize_t) argc)
1721 ThrowDisplayException(OptionError,"MissingArgument",option);
1722 resource_info.title=argv[i];
1725 if (LocaleCompare("transparent-color",option+1) == 0)
1730 if (i == (ssize_t) argc)
1731 ThrowDisplayException(OptionError,"MissingArgument",option);
1734 if (LocaleCompare("treedepth",option+1) == 0)
1736 quantize_info->tree_depth=0;
1740 if (i == (ssize_t) argc)
1741 ThrowDisplayException(OptionError,"MissingArgument",option);
1742 if (IsGeometry(argv[i]) == MagickFalse)
1743 ThrowDisplayInvalidArgumentException(option,argv[i]);
1744 quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1747 if (LocaleCompare("trim",option+1) == 0)
1749 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1753 if (LocaleCompare("update",option+1) == 0)
1755 resource_info.update=(unsigned int) (*option == '-');
1759 if (i == (ssize_t) argc)
1760 ThrowDisplayException(OptionError,"MissingArgument",option);
1761 if (IsGeometry(argv[i]) == MagickFalse)
1762 ThrowDisplayInvalidArgumentException(option,argv[i]);
1763 resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
1766 if (LocaleCompare("use-pixmap",option+1) == 0)
1768 resource_info.use_pixmap=(*option == '-') ? MagickTrue :
1772 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1776 if (LocaleCompare("verbose",option+1) == 0)
1778 if ((LocaleCompare("version",option+1) == 0) ||
1779 (LocaleCompare("-version",option+1) == 0))
1781 ListMagickVersion(stdout);
1784 if (LocaleCompare("visual",option+1) == 0)
1786 resource_info.visual_type=(char *) NULL;
1790 if (i == (ssize_t) argc)
1791 ThrowDisplayException(OptionError,"MissingArgument",option);
1792 resource_info.visual_type=argv[i];
1795 if (LocaleCompare("virtual-pixel",option+1) == 0)
1803 if (i == (ssize_t) argc)
1804 ThrowDisplayException(OptionError,"MissingArgument",option);
1805 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1808 ThrowDisplayException(OptionError,
1809 "UnrecognizedVirtualPixelMethod",argv[i]);
1812 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1816 if (LocaleCompare("window",option+1) == 0)
1818 resource_info.window_id=(char *) NULL;
1822 if (i == (ssize_t) argc)
1823 ThrowDisplayException(OptionError,"MissingArgument",option);
1824 resource_info.window_id=argv[i];
1827 if (LocaleCompare("window-group",option+1) == 0)
1829 resource_info.window_group=(char *) NULL;
1833 if (i == (ssize_t) argc)
1834 ThrowDisplayException(OptionError,"MissingArgument",option);
1835 if (StringToDouble(argv[i],(char **) NULL) != 0)
1836 resource_info.window_group=argv[i];
1839 if (LocaleCompare("write",option+1) == 0)
1841 resource_info.write_filename=(char *) NULL;
1845 if (i == (ssize_t) argc)
1846 ThrowDisplayException(OptionError,"MissingArgument",option);
1847 resource_info.write_filename=argv[i];
1848 if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
1854 (void) FormatLocaleFile(stderr,"Overwrite %s? ",
1855 resource_info.write_filename);
1856 p=fgets(answer,(int) sizeof(answer),stdin);
1858 if (((*answer != 'y') && (*answer != 'Y')))
1859 return(MagickFalse);
1863 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1868 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1870 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1871 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1872 if (fire != MagickFalse)
1873 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1876 ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
1877 if (state & RetainColorsState)
1879 XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
1880 (void) XSync(display,MagickFalse);
1883 return(status != 0 ? MagickTrue : MagickFalse);
1887 (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1888 "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1889 return(DisplayUsage());