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 display_image=GetPreviousImageInList(display_image);
612 if (display_image == (Image *) NULL)
616 for (l=0; l < (ssize_t) resource_info.quantum; l++)
618 display_image=GetNextImageInList(display_image);
619 if (display_image == (Image *) NULL)
622 } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
624 Free image resources.
626 display_image=GetFirstImageInList(display_image);
627 if (image_list != display_image)
628 image_list=DestroyImageList(image_list);
629 display_image=DestroyImageList(display_image);
630 if ((state & FormerImageState) == 0)
632 last_image=(size_t) image_number;
633 image_marker[i]=(size_t) image_number++;
638 Proceed to previous image.
640 for (i--; i > 0; i--)
641 if (image_marker[i] == (size_t) (image_number-2))
645 if ((i == (ssize_t) (argc-1)) && ((state & ExitState) == 0))
647 if ((state & ExitState) != 0)
650 Determine if we should proceed to the first image.
652 if (image_number < 0)
654 if ((state & FormerImageState) != 0)
657 for (i=1; i < (ssize_t) (argc-2); i++)
658 if (last_image == image_marker[i])
660 image_number=(ssize_t) image_marker[i]+1;
664 if (resource_info.window_id != (char *) NULL)
666 if ((iterations != 0) && (++iteration == (ssize_t) iterations))
668 if (LocaleCompare(filename,"-") == 0)
670 RemoveAllImageStack();
673 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
678 if (LocaleCompare("alpha",option+1) == 0)
686 if (i == (ssize_t) argc)
687 ThrowDisplayException(OptionError,"MissingArgument",option);
688 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
690 ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
694 if (LocaleCompare("antialias",option+1) == 0)
696 if (LocaleCompare("authenticate",option+1) == 0)
701 if (i == (ssize_t) argc)
702 ThrowDisplayException(OptionError,"MissingArgument",option);
705 if (LocaleCompare("auto-orient",option+1) == 0)
707 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
711 if (LocaleCompare("backdrop",option+1) == 0)
713 resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
716 if (LocaleCompare("background",option+1) == 0)
721 if (i == (ssize_t) argc)
722 ThrowDisplayException(OptionError,"MissingArgument",option);
723 resource_info.background_color=argv[i];
726 if (LocaleCompare("border",option+1) == 0)
731 if (i == (ssize_t) argc)
732 ThrowDisplayException(OptionError,"MissingArgument",option);
733 if (IsGeometry(argv[i]) == MagickFalse)
734 ThrowDisplayInvalidArgumentException(option,argv[i]);
737 if (LocaleCompare("bordercolor",option+1) == 0)
742 if (i == (ssize_t) argc)
743 ThrowDisplayException(OptionError,"MissingArgument",option);
744 resource_info.border_color=argv[i];
747 if (LocaleCompare("borderwidth",option+1) == 0)
749 resource_info.border_width=0;
753 if (i == (ssize_t) argc)
754 ThrowDisplayException(OptionError,"MissingArgument",option);
755 if (IsGeometry(argv[i]) == MagickFalse)
756 ThrowDisplayInvalidArgumentException(option,argv[i]);
757 resource_info.border_width=(unsigned int)
758 StringToUnsignedLong(argv[i]);
761 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
765 if (LocaleCompare("cache",option+1) == 0)
770 if (i == (ssize_t) argc)
771 ThrowDisplayException(OptionError,"MissingArgument",option);
772 if (IsGeometry(argv[i]) == MagickFalse)
773 ThrowDisplayInvalidArgumentException(option,argv[i]);
776 if (LocaleCompare("channel",option+1) == 0)
784 if (i == (ssize_t) (argc-1))
785 ThrowDisplayException(OptionError,"MissingArgument",option);
786 channel=ParseChannelOption(argv[i]);
788 ThrowDisplayException(OptionError,"UnrecognizedChannelType",
792 if (LocaleCompare("clip",option+1) == 0)
794 if (LocaleCompare("clip-path",option+1) == 0)
797 if (i == (ssize_t) argc)
798 ThrowDisplayException(OptionError,"MissingArgument",option);
801 if (LocaleCompare("coalesce",option+1) == 0)
803 if (LocaleCompare("colormap",option+1) == 0)
805 resource_info.colormap=PrivateColormap;
809 if (i == (ssize_t) argc)
810 ThrowDisplayException(OptionError,"MissingArgument",option);
811 resource_info.colormap=UndefinedColormap;
812 if (LocaleCompare("private",argv[i]) == 0)
813 resource_info.colormap=PrivateColormap;
814 if (LocaleCompare("shared",argv[i]) == 0)
815 resource_info.colormap=SharedColormap;
816 if (resource_info.colormap == UndefinedColormap)
817 ThrowDisplayException(OptionError,"UnrecognizedColormapType",
821 if (LocaleCompare("colors",option+1) == 0)
823 quantize_info->number_colors=0;
827 if (i == (ssize_t) argc)
828 ThrowDisplayException(OptionError,"MissingArgument",option);
829 if (IsGeometry(argv[i]) == MagickFalse)
830 ThrowDisplayInvalidArgumentException(option,argv[i]);
831 quantize_info->number_colors=StringToUnsignedLong(argv[i]);
834 if (LocaleCompare("colorspace",option+1) == 0)
842 if (i == (ssize_t) argc)
843 ThrowDisplayException(OptionError,"MissingArgument",option);
844 colorspace=ParseCommandOption(MagickColorspaceOptions,
845 MagickFalse,argv[i]);
847 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
851 if (LocaleCompare("comment",option+1) == 0)
856 if (i == (ssize_t) argc)
857 ThrowDisplayException(OptionError,"MissingArgument",option);
860 if (LocaleCompare("compress",option+1) == 0)
868 if (i == (ssize_t) argc)
869 ThrowDisplayException(OptionError,"MissingArgument",option);
870 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
873 ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
877 if (LocaleCompare("concurrent",option+1) == 0)
879 if (LocaleCompare("contrast",option+1) == 0)
881 if (LocaleCompare("crop",option+1) == 0)
886 if (i == (ssize_t) argc)
887 ThrowDisplayException(OptionError,"MissingArgument",option);
888 if (IsGeometry(argv[i]) == MagickFalse)
889 ThrowDisplayInvalidArgumentException(option,argv[i]);
892 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
896 if (LocaleCompare("debug",option+1) == 0)
904 if (i == (ssize_t) argc)
905 ThrowDisplayException(OptionError,"MissingArgument",option);
906 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
908 ThrowDisplayException(OptionError,"UnrecognizedEventType",
910 (void) SetLogEventMask(argv[i]);
913 if (LocaleCompare("decipher",option+1) == 0)
918 if (i == (ssize_t) (argc-1))
919 ThrowDisplayException(OptionError,"MissingArgument",option);
922 if (LocaleCompare("define",option+1) == 0)
925 if (i == (ssize_t) argc)
926 ThrowDisplayException(OptionError,"MissingArgument",option);
932 define=GetImageOption(image_info,argv[i]);
933 if (define == (const char *) NULL)
934 ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
939 if (LocaleCompare("delay",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("density",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("depth",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("deskew",option+1) == 0)
977 if (i == (ssize_t) (argc-1))
978 ThrowDisplayException(OptionError,"MissingArgument",option);
979 if (IsGeometry(argv[i]) == MagickFalse)
980 ThrowDisplayInvalidArgumentException(option,argv[i]);
983 if (LocaleCompare("despeckle",option+1) == 0)
985 if (LocaleCompare("display",option+1) == 0)
990 if (i == (ssize_t) argc)
991 ThrowDisplayException(OptionError,"MissingArgument",option);
994 if (LocaleCompare("dispose",option+1) == 0)
1002 if (i == (ssize_t) argc)
1003 ThrowDisplayException(OptionError,"MissingArgument",option);
1004 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1006 ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
1010 if (LocaleCompare("dither",option+1) == 0)
1015 quantize_info->dither_method=NoDitherMethod;
1019 if (i == (ssize_t) argc)
1020 ThrowDisplayException(OptionError,"MissingArgument",option);
1021 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1023 ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
1025 quantize_info->dither_method=(DitherMethod) method;
1028 if (LocaleCompare("duration",option+1) == 0)
1033 if (i == (ssize_t) (argc-1))
1034 ThrowDisplayException(OptionError,"MissingArgument",option);
1035 if (IsGeometry(argv[i]) == MagickFalse)
1036 ThrowDisplayInvalidArgumentException(option,argv[i]);
1039 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1043 if (LocaleCompare("edge",option+1) == 0)
1048 if (i == (ssize_t) argc)
1049 ThrowDisplayException(OptionError,"MissingArgument",option);
1050 if (IsGeometry(argv[i]) == MagickFalse)
1051 ThrowDisplayInvalidArgumentException(option,argv[i]);
1054 if (LocaleCompare("endian",option+1) == 0)
1062 if (i == (ssize_t) argc)
1063 ThrowDisplayException(OptionError,"MissingArgument",option);
1064 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1067 ThrowDisplayException(OptionError,"UnrecognizedEndianType",
1071 if (LocaleCompare("enhance",option+1) == 0)
1073 if (LocaleCompare("equalize",option+1) == 0)
1075 if (LocaleCompare("extract",option+1) == 0)
1080 if (i == (ssize_t) argc)
1081 ThrowDisplayException(OptionError,"MissingArgument",option);
1082 if (IsGeometry(argv[i]) == MagickFalse)
1083 ThrowDisplayInvalidArgumentException(option,argv[i]);
1086 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1090 if (LocaleCompare("filter",option+1) == 0)
1098 if (i == (ssize_t) argc)
1099 ThrowDisplayException(OptionError,"MissingArgument",option);
1100 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1102 ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
1106 if (LocaleCompare("flatten",option+1) == 0)
1108 if (LocaleCompare("flip",option+1) == 0)
1110 if (LocaleCompare("flop",option+1) == 0)
1112 if (LocaleCompare("font",option+1) == 0)
1117 if (i == (ssize_t) argc)
1118 ThrowDisplayException(OptionError,"MissingArgument",option);
1119 resource_info.font=XGetResourceClass(resource_database,
1120 GetClientName(),"font",argv[i]);
1123 if (LocaleCompare("foreground",option+1) == 0)
1128 if (i == (ssize_t) argc)
1129 ThrowDisplayException(OptionError,"MissingArgument",option);
1130 resource_info.foreground_color=argv[i];
1133 if (LocaleCompare("format",option+1) == 0)
1138 if (i == (ssize_t) (argc-1))
1139 ThrowDisplayException(OptionError,"MissingArgument",option);
1142 if (LocaleCompare("frame",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 if (LocaleCompare("fuzz",option+1) == 0)
1158 if (i == (ssize_t) (argc-1))
1159 ThrowDisplayException(OptionError,"MissingArgument",option);
1160 if (IsGeometry(argv[i]) == MagickFalse)
1161 ThrowDisplayInvalidArgumentException(option,argv[i]);
1164 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1168 if (LocaleCompare("gamma",option+1) == 0)
1171 if (i == (ssize_t) argc)
1172 ThrowDisplayException(OptionError,"MissingArgument",option);
1173 if (IsGeometry(argv[i]) == MagickFalse)
1174 ThrowDisplayInvalidArgumentException(option,argv[i]);
1177 if (LocaleCompare("geometry",option+1) == 0)
1179 resource_info.image_geometry=(char *) NULL;
1182 (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
1184 if (i == (ssize_t) argc)
1185 ThrowDisplayException(OptionError,"MissingArgument",option);
1186 if (IsGeometry(argv[i]) == MagickFalse)
1187 ThrowDisplayInvalidArgumentException(option,argv[i]);
1188 resource_info.image_geometry=ConstantString(argv[i]);
1191 if (LocaleCompare("gravity",option+1) == 0)
1199 if (i == (ssize_t) (argc-1))
1200 ThrowDisplayException(OptionError,"MissingArgument",option);
1201 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1204 ThrowDisplayException(OptionError,"UnrecognizedGravityType",
1208 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1212 if ((LocaleCompare("help",option+1) == 0) ||
1213 (LocaleCompare("-help",option+1) == 0))
1215 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1219 if (LocaleCompare("identify",option+1) == 0)
1221 if (LocaleCompare("iconGeometry",option+1) == 0)
1223 resource_info.icon_geometry=(char *) NULL;
1227 if (i == (ssize_t) argc)
1228 ThrowDisplayException(OptionError,"MissingArgument",option);
1229 if (IsGeometry(argv[i]) == MagickFalse)
1230 ThrowDisplayInvalidArgumentException(option,argv[i]);
1231 resource_info.icon_geometry=argv[i];
1234 if (LocaleCompare("iconic",option+1) == 0)
1236 resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
1239 if (LocaleCompare("immutable",option+1) == 0)
1241 resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
1244 if (LocaleCompare("interlace",option+1) == 0)
1252 if (i == (ssize_t) argc)
1253 ThrowDisplayException(OptionError,"MissingArgument",option);
1254 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1257 ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
1261 if (LocaleCompare("interpolate",option+1) == 0)
1269 if (i == (ssize_t) argc)
1270 ThrowDisplayException(OptionError,"MissingArgument",option);
1271 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1273 if (interpolate < 0)
1274 ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
1278 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1282 if (LocaleCompare("label",option+1) == 0)
1287 if (i == (ssize_t) argc)
1288 ThrowDisplayException(OptionError,"MissingArgument",option);
1291 if (LocaleCompare("limit",option+1) == 0)
1305 if (i == (ssize_t) argc)
1306 ThrowDisplayException(OptionError,"MissingArgument",option);
1307 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
1310 ThrowDisplayException(OptionError,"UnrecognizedResourceType",
1313 if (i == (ssize_t) argc)
1314 ThrowDisplayException(OptionError,"MissingArgument",option);
1315 value=StringToDouble(argv[i],&p);
1317 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
1318 ThrowDisplayInvalidArgumentException(option,argv[i]);
1321 if (LocaleCompare("list",option+1) == 0)
1329 if (i == (ssize_t) argc)
1330 ThrowDisplayException(OptionError,"MissingArgument",option);
1331 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
1333 ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1334 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
1337 return(status != 0 ? MagickFalse : MagickTrue);
1339 if (LocaleCompare("log",option+1) == 0)
1344 if ((i == (ssize_t) argc) ||
1345 (strchr(argv[i],'%') == (char *) NULL))
1346 ThrowDisplayException(OptionError,"MissingArgument",option);
1349 if (LocaleCompare("loop",option+1) == 0)
1354 if (i == (ssize_t) (argc-1))
1355 ThrowDisplayException(OptionError,"MissingArgument",option);
1356 if (IsGeometry(argv[i]) == MagickFalse)
1357 ThrowDisplayInvalidArgumentException(option,argv[i]);
1358 iterations=StringToUnsignedLong(argv[i]);
1361 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1365 if (LocaleCompare("magnify",option+1) == 0)
1367 resource_info.magnify=2;
1371 if (i == (ssize_t) argc)
1372 ThrowDisplayException(OptionError,"MissingArgument",option);
1373 if (IsGeometry(argv[i]) == MagickFalse)
1374 ThrowDisplayInvalidArgumentException(option,argv[i]);
1375 resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
1378 if (LocaleCompare("map",option+1) == 0)
1380 resource_info.map_type=(char *) NULL;
1383 (void) strcpy(argv[i]+1,"san");
1385 if (i == (ssize_t) argc)
1386 ThrowDisplayException(OptionError,"MissingArgument",option);
1387 resource_info.map_type=argv[i];
1390 if (LocaleCompare("matte",option+1) == 0)
1392 if (LocaleCompare("mattecolor",option+1) == 0)
1397 if (i == (ssize_t) argc)
1398 ThrowDisplayException(OptionError,"MissingArgument",option);
1399 resource_info.matte_color=argv[i];
1402 if (LocaleCompare("monitor",option+1) == 0)
1404 if (LocaleCompare("monochrome",option+1) == 0)
1408 quantize_info->number_colors=2;
1409 quantize_info->colorspace=GRAYColorspace;
1412 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1416 if (LocaleCompare("name",option+1) == 0)
1418 resource_info.name=(char *) NULL;
1422 if (i == (ssize_t) argc)
1423 ThrowDisplayException(OptionError,"MissingArgument",option);
1424 resource_info.name=ConstantString(argv[i]);
1427 if (LocaleCompare("negate",option+1) == 0)
1429 if (LocaleCompare("noop",option+1) == 0)
1431 if (LocaleCompare("normalize",option+1) == 0)
1433 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1437 if (LocaleCompare("page",option+1) == 0)
1439 resource_info.image_geometry=(char *) NULL;
1443 if (i == (ssize_t) argc)
1444 ThrowDisplayException(OptionError,"MissingArgument",option);
1445 resource_info.image_geometry=ConstantString(argv[i]);
1448 if (LocaleCompare("profile",option+1) == 0)
1451 if (i == (ssize_t) argc)
1452 ThrowDisplayException(OptionError,"MissingArgument",option);
1455 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1459 if (LocaleCompare("quality",option+1) == 0)
1464 if (i == (ssize_t) argc)
1465 ThrowDisplayException(OptionError,"MissingArgument",option);
1466 if (IsGeometry(argv[i]) == MagickFalse)
1467 ThrowDisplayInvalidArgumentException(option,argv[i]);
1470 if (LocaleCompare("quantize",option+1) == 0)
1478 if (i == (ssize_t) (argc-1))
1479 ThrowDisplayException(OptionError,"MissingArgument",option);
1480 colorspace=ParseCommandOption(MagickColorspaceOptions,
1481 MagickFalse,argv[i]);
1483 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
1487 if (LocaleCompare("quiet",option+1) == 0)
1489 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1493 if (LocaleCompare("raise",option+1) == 0)
1496 if (i == (ssize_t) argc)
1497 ThrowDisplayException(OptionError,"MissingArgument",option);
1498 if (IsGeometry(argv[i]) == MagickFalse)
1499 ThrowDisplayInvalidArgumentException(option,argv[i]);
1502 if (LocaleCompare("regard-warnings",option+1) == 0)
1504 if (LocaleCompare("remote",option+1) == 0)
1507 if (i == (ssize_t) argc)
1508 ThrowDisplayException(OptionError,"MissingArgument",option);
1509 if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1510 return(MagickFalse);
1514 if (LocaleCompare("repage",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("resample",option+1) == 0)
1530 if (i == (ssize_t) (argc-1))
1531 ThrowDisplayException(OptionError,"MissingArgument",option);
1532 if (IsGeometry(argv[i]) == MagickFalse)
1533 ThrowDisplayInvalidArgumentException(option,argv[i]);
1536 if (LocaleCompare("resize",option+1) == 0)
1541 if (i == (ssize_t) argc)
1542 ThrowDisplayException(OptionError,"MissingArgument",option);
1543 if (IsGeometry(argv[i]) == MagickFalse)
1544 ThrowDisplayInvalidArgumentException(option,argv[i]);
1547 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1549 respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1552 if (LocaleCompare("roll",option+1) == 0)
1557 if (i == (ssize_t) argc)
1558 ThrowDisplayException(OptionError,"MissingArgument",option);
1559 if (IsGeometry(argv[i]) == MagickFalse)
1560 ThrowDisplayInvalidArgumentException(option,argv[i]);
1563 if (LocaleCompare("rotate",option+1) == 0)
1566 if (i == (ssize_t) argc)
1567 ThrowDisplayException(OptionError,"MissingArgument",option);
1568 if (IsGeometry(argv[i]) == MagickFalse)
1569 ThrowDisplayInvalidArgumentException(option,argv[i]);
1572 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1576 if (LocaleCompare("sample",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("sampling-factor",option+1) == 0)
1592 if (i == (ssize_t) argc)
1593 ThrowDisplayException(OptionError,"MissingArgument",option);
1594 if (IsGeometry(argv[i]) == MagickFalse)
1595 ThrowDisplayInvalidArgumentException(option,argv[i]);
1598 if (LocaleCompare("scenes",option+1) == 0)
1603 if (i == (ssize_t) argc)
1604 ThrowDisplayException(OptionError,"MissingArgument",option);
1605 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1606 ThrowDisplayInvalidArgumentException(option,argv[i]);
1609 if (LocaleCompare("seed",option+1) == 0)
1614 if (i == (ssize_t) (argc-1))
1615 ThrowDisplayException(OptionError,"MissingArgument",option);
1616 if (IsGeometry(argv[i]) == MagickFalse)
1617 ThrowDisplayInvalidArgumentException(option,argv[i]);
1620 if (LocaleCompare("segment",option+1) == 0)
1625 if (i == (ssize_t) argc)
1626 ThrowDisplayException(OptionError,"MissingArgument",option);
1627 if (IsGeometry(argv[i]) == MagickFalse)
1628 ThrowDisplayInvalidArgumentException(option,argv[i]);
1631 if (LocaleCompare("set",option+1) == 0)
1634 if (i == (ssize_t) argc)
1635 ThrowDisplayException(OptionError,"MissingArgument",option);
1639 if (i == (ssize_t) argc)
1640 ThrowDisplayException(OptionError,"MissingArgument",option);
1643 if (LocaleCompare("sharpen",option+1) == 0)
1648 if (i == (ssize_t) argc)
1649 ThrowDisplayException(OptionError,"MissingArgument",option);
1650 if (IsGeometry(argv[i]) == MagickFalse)
1651 ThrowDisplayInvalidArgumentException(option,argv[i]);
1654 if (LocaleCompare("shared-memory",option+1) == 0)
1656 resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
1660 if (LocaleCompare("size",option+1) == 0)
1665 if (i == (ssize_t) argc)
1666 ThrowDisplayException(OptionError,"MissingArgument",option);
1667 if (IsGeometry(argv[i]) == MagickFalse)
1668 ThrowDisplayInvalidArgumentException(option,argv[i]);
1671 if (LocaleCompare("strip",option+1) == 0)
1673 if (LocaleCompare("support",option+1) == 0)
1675 i++; /* deprecated */
1678 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1682 if (LocaleCompare("text-font",option+1) == 0)
1684 resource_info.text_font=(char *) NULL;
1688 if (i == (ssize_t) argc)
1689 ThrowDisplayException(OptionError,"MissingArgument",option);
1690 resource_info.text_font=XGetResourceClass(resource_database,
1691 GetClientName(),"font",argv[i]);
1694 if (LocaleCompare("texture",option+1) == 0)
1699 if (i == (ssize_t) argc)
1700 ThrowDisplayException(OptionError,"MissingArgument",option);
1703 if (LocaleCompare("threshold",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("thumbnail",option+1) == 0)
1719 if (i == (ssize_t) argc)
1720 ThrowDisplayException(OptionError,"MissingArgument",option);
1721 if (IsGeometry(argv[i]) == MagickFalse)
1722 ThrowDisplayInvalidArgumentException(option,argv[i]);
1725 if (LocaleCompare("title",option+1) == 0)
1727 resource_info.title=(char *) NULL;
1731 if (i == (ssize_t) argc)
1732 ThrowDisplayException(OptionError,"MissingArgument",option);
1733 resource_info.title=argv[i];
1736 if (LocaleCompare("transparent-color",option+1) == 0)
1741 if (i == (ssize_t) (argc-1))
1742 ThrowDisplayException(OptionError,"MissingArgument",option);
1745 if (LocaleCompare("treedepth",option+1) == 0)
1747 quantize_info->tree_depth=0;
1751 if (i == (ssize_t) argc)
1752 ThrowDisplayException(OptionError,"MissingArgument",option);
1753 if (IsGeometry(argv[i]) == MagickFalse)
1754 ThrowDisplayInvalidArgumentException(option,argv[i]);
1755 quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1758 if (LocaleCompare("trim",option+1) == 0)
1760 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1764 if (LocaleCompare("update",option+1) == 0)
1766 resource_info.update=(unsigned int) (*option == '-');
1770 if (i == (ssize_t) argc)
1771 ThrowDisplayException(OptionError,"MissingArgument",option);
1772 if (IsGeometry(argv[i]) == MagickFalse)
1773 ThrowDisplayInvalidArgumentException(option,argv[i]);
1774 resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
1777 if (LocaleCompare("use-pixmap",option+1) == 0)
1779 resource_info.use_pixmap=(*option == '-') ? MagickTrue :
1783 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1787 if (LocaleCompare("verbose",option+1) == 0)
1789 if ((LocaleCompare("version",option+1) == 0) ||
1790 (LocaleCompare("-version",option+1) == 0))
1792 ListMagickVersion(stdout);
1795 if (LocaleCompare("visual",option+1) == 0)
1797 resource_info.visual_type=(char *) NULL;
1801 if (i == (ssize_t) argc)
1802 ThrowDisplayException(OptionError,"MissingArgument",option);
1803 resource_info.visual_type=argv[i];
1806 if (LocaleCompare("virtual-pixel",option+1) == 0)
1814 if (i == (ssize_t) (argc-1))
1815 ThrowDisplayException(OptionError,"MissingArgument",option);
1816 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1819 ThrowDisplayException(OptionError,
1820 "UnrecognizedVirtualPixelMethod",argv[i]);
1823 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1827 if (LocaleCompare("window",option+1) == 0)
1829 resource_info.window_id=(char *) NULL;
1833 if (i == (ssize_t) argc)
1834 ThrowDisplayException(OptionError,"MissingArgument",option);
1835 resource_info.window_id=argv[i];
1838 if (LocaleCompare("window-group",option+1) == 0)
1840 resource_info.window_group=(char *) NULL;
1844 if (i == (ssize_t) argc)
1845 ThrowDisplayException(OptionError,"MissingArgument",option);
1846 if (StringToDouble(argv[i],(char **) NULL) != 0)
1847 resource_info.window_group=argv[i];
1850 if (LocaleCompare("write",option+1) == 0)
1852 resource_info.write_filename=(char *) NULL;
1856 if (i == (ssize_t) argc)
1857 ThrowDisplayException(OptionError,"MissingArgument",option);
1858 resource_info.write_filename=argv[i];
1859 if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
1865 (void) FormatLocaleFile(stderr,"Overwrite %s? ",
1866 resource_info.write_filename);
1867 p=fgets(answer,(int) sizeof(answer),stdin);
1869 if (((*answer != 'y') && (*answer != 'Y')))
1870 return(MagickFalse);
1874 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1879 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1881 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1882 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1883 if (fire != MagickFalse)
1884 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1887 ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
1888 if (state & RetainColorsState)
1890 XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
1891 (void) XSync(display,MagickFalse);
1894 return(status != 0 ? MagickTrue : MagickFalse);
1898 (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1899 "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1900 return(DisplayUsage());