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 (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
227 (void) printf("Copyright: %s\n",GetMagickCopyright());
228 (void) printf("Features: %s\n\n",GetMagickFeatures());
229 (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
231 (void) printf("\nImage Settings:\n");
232 for (p=settings; *p != (char *) NULL; p++)
233 (void) printf(" %s\n",*p);
234 (void) printf("\nImage Operators:\n");
235 for (p=operators; *p != (char *) NULL; p++)
236 (void) printf(" %s\n",*p);
237 (void) printf("\nImage Sequence Operators:\n");
238 for (p=sequence_operators; *p != (char *) NULL; p++)
239 (void) printf(" %s\n",*p);
240 (void) printf("\nMiscellaneous Options:\n");
241 for (p=miscellaneous; *p != (char *) NULL; p++)
242 (void) printf(" %s\n",*p);
244 "\nIn addition to those listed above, you can specify these standard X\n");
246 "resources as command line options: -background, -bordercolor,\n");
248 "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
249 (void) printf("-name, -shared-memory, -usePixmap, or -title.\n");
251 "\nBy default, the image format of 'file' is determined by its magic\n");
253 "number. To specify a particular image format, precede the filename\n");
255 "with an image format name and a colon (i.e. ps:image) or specify the\n");
257 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
258 (void) printf("'-' for standard input or output.\n");
259 (void) printf("\nButtons: \n");
260 for (p=buttons; *p != (char *) NULL; p++)
261 (void) printf(" %s\n",*p);
265 WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
266 int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
268 #if defined(MAGICKCORE_X11_DELEGATE)
269 #define DestroyDisplay() \
271 if ((state & ExitState) == 0) \
272 DestroyXResources(); \
273 if (display != (Display *) NULL) \
275 XCloseDisplay(display); \
276 display=(Display *) NULL; \
278 XDestroyResourceInfo(&resource_info); \
279 DestroyImageStack(); \
280 if (image_marker != (size_t *) NULL) \
281 image_marker=(size_t *) RelinquishMagickMemory(image_marker); \
282 for (i=0; i < (ssize_t) argc; i++) \
283 argv[i]=DestroyString(argv[i]); \
284 argv=(char **) RelinquishMagickMemory(argv); \
286 #define ThrowDisplayException(asperity,tag,option) \
288 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"'%s'", \
291 return(MagickFalse); \
293 #define ThrowDisplayInvalidArgumentException(option,argument) \
295 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
296 "InvalidArgument","'%s': %s",option,argument); \
298 return(MagickFalse); \
315 image_stack[MaxImageStackDepth+1];
353 assert(image_info != (ImageInfo *) NULL);
354 assert(image_info->signature == MagickSignature);
355 if (image_info->debug != MagickFalse)
356 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
357 assert(exception != (ExceptionInfo *) NULL);
361 if ((LocaleCompare("version",option+1) == 0) ||
362 (LocaleCompare("-version",option+1) == 0))
364 (void) FormatLocaleFile(stdout,"Version: %s\n",
365 GetMagickVersion((size_t *) NULL));
366 (void) FormatLocaleFile(stdout,"Copyright: %s\n",
367 GetMagickCopyright());
368 (void) FormatLocaleFile(stdout,"Features: %s\n\n",
369 GetMagickFeatures());
374 display=(Display *) NULL;
377 image_marker=(size_t *) NULL;
381 option=(char *) NULL;
383 respect_parenthesis=MagickFalse;
384 resource_database=(XrmDatabase) NULL;
385 (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
386 server_name=(char *) NULL;
389 ReadCommandlLine(argc,&argv);
390 status=ExpandFilenames(&argc,&argv);
391 if (status == MagickFalse)
392 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
393 GetExceptionMessage(errno));
394 image_marker=(size_t *) AcquireQuantumMemory((size_t) argc+1UL,
395 sizeof(*image_marker));
396 if (image_marker == (size_t *) NULL)
397 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
398 GetExceptionMessage(errno));
399 for (i=0; i <= (ssize_t) argc; i++)
400 image_marker[i]=(size_t) argc;
402 Check for server name specified on the command line.
404 for (i=1; i < (ssize_t) argc; i++)
407 Check command line for server name.
410 if (LocaleCompare("display",option+1) == 0)
413 User specified server name.
416 if (i == (ssize_t) argc)
417 ThrowDisplayException(OptionError,"MissingArgument",option);
420 if ((LocaleCompare("help",option+1) == 0) ||
421 (LocaleCompare("-help",option+1) == 0))
422 return(DisplayUsage());
425 Get user defaults from X resource database.
427 display=XOpenDisplay(server_name);
428 if (display == (Display *) NULL)
429 ThrowDisplayException(XServerError,"UnableToOpenXServer",
430 XDisplayName(server_name));
431 (void) XSetErrorHandler(XError);
432 resource_database=XGetResourceDatabase(display,GetClientName());
433 XGetResourceInfo(image_info,resource_database,GetClientName(),
435 quantize_info=resource_info.quantize_info;
436 image_info->density=XGetResourceInstance(resource_database,GetClientName(),
437 "density",(char *) NULL);
438 if (image_info->density == (char *) NULL)
439 image_info->density=XGetScreenDensity(display);
440 resource_value=XGetResourceInstance(resource_database,GetClientName(),
442 image_info->interlace=(InterlaceType)
443 ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value);
444 image_info->page=XGetResourceInstance(resource_database,GetClientName(),
445 "pageGeometry",(char *) NULL);
446 resource_value=XGetResourceInstance(resource_database,GetClientName(),
448 image_info->quality=StringToUnsignedLong(resource_value);
449 resource_value=XGetResourceInstance(resource_database,GetClientName(),
451 image_info->verbose=IsStringTrue(resource_value);
452 resource_value=XGetResourceInstance(resource_database,GetClientName(),
454 quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ?
455 RiemersmaDitherMethod : NoDitherMethod;
460 for (i=1; ((i <= (ssize_t) argc) && ((state & ExitState) == 0)); i++)
462 if (i < (ssize_t) argc)
465 if (image != (Image *) NULL)
468 if (isatty(STDIN_FILENO) != MagickFalse)
484 if (LocaleCompare(option,"(") == 0)
486 FireImageStack(MagickFalse,MagickTrue,pend);
487 if (k == MaxImageStackDepth)
488 ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply",
493 if (LocaleCompare(option,")") == 0)
495 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
497 ThrowDisplayException(OptionError,"UnableToParseExpression",option);
501 if (IsCommandOption(option) == MagickFalse)
512 Option is a file name.
514 FireImageStack(MagickFalse,MagickFalse,pend);
516 if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
521 (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
522 images=ReadImage(image_info,exception);
523 CatchException(exception);
524 status&=(images != (Image *) NULL) &&
525 (exception->severity < ErrorException);
526 if (images == (Image *) NULL)
528 AppendImageStack(images);
529 FinalizeImageSettings(image_info,image,MagickFalse);
531 if (i == (ssize_t) (argc-1))
532 iterations=image->iterations;
533 image_list=CloneImageList(image,exception);
534 if (image_list == (Image *) NULL)
535 ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
536 GetExceptionMessage(errno));
537 display_image=image_list;
541 Transmogrify image as defined by the image processing options.
543 resource_info.quantum=1;
544 if (resource_info.window_id != (char *) NULL)
547 Display image to a specified X window.
549 status=XDisplayBackgroundImage(display,&resource_info,
550 display_image,exception);
551 if (status != MagickFalse)
553 state|=RetainColorsState;
564 Display image to X server.
566 if (resource_info.delay != 1)
567 display_image->delay=resource_info.delay;
568 nexus=XDisplayImage(display,&resource_info,argv,argc,
569 &display_image,&state,exception);
570 status&=nexus != (Image *) NULL;
571 if (nexus == (Image *) NULL)
573 while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
578 if (nexus->montage != (char *) NULL)
581 User selected a visual directory image (montage).
586 next=XDisplayImage(display,&resource_info,argv,argc,&nexus,
588 if ((next == (Image *) NULL) &&
589 (GetNextImageInList(nexus) != (Image *) NULL))
591 display_image=GetNextImageInList(nexus);
592 nexus=NewImageList();
596 if (nexus != display_image)
597 nexus=DestroyImageList(nexus);
601 } while ((state & ExitState) == 0);
602 if (resource_info.write_filename != (char *) NULL)
607 (void) CopyMagickString(display_image->filename,
608 resource_info.write_filename,MaxTextExtent);
609 (void) SetImageInfo(image_info,1,exception);
610 status&=WriteImage(image_info,display_image,exception);
613 Proceed to next/previous image.
615 if ((state & FormerImageState) != 0)
616 for (l=0; l < (ssize_t) resource_info.quantum; l++)
618 display_image=GetPreviousImageInList(display_image);
619 if (display_image == (Image *) NULL)
623 for (l=0; l < (ssize_t) resource_info.quantum; l++)
625 display_image=GetNextImageInList(display_image);
626 if (display_image == (Image *) NULL)
629 } while ((display_image != (Image *) NULL) && ((state & ExitState) == 0));
631 Free image resources.
633 display_image=GetFirstImageInList(display_image);
634 if (image_list != display_image)
635 image_list=DestroyImageList(image_list);
636 display_image=DestroyImageList(display_image);
637 if ((state & FormerImageState) == 0)
639 last_image=(size_t) image_number;
640 image_marker[i]=(size_t) image_number++;
645 Proceed to previous image.
647 for (i--; i > 0; i--)
648 if (image_marker[i] == (size_t) (image_number-2))
652 if ((i == (ssize_t) (argc-1)) && ((state & ExitState) == 0))
654 if ((state & ExitState) != 0)
657 Determine if we should proceed to the first image.
659 if (image_number < 0)
661 if ((state & FormerImageState) != 0)
664 for (i=1; i < (ssize_t) (argc-2); i++)
665 if (last_image == image_marker[i])
667 image_number=(ssize_t) image_marker[i]+1;
671 if (resource_info.window_id != (char *) NULL)
673 if ((iterations != 0) && (++iteration == (ssize_t) iterations))
675 if (LocaleCompare(filename,"-") == 0)
677 RemoveAllImageStack();
680 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
685 if (LocaleCompare("alpha",option+1) == 0)
693 if (i == (ssize_t) argc)
694 ThrowDisplayException(OptionError,"MissingArgument",option);
695 type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,argv[i]);
697 ThrowDisplayException(OptionError,"UnrecognizedAlphaChannelOption",
701 if (LocaleCompare("antialias",option+1) == 0)
703 if (LocaleCompare("authenticate",option+1) == 0)
708 if (i == (ssize_t) argc)
709 ThrowDisplayException(OptionError,"MissingArgument",option);
712 if (LocaleCompare("auto-orient",option+1) == 0)
714 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
718 if (LocaleCompare("backdrop",option+1) == 0)
720 resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
723 if (LocaleCompare("background",option+1) == 0)
728 if (i == (ssize_t) argc)
729 ThrowDisplayException(OptionError,"MissingArgument",option);
730 resource_info.background_color=argv[i];
733 if (LocaleCompare("border",option+1) == 0)
738 if (i == (ssize_t) argc)
739 ThrowDisplayException(OptionError,"MissingArgument",option);
740 if (IsGeometry(argv[i]) == MagickFalse)
741 ThrowDisplayInvalidArgumentException(option,argv[i]);
744 if (LocaleCompare("bordercolor",option+1) == 0)
749 if (i == (ssize_t) argc)
750 ThrowDisplayException(OptionError,"MissingArgument",option);
751 resource_info.border_color=argv[i];
754 if (LocaleCompare("borderwidth",option+1) == 0)
756 resource_info.border_width=0;
760 if (i == (ssize_t) argc)
761 ThrowDisplayException(OptionError,"MissingArgument",option);
762 if (IsGeometry(argv[i]) == MagickFalse)
763 ThrowDisplayInvalidArgumentException(option,argv[i]);
764 resource_info.border_width=(unsigned int)
765 StringToUnsignedLong(argv[i]);
768 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
772 if (LocaleCompare("cache",option+1) == 0)
777 if (i == (ssize_t) argc)
778 ThrowDisplayException(OptionError,"MissingArgument",option);
779 if (IsGeometry(argv[i]) == MagickFalse)
780 ThrowDisplayInvalidArgumentException(option,argv[i]);
783 if (LocaleCompare("channel",option+1) == 0)
791 if (i == (ssize_t) (argc-1))
792 ThrowDisplayException(OptionError,"MissingArgument",option);
793 channel=ParseChannelOption(argv[i]);
795 ThrowDisplayException(OptionError,"UnrecognizedChannelType",
799 if (LocaleCompare("clip",option+1) == 0)
801 if (LocaleCompare("clip-path",option+1) == 0)
804 if (i == (ssize_t) argc)
805 ThrowDisplayException(OptionError,"MissingArgument",option);
808 if (LocaleCompare("coalesce",option+1) == 0)
810 if (LocaleCompare("colormap",option+1) == 0)
812 resource_info.colormap=PrivateColormap;
816 if (i == (ssize_t) argc)
817 ThrowDisplayException(OptionError,"MissingArgument",option);
818 resource_info.colormap=UndefinedColormap;
819 if (LocaleCompare("private",argv[i]) == 0)
820 resource_info.colormap=PrivateColormap;
821 if (LocaleCompare("shared",argv[i]) == 0)
822 resource_info.colormap=SharedColormap;
823 if (resource_info.colormap == UndefinedColormap)
824 ThrowDisplayException(OptionError,"UnrecognizedColormapType",
828 if (LocaleCompare("colors",option+1) == 0)
830 quantize_info->number_colors=0;
834 if (i == (ssize_t) argc)
835 ThrowDisplayException(OptionError,"MissingArgument",option);
836 if (IsGeometry(argv[i]) == MagickFalse)
837 ThrowDisplayInvalidArgumentException(option,argv[i]);
838 quantize_info->number_colors=StringToUnsignedLong(argv[i]);
841 if (LocaleCompare("colorspace",option+1) == 0)
849 if (i == (ssize_t) argc)
850 ThrowDisplayException(OptionError,"MissingArgument",option);
851 colorspace=ParseCommandOption(MagickColorspaceOptions,
852 MagickFalse,argv[i]);
854 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
858 if (LocaleCompare("comment",option+1) == 0)
863 if (i == (ssize_t) argc)
864 ThrowDisplayException(OptionError,"MissingArgument",option);
867 if (LocaleCompare("compress",option+1) == 0)
875 if (i == (ssize_t) argc)
876 ThrowDisplayException(OptionError,"MissingArgument",option);
877 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
880 ThrowDisplayException(OptionError,"UnrecognizedImageCompression",
884 if (LocaleCompare("concurrent",option+1) == 0)
886 if (LocaleCompare("contrast",option+1) == 0)
888 if (LocaleCompare("crop",option+1) == 0)
893 if (i == (ssize_t) argc)
894 ThrowDisplayException(OptionError,"MissingArgument",option);
895 if (IsGeometry(argv[i]) == MagickFalse)
896 ThrowDisplayInvalidArgumentException(option,argv[i]);
899 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
903 if (LocaleCompare("debug",option+1) == 0)
911 if (i == (ssize_t) argc)
912 ThrowDisplayException(OptionError,"MissingArgument",option);
913 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
915 ThrowDisplayException(OptionError,"UnrecognizedEventType",
917 (void) SetLogEventMask(argv[i]);
920 if (LocaleCompare("decipher",option+1) == 0)
925 if (i == (ssize_t) (argc-1))
926 ThrowDisplayException(OptionError,"MissingArgument",option);
929 if (LocaleCompare("define",option+1) == 0)
932 if (i == (ssize_t) argc)
933 ThrowDisplayException(OptionError,"MissingArgument",option);
939 define=GetImageOption(image_info,argv[i]);
940 if (define == (const char *) NULL)
941 ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
946 if (LocaleCompare("delay",option+1) == 0)
951 if (i == (ssize_t) argc)
952 ThrowDisplayException(OptionError,"MissingArgument",option);
953 if (IsGeometry(argv[i]) == MagickFalse)
954 ThrowDisplayInvalidArgumentException(option,argv[i]);
957 if (LocaleCompare("density",option+1) == 0)
962 if (i == (ssize_t) argc)
963 ThrowDisplayException(OptionError,"MissingArgument",option);
964 if (IsGeometry(argv[i]) == MagickFalse)
965 ThrowDisplayInvalidArgumentException(option,argv[i]);
968 if (LocaleCompare("depth",option+1) == 0)
973 if (i == (ssize_t) argc)
974 ThrowDisplayException(OptionError,"MissingArgument",option);
975 if (IsGeometry(argv[i]) == MagickFalse)
976 ThrowDisplayInvalidArgumentException(option,argv[i]);
979 if (LocaleCompare("deskew",option+1) == 0)
984 if (i == (ssize_t) (argc-1))
985 ThrowDisplayException(OptionError,"MissingArgument",option);
986 if (IsGeometry(argv[i]) == MagickFalse)
987 ThrowDisplayInvalidArgumentException(option,argv[i]);
990 if (LocaleCompare("despeckle",option+1) == 0)
992 if (LocaleCompare("display",option+1) == 0)
997 if (i == (ssize_t) argc)
998 ThrowDisplayException(OptionError,"MissingArgument",option);
1001 if (LocaleCompare("dispose",option+1) == 0)
1009 if (i == (ssize_t) argc)
1010 ThrowDisplayException(OptionError,"MissingArgument",option);
1011 dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
1013 ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
1017 if (LocaleCompare("dither",option+1) == 0)
1022 quantize_info->dither_method=NoDitherMethod;
1026 if (i == (ssize_t) argc)
1027 ThrowDisplayException(OptionError,"MissingArgument",option);
1028 method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
1030 ThrowDisplayException(OptionError,"UnrecognizedDitherMethod",
1032 quantize_info->dither_method=(DitherMethod) method;
1035 if (LocaleCompare("duration",option+1) == 0)
1040 if (i == (ssize_t) (argc-1))
1041 ThrowDisplayException(OptionError,"MissingArgument",option);
1042 if (IsGeometry(argv[i]) == MagickFalse)
1043 ThrowDisplayInvalidArgumentException(option,argv[i]);
1046 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1050 if (LocaleCompare("edge",option+1) == 0)
1055 if (i == (ssize_t) argc)
1056 ThrowDisplayException(OptionError,"MissingArgument",option);
1057 if (IsGeometry(argv[i]) == MagickFalse)
1058 ThrowDisplayInvalidArgumentException(option,argv[i]);
1061 if (LocaleCompare("endian",option+1) == 0)
1069 if (i == (ssize_t) argc)
1070 ThrowDisplayException(OptionError,"MissingArgument",option);
1071 endian=ParseCommandOption(MagickEndianOptions,MagickFalse,
1074 ThrowDisplayException(OptionError,"UnrecognizedEndianType",
1078 if (LocaleCompare("enhance",option+1) == 0)
1080 if (LocaleCompare("equalize",option+1) == 0)
1082 if (LocaleCompare("extract",option+1) == 0)
1087 if (i == (ssize_t) argc)
1088 ThrowDisplayException(OptionError,"MissingArgument",option);
1089 if (IsGeometry(argv[i]) == MagickFalse)
1090 ThrowDisplayInvalidArgumentException(option,argv[i]);
1093 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1097 if (LocaleCompare("filter",option+1) == 0)
1105 if (i == (ssize_t) argc)
1106 ThrowDisplayException(OptionError,"MissingArgument",option);
1107 filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
1109 ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
1113 if (LocaleCompare("flatten",option+1) == 0)
1115 if (LocaleCompare("flip",option+1) == 0)
1117 if (LocaleCompare("flop",option+1) == 0)
1119 if (LocaleCompare("font",option+1) == 0)
1124 if (i == (ssize_t) argc)
1125 ThrowDisplayException(OptionError,"MissingArgument",option);
1126 resource_info.font=XGetResourceClass(resource_database,
1127 GetClientName(),"font",argv[i]);
1130 if (LocaleCompare("foreground",option+1) == 0)
1135 if (i == (ssize_t) argc)
1136 ThrowDisplayException(OptionError,"MissingArgument",option);
1137 resource_info.foreground_color=argv[i];
1140 if (LocaleCompare("format",option+1) == 0)
1145 if (i == (ssize_t) (argc-1))
1146 ThrowDisplayException(OptionError,"MissingArgument",option);
1149 if (LocaleCompare("frame",option+1) == 0)
1154 if (i == (ssize_t) argc)
1155 ThrowDisplayException(OptionError,"MissingArgument",option);
1156 if (IsGeometry(argv[i]) == MagickFalse)
1157 ThrowDisplayInvalidArgumentException(option,argv[i]);
1160 if (LocaleCompare("fuzz",option+1) == 0)
1165 if (i == (ssize_t) (argc-1))
1166 ThrowDisplayException(OptionError,"MissingArgument",option);
1167 if (IsGeometry(argv[i]) == MagickFalse)
1168 ThrowDisplayInvalidArgumentException(option,argv[i]);
1171 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1175 if (LocaleCompare("gamma",option+1) == 0)
1178 if (i == (ssize_t) argc)
1179 ThrowDisplayException(OptionError,"MissingArgument",option);
1180 if (IsGeometry(argv[i]) == MagickFalse)
1181 ThrowDisplayInvalidArgumentException(option,argv[i]);
1184 if (LocaleCompare("geometry",option+1) == 0)
1186 resource_info.image_geometry=(char *) NULL;
1189 (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
1191 if (i == (ssize_t) argc)
1192 ThrowDisplayException(OptionError,"MissingArgument",option);
1193 if (IsGeometry(argv[i]) == MagickFalse)
1194 ThrowDisplayInvalidArgumentException(option,argv[i]);
1195 resource_info.image_geometry=ConstantString(argv[i]);
1198 if (LocaleCompare("gravity",option+1) == 0)
1206 if (i == (ssize_t) (argc-1))
1207 ThrowDisplayException(OptionError,"MissingArgument",option);
1208 gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
1211 ThrowDisplayException(OptionError,"UnrecognizedGravityType",
1215 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1219 if ((LocaleCompare("help",option+1) == 0) ||
1220 (LocaleCompare("-help",option+1) == 0))
1222 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1226 if (LocaleCompare("identify",option+1) == 0)
1228 if (LocaleCompare("iconGeometry",option+1) == 0)
1230 resource_info.icon_geometry=(char *) NULL;
1234 if (i == (ssize_t) argc)
1235 ThrowDisplayException(OptionError,"MissingArgument",option);
1236 if (IsGeometry(argv[i]) == MagickFalse)
1237 ThrowDisplayInvalidArgumentException(option,argv[i]);
1238 resource_info.icon_geometry=argv[i];
1241 if (LocaleCompare("iconic",option+1) == 0)
1243 resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
1246 if (LocaleCompare("immutable",option+1) == 0)
1248 resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
1251 if (LocaleCompare("interlace",option+1) == 0)
1259 if (i == (ssize_t) argc)
1260 ThrowDisplayException(OptionError,"MissingArgument",option);
1261 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
1264 ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
1268 if (LocaleCompare("interpolate",option+1) == 0)
1276 if (i == (ssize_t) argc)
1277 ThrowDisplayException(OptionError,"MissingArgument",option);
1278 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
1280 if (interpolate < 0)
1281 ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
1285 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1289 if (LocaleCompare("label",option+1) == 0)
1294 if (i == (ssize_t) argc)
1295 ThrowDisplayException(OptionError,"MissingArgument",option);
1298 if (LocaleCompare("limit",option+1) == 0)
1312 if (i == (ssize_t) argc)
1313 ThrowDisplayException(OptionError,"MissingArgument",option);
1314 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
1317 ThrowDisplayException(OptionError,"UnrecognizedResourceType",
1320 if (i == (ssize_t) argc)
1321 ThrowDisplayException(OptionError,"MissingArgument",option);
1322 value=StringToDouble(argv[i],&p);
1324 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
1325 ThrowDisplayInvalidArgumentException(option,argv[i]);
1328 if (LocaleCompare("list",option+1) == 0)
1336 if (i == (ssize_t) argc)
1337 ThrowDisplayException(OptionError,"MissingArgument",option);
1338 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
1340 ThrowDisplayException(OptionError,"UnrecognizedListType",argv[i]);
1341 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
1344 return(status != 0 ? MagickFalse : MagickTrue);
1346 if (LocaleCompare("log",option+1) == 0)
1351 if ((i == (ssize_t) argc) ||
1352 (strchr(argv[i],'%') == (char *) NULL))
1353 ThrowDisplayException(OptionError,"MissingArgument",option);
1356 if (LocaleCompare("loop",option+1) == 0)
1361 if (i == (ssize_t) (argc-1))
1362 ThrowDisplayException(OptionError,"MissingArgument",option);
1363 if (IsGeometry(argv[i]) == MagickFalse)
1364 ThrowDisplayInvalidArgumentException(option,argv[i]);
1365 iterations=StringToUnsignedLong(argv[i]);
1368 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1372 if (LocaleCompare("magnify",option+1) == 0)
1374 resource_info.magnify=2;
1378 if (i == (ssize_t) argc)
1379 ThrowDisplayException(OptionError,"MissingArgument",option);
1380 if (IsGeometry(argv[i]) == MagickFalse)
1381 ThrowDisplayInvalidArgumentException(option,argv[i]);
1382 resource_info.magnify=(unsigned int) StringToUnsignedLong(argv[i]);
1385 if (LocaleCompare("map",option+1) == 0)
1387 resource_info.map_type=(char *) NULL;
1390 (void) strcpy(argv[i]+1,"san");
1392 if (i == (ssize_t) argc)
1393 ThrowDisplayException(OptionError,"MissingArgument",option);
1394 resource_info.map_type=argv[i];
1397 if (LocaleCompare("matte",option+1) == 0)
1399 if (LocaleCompare("mattecolor",option+1) == 0)
1404 if (i == (ssize_t) argc)
1405 ThrowDisplayException(OptionError,"MissingArgument",option);
1406 resource_info.matte_color=argv[i];
1409 if (LocaleCompare("monitor",option+1) == 0)
1411 if (LocaleCompare("monochrome",option+1) == 0)
1415 quantize_info->number_colors=2;
1416 quantize_info->colorspace=GRAYColorspace;
1419 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1423 if (LocaleCompare("name",option+1) == 0)
1425 resource_info.name=(char *) NULL;
1429 if (i == (ssize_t) argc)
1430 ThrowDisplayException(OptionError,"MissingArgument",option);
1431 resource_info.name=ConstantString(argv[i]);
1434 if (LocaleCompare("negate",option+1) == 0)
1436 if (LocaleCompare("noop",option+1) == 0)
1438 if (LocaleCompare("normalize",option+1) == 0)
1440 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1444 if (LocaleCompare("page",option+1) == 0)
1446 resource_info.image_geometry=(char *) NULL;
1450 if (i == (ssize_t) argc)
1451 ThrowDisplayException(OptionError,"MissingArgument",option);
1452 resource_info.image_geometry=ConstantString(argv[i]);
1455 if (LocaleCompare("profile",option+1) == 0)
1458 if (i == (ssize_t) argc)
1459 ThrowDisplayException(OptionError,"MissingArgument",option);
1462 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1466 if (LocaleCompare("quality",option+1) == 0)
1471 if (i == (ssize_t) argc)
1472 ThrowDisplayException(OptionError,"MissingArgument",option);
1473 if (IsGeometry(argv[i]) == MagickFalse)
1474 ThrowDisplayInvalidArgumentException(option,argv[i]);
1477 if (LocaleCompare("quantize",option+1) == 0)
1485 if (i == (ssize_t) (argc-1))
1486 ThrowDisplayException(OptionError,"MissingArgument",option);
1487 colorspace=ParseCommandOption(MagickColorspaceOptions,
1488 MagickFalse,argv[i]);
1490 ThrowDisplayException(OptionError,"UnrecognizedColorspace",
1494 if (LocaleCompare("quiet",option+1) == 0)
1496 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1500 if (LocaleCompare("raise",option+1) == 0)
1503 if (i == (ssize_t) argc)
1504 ThrowDisplayException(OptionError,"MissingArgument",option);
1505 if (IsGeometry(argv[i]) == MagickFalse)
1506 ThrowDisplayInvalidArgumentException(option,argv[i]);
1509 if (LocaleCompare("regard-warnings",option+1) == 0)
1511 if (LocaleCompare("remote",option+1) == 0)
1514 if (i == (ssize_t) argc)
1515 ThrowDisplayException(OptionError,"MissingArgument",option);
1516 if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1517 return(MagickFalse);
1521 if (LocaleCompare("repage",option+1) == 0)
1526 if (i == (ssize_t) argc)
1527 ThrowDisplayException(OptionError,"MissingArgument",option);
1528 if (IsGeometry(argv[i]) == MagickFalse)
1529 ThrowDisplayInvalidArgumentException(option,argv[i]);
1532 if (LocaleCompare("resample",option+1) == 0)
1537 if (i == (ssize_t) (argc-1))
1538 ThrowDisplayException(OptionError,"MissingArgument",option);
1539 if (IsGeometry(argv[i]) == MagickFalse)
1540 ThrowDisplayInvalidArgumentException(option,argv[i]);
1543 if (LocaleCompare("resize",option+1) == 0)
1548 if (i == (ssize_t) argc)
1549 ThrowDisplayException(OptionError,"MissingArgument",option);
1550 if (IsGeometry(argv[i]) == MagickFalse)
1551 ThrowDisplayInvalidArgumentException(option,argv[i]);
1554 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1556 respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1559 if (LocaleCompare("roll",option+1) == 0)
1564 if (i == (ssize_t) argc)
1565 ThrowDisplayException(OptionError,"MissingArgument",option);
1566 if (IsGeometry(argv[i]) == MagickFalse)
1567 ThrowDisplayInvalidArgumentException(option,argv[i]);
1570 if (LocaleCompare("rotate",option+1) == 0)
1573 if (i == (ssize_t) argc)
1574 ThrowDisplayException(OptionError,"MissingArgument",option);
1575 if (IsGeometry(argv[i]) == MagickFalse)
1576 ThrowDisplayInvalidArgumentException(option,argv[i]);
1579 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1583 if (LocaleCompare("sample",option+1) == 0)
1588 if (i == (ssize_t) argc)
1589 ThrowDisplayException(OptionError,"MissingArgument",option);
1590 if (IsGeometry(argv[i]) == MagickFalse)
1591 ThrowDisplayInvalidArgumentException(option,argv[i]);
1594 if (LocaleCompare("sampling-factor",option+1) == 0)
1599 if (i == (ssize_t) argc)
1600 ThrowDisplayException(OptionError,"MissingArgument",option);
1601 if (IsGeometry(argv[i]) == MagickFalse)
1602 ThrowDisplayInvalidArgumentException(option,argv[i]);
1605 if (LocaleCompare("scenes",option+1) == 0)
1610 if (i == (ssize_t) argc)
1611 ThrowDisplayException(OptionError,"MissingArgument",option);
1612 if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1613 ThrowDisplayInvalidArgumentException(option,argv[i]);
1616 if (LocaleCompare("seed",option+1) == 0)
1621 if (i == (ssize_t) (argc-1))
1622 ThrowDisplayException(OptionError,"MissingArgument",option);
1623 if (IsGeometry(argv[i]) == MagickFalse)
1624 ThrowDisplayInvalidArgumentException(option,argv[i]);
1627 if (LocaleCompare("segment",option+1) == 0)
1632 if (i == (ssize_t) argc)
1633 ThrowDisplayException(OptionError,"MissingArgument",option);
1634 if (IsGeometry(argv[i]) == MagickFalse)
1635 ThrowDisplayInvalidArgumentException(option,argv[i]);
1638 if (LocaleCompare("set",option+1) == 0)
1641 if (i == (ssize_t) argc)
1642 ThrowDisplayException(OptionError,"MissingArgument",option);
1646 if (i == (ssize_t) argc)
1647 ThrowDisplayException(OptionError,"MissingArgument",option);
1650 if (LocaleCompare("sharpen",option+1) == 0)
1655 if (i == (ssize_t) argc)
1656 ThrowDisplayException(OptionError,"MissingArgument",option);
1657 if (IsGeometry(argv[i]) == MagickFalse)
1658 ThrowDisplayInvalidArgumentException(option,argv[i]);
1661 if (LocaleCompare("shared-memory",option+1) == 0)
1663 resource_info.use_shared_memory= (*option == '-') ? MagickTrue :
1667 if (LocaleCompare("size",option+1) == 0)
1672 if (i == (ssize_t) argc)
1673 ThrowDisplayException(OptionError,"MissingArgument",option);
1674 if (IsGeometry(argv[i]) == MagickFalse)
1675 ThrowDisplayInvalidArgumentException(option,argv[i]);
1678 if (LocaleCompare("strip",option+1) == 0)
1680 if (LocaleCompare("support",option+1) == 0)
1682 i++; /* deprecated */
1685 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1689 if (LocaleCompare("text-font",option+1) == 0)
1691 resource_info.text_font=(char *) NULL;
1695 if (i == (ssize_t) argc)
1696 ThrowDisplayException(OptionError,"MissingArgument",option);
1697 resource_info.text_font=XGetResourceClass(resource_database,
1698 GetClientName(),"font",argv[i]);
1701 if (LocaleCompare("texture",option+1) == 0)
1706 if (i == (ssize_t) argc)
1707 ThrowDisplayException(OptionError,"MissingArgument",option);
1710 if (LocaleCompare("threshold",option+1) == 0)
1715 if (i == (ssize_t) argc)
1716 ThrowDisplayException(OptionError,"MissingArgument",option);
1717 if (IsGeometry(argv[i]) == MagickFalse)
1718 ThrowDisplayInvalidArgumentException(option,argv[i]);
1721 if (LocaleCompare("thumbnail",option+1) == 0)
1726 if (i == (ssize_t) argc)
1727 ThrowDisplayException(OptionError,"MissingArgument",option);
1728 if (IsGeometry(argv[i]) == MagickFalse)
1729 ThrowDisplayInvalidArgumentException(option,argv[i]);
1732 if (LocaleCompare("title",option+1) == 0)
1734 resource_info.title=(char *) NULL;
1738 if (i == (ssize_t) argc)
1739 ThrowDisplayException(OptionError,"MissingArgument",option);
1740 resource_info.title=argv[i];
1743 if (LocaleCompare("transparent-color",option+1) == 0)
1748 if (i == (ssize_t) (argc-1))
1749 ThrowDisplayException(OptionError,"MissingArgument",option);
1752 if (LocaleCompare("treedepth",option+1) == 0)
1754 quantize_info->tree_depth=0;
1758 if (i == (ssize_t) argc)
1759 ThrowDisplayException(OptionError,"MissingArgument",option);
1760 if (IsGeometry(argv[i]) == MagickFalse)
1761 ThrowDisplayInvalidArgumentException(option,argv[i]);
1762 quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1765 if (LocaleCompare("trim",option+1) == 0)
1767 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1771 if (LocaleCompare("update",option+1) == 0)
1773 resource_info.update=(unsigned int) (*option == '-');
1777 if (i == (ssize_t) argc)
1778 ThrowDisplayException(OptionError,"MissingArgument",option);
1779 if (IsGeometry(argv[i]) == MagickFalse)
1780 ThrowDisplayInvalidArgumentException(option,argv[i]);
1781 resource_info.update=(unsigned int) StringToUnsignedLong(argv[i]);
1784 if (LocaleCompare("use-pixmap",option+1) == 0)
1786 resource_info.use_pixmap=(*option == '-') ? MagickTrue :
1790 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1794 if (LocaleCompare("verbose",option+1) == 0)
1796 if ((LocaleCompare("version",option+1) == 0) ||
1797 (LocaleCompare("-version",option+1) == 0))
1799 (void) FormatLocaleFile(stdout,"Version: %s\n",
1800 GetMagickVersion((size_t *) NULL));
1801 (void) FormatLocaleFile(stdout,"Copyright: %s\n",
1802 GetMagickCopyright());
1803 (void) FormatLocaleFile(stdout,"Features: %s\n\n",
1804 GetMagickFeatures());
1807 if (LocaleCompare("visual",option+1) == 0)
1809 resource_info.visual_type=(char *) NULL;
1813 if (i == (ssize_t) argc)
1814 ThrowDisplayException(OptionError,"MissingArgument",option);
1815 resource_info.visual_type=argv[i];
1818 if (LocaleCompare("virtual-pixel",option+1) == 0)
1826 if (i == (ssize_t) (argc-1))
1827 ThrowDisplayException(OptionError,"MissingArgument",option);
1828 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1831 ThrowDisplayException(OptionError,
1832 "UnrecognizedVirtualPixelMethod",argv[i]);
1835 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1839 if (LocaleCompare("window",option+1) == 0)
1841 resource_info.window_id=(char *) NULL;
1845 if (i == (ssize_t) argc)
1846 ThrowDisplayException(OptionError,"MissingArgument",option);
1847 resource_info.window_id=argv[i];
1850 if (LocaleCompare("window-group",option+1) == 0)
1852 resource_info.window_group=(char *) NULL;
1856 if (i == (ssize_t) argc)
1857 ThrowDisplayException(OptionError,"MissingArgument",option);
1858 if (StringToDouble(argv[i],(char **) NULL) != 0)
1859 resource_info.window_group=argv[i];
1862 if (LocaleCompare("write",option+1) == 0)
1864 resource_info.write_filename=(char *) NULL;
1868 if (i == (ssize_t) argc)
1869 ThrowDisplayException(OptionError,"MissingArgument",option);
1870 resource_info.write_filename=argv[i];
1871 if (IsPathAccessible(resource_info.write_filename) != MagickFalse)
1877 (void) FormatLocaleFile(stderr,"Overwrite %s? ",
1878 resource_info.write_filename);
1879 p=fgets(answer,(int) sizeof(answer),stdin);
1881 if (((*answer != 'y') && (*answer != 'Y')))
1882 return(MagickFalse);
1886 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1891 ThrowDisplayException(OptionError,"UnrecognizedOption",option);
1893 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1894 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1895 if (fire != MagickFalse)
1896 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1899 ThrowDisplayException(OptionError,"UnbalancedParenthesis",argv[i]);
1900 if (state & RetainColorsState)
1902 XRetainWindowColors(display,XRootWindow(display,XDefaultScreen(display)));
1903 (void) XSync(display,MagickFalse);
1906 return(status != 0 ? MagickTrue : MagickFalse);
1910 (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1911 "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1912 return(DisplayUsage());