PageRenderTime 65ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/plugins/ImageMagick-6.3.2/wand/display.c

https://bitbucket.org/sisko/operation-caribou
C | 1760 lines | 1586 code | 37 blank | 137 comment | 742 complexity | 043c398416093ba7a5007e9160794378 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % %
  4. % %
  5. % %
  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 %
  9. % D D I SS P L A A Y %
  10. % DDDD IIIII SSSSS P LLLLL A A Y %
  11. % %
  12. % %
  13. % Methods to Interactively Display and Edit an Image %
  14. % %
  15. % Software Design %
  16. % John Cristy %
  17. % July 1992 %
  18. % %
  19. % %
  20. % Copyright 1999-2006 ImageMagick Studio LLC, a non-profit organization %
  21. % dedicated to making software imaging solutions freely available. %
  22. % %
  23. % You may not use this file except in compliance with the License. You may %
  24. % obtain a copy of the License at %
  25. % %
  26. % http://www.imagemagick.org/script/license.php %
  27. % %
  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. %
  33. % %
  34. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  35. %
  36. %
  37. */
  38. /*
  39. Include declarations.
  40. */
  41. #include "wand/studio.h"
  42. #include "wand/MagickWand.h"
  43. #include "wand/mogrify-private.h"
  44. #include "magick/display-private.h"
  45. /*
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47. % %
  48. % %
  49. % %
  50. + D i s p l a y I m a g e C o m m a n d %
  51. % %
  52. % %
  53. % %
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. %
  56. % DisplayImageCommand() displays a sequence of images on any workstation
  57. % display running an X server. Display first determines the hardware
  58. % capabilities of the workstation. If the number of unique colors in an image
  59. % is less than or equal to the number the workstation can support, the image
  60. % is displayed in an X window. Otherwise the number of colors in the image is
  61. % first reduced to match the color resolution of the workstation before it is
  62. % displayed.
  63. %
  64. % This means that a continuous-tone 24 bits/pixel image can display on a 8
  65. % bit pseudo-color device or monochrome device. In most instances the reduced
  66. % color image closely resembles the original. Alternatively, a monochrome or
  67. % pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
  68. % device.
  69. %
  70. % The format of the DisplayImageCommand method is:
  71. %
  72. % MagickBooleanType DisplayImageCommand(ImageInfo *image_info,int argc,
  73. % char **argv,char **metadata,ExceptionInfo *exception)
  74. %
  75. % A description of each parameter follows:
  76. %
  77. % o image_info: The image info.
  78. %
  79. % o argc: The number of elements in the argument vector.
  80. %
  81. % o argv: A text array containing the command line arguments.
  82. %
  83. % o metadata: any metadata is returned here.
  84. %
  85. % o exception: Return any errors or warnings in this structure.
  86. %
  87. */
  88. static void DisplayUsage(void)
  89. {
  90. const char
  91. **p;
  92. static const char
  93. *buttons[]=
  94. {
  95. "1 press to map or unmap the Command widget",
  96. "2 press and drag to magnify a region of an image",
  97. "3 press to load an image from a visual image directory",
  98. (char *) NULL
  99. },
  100. *operators[]=
  101. {
  102. "-auto-orient automatically orient image",
  103. "-border geometry surround image with a border of color",
  104. "-clip clip along the first path from the 8BIM profile",
  105. "-clip-path id clip along a named path from the 8BIM profile",
  106. "-colors value preferred number of colors in the image",
  107. "-contrast enhance or reduce the image contrast",
  108. "-crop geometry preferred size and location of the cropped image",
  109. "-despeckle reduce the speckles within an image",
  110. "-edge factor apply a filter to detect edges in the image",
  111. "-enhance apply a digital filter to enhance a noisy image",
  112. "-extract geometry extract area from image",
  113. "-flip flip image in the vertical direction",
  114. "-flop flop image in the horizontal direction",
  115. "-frame geometry surround image with an ornamental border",
  116. "-gamma value level of gamma correction",
  117. "-monochrome transform image to black and white",
  118. "-negate replace every pixel with its complementary color",
  119. "-raise value lighten/darken image edges to create a 3-D effect",
  120. "-resample geometry change the resolution of an image",
  121. "-resize geometry resize the image",
  122. "-roll geometry roll an image vertically or horizontally",
  123. "-rotate degrees apply Paeth rotation to the image",
  124. "-sample geometry scale image with pixel sampling",
  125. "-segment value segment an image",
  126. "-sharpen geometry sharpen the image",
  127. "-strip strip image of all profiles and comments",
  128. "-trim trim image edges",
  129. (char *) NULL
  130. },
  131. *settings[]=
  132. {
  133. "-antialias remove pixel-aliasing",
  134. "-authenticate value decrypt image with this password",
  135. "-backdrop display image centered on a backdrop",
  136. "-channel type apply option to select image channels",
  137. "-colormap type Shared or Private",
  138. "-colorspace type alternate image colorspace",
  139. "-comment string annotate image with comment",
  140. "-compress type type of pixel compression when writing the image",
  141. "-debug events display copious debugging information",
  142. "-define format:option",
  143. " define one or more image format options",
  144. "-delay value display the next image after pausing",
  145. "-density geometry horizontal and vertical density of the image",
  146. "-depth value image depth",
  147. "-display server display image to this X server",
  148. "-dispose method GIF disposal method",
  149. "-dither apply Floyd/Steinberg error diffusion to image",
  150. "-endian type endianness (MSB or LSB) of the image",
  151. "-filter type use this filter when resizing an image",
  152. "-format \"string\" output formatted image characteristics",
  153. "-geometry geometry preferred size and location of the Image window",
  154. "-help print program options",
  155. "-identify identify the format and characteristics of the image",
  156. "-immutable displayed image cannot be modified",
  157. "-interlace type type of image interlacing scheme",
  158. "-interpolate method pixel color interpolation method",
  159. "-label string assign a label to an image",
  160. "-limit type value pixel cache resource limit",
  161. "-log format format of debugging information",
  162. "-loop iterations loop images then exit",
  163. "-map type display image using this Standard Colormap",
  164. "-matte store matte channel if the image has one",
  165. "-monitor monitor progress",
  166. "-page geometry size and location of an image canvas",
  167. "-profile filename add, delete, or apply an image profile",
  168. "-quality value JPEG/MIFF/PNG compression level",
  169. "-quantize colorspace reduce colors in this colorspace",
  170. "-quiet suppress all error or warning messages",
  171. "-regard-warnings pay attention to warning messages",
  172. "-remote command execute a command in an remote display process",
  173. "-repage geometry size and location of an image canvas (operator)",
  174. "-sampling-factor geometry",
  175. " horizontal and vertical sampling factor",
  176. "-scenes range image scene range",
  177. "-set property value set an image property",
  178. "-size geometry width and height of image",
  179. "-support factor resize support: > 1.0 is blurry, < 1.0 is sharp",
  180. "-texture filename name of texture to tile onto the image background",
  181. "-transparent-color color",
  182. " transparent color",
  183. "-treedepth value color tree depth",
  184. "-update seconds detect when image file is modified and redisplay",
  185. "-verbose print detailed information about the image",
  186. "-version print version information",
  187. "-visual type display image using this visual type",
  188. "-virtual-pixel method",
  189. " virtual pixel access method",
  190. "-window id display image to background of this window",
  191. "-window-group id exit program when this window id is destroyed",
  192. "-write filename write image to a file",
  193. (char *) NULL
  194. },
  195. *sequence_operators[]=
  196. {
  197. "-coalesce merge a sequence of images",
  198. "-flatten flatten a sequence of images",
  199. (char *) NULL
  200. };
  201. (void) printf("Version: %s\n",GetMagickVersion((unsigned long *) NULL));
  202. (void) printf("Copyright: %s\n\n",GetMagickCopyright());
  203. (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
  204. GetClientName());
  205. (void) printf("\nImage Settings:\n");
  206. for (p=settings; *p != (char *) NULL; p++)
  207. (void) printf(" %s\n",*p);
  208. (void) printf("\nImage Operators:\n");
  209. for (p=operators; *p != (char *) NULL; p++)
  210. (void) printf(" %s\n",*p);
  211. (void) printf("\nImage Sequence Operators:\n");
  212. for (p=sequence_operators; *p != (char *) NULL; p++)
  213. (void) printf(" %s\n",*p);
  214. (void) printf(
  215. "\nIn addition to those listed above, you can specify these standard X\n");
  216. (void) printf(
  217. "resources as command line options: -background, -bordercolor,\n");
  218. (void) printf(
  219. "-borderwidth, -font, -foreground, -iconGeometry, -iconic, -mattecolor,\n");
  220. (void) printf("-name, -shared-memory, -usePixmap, or -title.\n");
  221. (void) printf(
  222. "\nBy default, the image format of `file' is determined by its magic\n");
  223. (void) printf(
  224. "number. To specify a particular image format, precede the filename\n");
  225. (void) printf(
  226. "with an image format name and a colon (i.e. ps:image) or specify the\n");
  227. (void) printf(
  228. "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
  229. (void) printf("'-' for standard input or output.\n");
  230. (void) printf("\nButtons: \n");
  231. for (p=buttons; *p != (char *) NULL; p++)
  232. (void) printf(" %s\n",*p);
  233. exit(0);
  234. }
  235. WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info,
  236. int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
  237. {
  238. #if defined(HasX11)
  239. #define DestroyDisplay() \
  240. { \
  241. if ((state & ExitState) == 0) \
  242. DestroyXResources(); \
  243. if (display != (Display *) NULL) \
  244. { \
  245. XCloseDisplay(display); \
  246. display=(Display *) NULL; \
  247. } \
  248. XDestroyResourceInfo(&resource_info); \
  249. for ( ; k >= 0; k--) \
  250. image_stack[k]=DestroyImageList(image_stack[k]); \
  251. if (image_marker != (unsigned long *) NULL) \
  252. image_marker=(unsigned long *) RelinquishMagickMemory(image_marker); \
  253. for (i=0; i < (long) argc; i++) \
  254. argv[i]=(char *) RelinquishMagickMemory(argv[i]); \
  255. argv=(char **) RelinquishMagickMemory(argv); \
  256. }
  257. #define ThrowDisplayException(asperity,tag,option) \
  258. { \
  259. (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
  260. option); \
  261. DestroyDisplay(); \
  262. return(MagickFalse); \
  263. }
  264. #define ThrowDisplayInvalidArgumentException(option,argument) \
  265. { \
  266. (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
  267. "InvalidArgument","`%s': %s",argument,option); \
  268. DestroyDisplay(); \
  269. return(MagickFalse); \
  270. }
  271. char
  272. *resource_value,
  273. *server_name;
  274. const char
  275. *option;
  276. Display
  277. *display;
  278. Image
  279. *image,
  280. *image_stack[MaxImageStackDepth+1];
  281. long
  282. first_scene,
  283. image_number,
  284. iteration,
  285. j,
  286. k,
  287. l,
  288. last_scene,
  289. scene;
  290. MagickStatusType
  291. pend,
  292. status;
  293. QuantizeInfo
  294. *quantize_info;
  295. register long
  296. i;
  297. unsigned long
  298. *image_marker,
  299. iterations,
  300. last_image,
  301. state;
  302. XResourceInfo
  303. resource_info;
  304. XrmDatabase
  305. resource_database;
  306. /*
  307. Set defaults.
  308. */
  309. assert(image_info != (ImageInfo *) NULL);
  310. assert(image_info->signature == MagickSignature);
  311. if (image_info->debug != MagickFalse)
  312. (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
  313. assert(exception != (ExceptionInfo *) NULL);
  314. SetNotifyHandlers;
  315. display=(Display *) NULL;
  316. first_scene=0;
  317. j=1;
  318. k=0;
  319. image_marker=(unsigned long *) NULL;
  320. image_stack[k]=NewImageList();
  321. image_number=0;
  322. last_image=0;
  323. last_scene=0;
  324. option=(char *) NULL;
  325. pend=MagickFalse;
  326. resource_database=(XrmDatabase) NULL;
  327. (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info));
  328. server_name=(char *) NULL;
  329. state=0;
  330. status=MagickTrue;
  331. ReadCommandlLine(argc,&argv);
  332. status=ExpandFilenames(&argc,&argv);
  333. if (status == MagickFalse)
  334. {
  335. char
  336. *message;
  337. message=GetExceptionMessage(errno);
  338. ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
  339. message);
  340. message=(char *) RelinquishMagickMemory(message);
  341. }
  342. image_marker=(unsigned long *) AcquireMagickMemory((argc+1)*
  343. sizeof(*image_marker));
  344. if (image_marker == (unsigned long *) NULL)
  345. {
  346. char
  347. *message;
  348. message=GetExceptionMessage(errno);
  349. ThrowDisplayException(ResourceLimitError,"MemoryAllocationFailed",
  350. message);
  351. message=(char *) RelinquishMagickMemory(message);
  352. }
  353. for (i=0; i <= argc; i++)
  354. image_marker[i]=(unsigned long) argc;
  355. /*
  356. Check for server name specified on the command line.
  357. */
  358. for (i=1; i < (long) argc; i++)
  359. {
  360. /*
  361. Check command line for server name.
  362. */
  363. option=argv[i];
  364. if (IsMagickOption(option) == MagickFalse)
  365. continue;
  366. if (LocaleCompare("display",option+1) == 0)
  367. {
  368. /*
  369. User specified server name.
  370. */
  371. i++;
  372. if (i == (long) argc)
  373. ThrowDisplayException(OptionError,"MissingArgument",option);
  374. server_name=argv[i];
  375. }
  376. if ((LocaleCompare("help",option+1) == 0) ||
  377. (LocaleCompare("-help",option+1) == 0))
  378. DisplayUsage();
  379. }
  380. /*
  381. Get user defaults from X resource database.
  382. */
  383. display=XOpenDisplay(server_name);
  384. if (display == (Display *) NULL)
  385. ThrowDisplayException(XServerError,"UnableToOpenXServer",
  386. XDisplayName(server_name));
  387. (void) XSetErrorHandler(XError);
  388. resource_database=XGetResourceDatabase(display,GetClientName());
  389. XGetResourceInfo(resource_database,GetClientName(),&resource_info);
  390. image_info=resource_info.image_info;
  391. quantize_info=resource_info.quantize_info;
  392. image_info->density=XGetResourceInstance(resource_database,GetClientName(),
  393. "density",(char *) NULL);
  394. if (image_info->density == (char *) NULL)
  395. image_info->density=XGetScreenDensity(display);
  396. resource_value=XGetResourceInstance(resource_database,GetClientName(),
  397. "interlace","none");
  398. image_info->interlace=(InterlaceType)
  399. ParseMagickOption(MagickInterlaceOptions,MagickFalse,resource_value);
  400. image_info->page=XGetResourceInstance(resource_database,GetClientName(),
  401. "pageGeometry",(char *) NULL);
  402. resource_value=XGetResourceInstance(resource_database,GetClientName(),
  403. "quality","75");
  404. image_info->quality=(unsigned long) atol(resource_value);
  405. resource_value=XGetResourceInstance(resource_database,GetClientName(),
  406. "verbose","False");
  407. image_info->verbose=IsMagickTrue(resource_value);
  408. resource_value=XGetResourceInstance(resource_database,GetClientName(),
  409. "dither","True");
  410. quantize_info->dither=IsMagickTrue(resource_value);
  411. /*
  412. Parse command line.
  413. */
  414. iteration=0;
  415. iterations=0;
  416. for (i=1; ((i <= (long) argc) && ((state & ExitState) == 0)); i++)
  417. {
  418. if (i < (long) argc)
  419. option=argv[i];
  420. else
  421. if (image_stack[k] != (Image *) NULL)
  422. break;
  423. else
  424. if (isatty(STDIN_FILENO) != MagickFalse)
  425. option="logo:";
  426. else
  427. {
  428. int
  429. c;
  430. c=getc(stdin);
  431. if (c == EOF)
  432. break;
  433. else
  434. {
  435. c=ungetc(c,stdin);
  436. option="-";
  437. }
  438. }
  439. if (LocaleCompare(option,"(") == 0)
  440. {
  441. if (k == MaxImageStackDepth)
  442. ThrowDisplayException(OptionError,"ParenthesisNestedTooDeeply",
  443. option);
  444. MogrifyImageStack(image_stack[k],MagickTrue,pend);
  445. k++;
  446. image_stack[k]=NewImageList();
  447. continue;
  448. }
  449. if (LocaleCompare(option,")") == 0)
  450. {
  451. if (k == 0)
  452. ThrowDisplayException(OptionError,"UnableToParseExpression",option);
  453. if (image_stack[k] != (Image *) NULL)
  454. {
  455. MogrifyImageStack(image_stack[k],MagickTrue,MagickTrue);
  456. AppendImageToList(&image_stack[k-1],image_stack[k]);
  457. }
  458. k--;
  459. continue;
  460. }
  461. if (IsMagickOption(option) == MagickFalse)
  462. {
  463. /*
  464. Option is a file name.
  465. */
  466. MogrifyImageStack(image_stack[k],MagickFalse,pend);
  467. for (scene=first_scene; scene <= last_scene ; scene++)
  468. {
  469. const char
  470. *filename;
  471. /*
  472. Read image.
  473. */
  474. filename=option;
  475. if ((LocaleCompare(filename,"--") == 0) && (i < (argc-1)))
  476. {
  477. option=argv[++i];
  478. filename=option;
  479. }
  480. (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
  481. if (first_scene != last_scene)
  482. {
  483. char
  484. filename[MaxTextExtent];
  485. /*
  486. Form filename for multi-part images.
  487. */
  488. (void) InterpretImageFilename(filename,MaxTextExtent,
  489. image_info->filename,(int) scene);
  490. if (LocaleCompare(filename,image_info->filename) == 0)
  491. (void) FormatMagickString(filename,MaxTextExtent,"%s.%lu",
  492. image_info->filename,scene);
  493. (void) CopyMagickString(image_info->filename,filename,
  494. MaxTextExtent);
  495. }
  496. image=ReadImage(image_info,exception);
  497. CatchException(exception);
  498. status&=(image != (Image *) NULL) &&
  499. (exception->severity < ErrorException);
  500. if (image == (Image *) NULL)
  501. continue;
  502. AppendImageToList(&image_stack[k],image);
  503. MogrifyImageStack(image_stack[k],MagickFalse,MagickTrue);
  504. do
  505. {
  506. /*
  507. Transmogrify image as defined by the image processing options.
  508. */
  509. resource_info.quantum=1;
  510. if (first_scene != last_scene)
  511. image_stack[k]->scene=(unsigned long) scene;
  512. if (resource_info.window_id != (char *) NULL)
  513. {
  514. /*
  515. Display image to a specified X window.
  516. */
  517. status=XDisplayBackgroundImage(display,&resource_info,
  518. image_stack[k]);
  519. if (status != MagickFalse)
  520. state|=RetainColorsState;
  521. }
  522. else
  523. do
  524. {
  525. Image
  526. *nexus;
  527. /*
  528. Display image to X server.
  529. */
  530. nexus=XDisplayImage(display,&resource_info,argv,argc,
  531. image_stack+k,&state);
  532. if (nexus == (Image *) NULL)
  533. break;
  534. while ((nexus != (Image *) NULL) && ((state & ExitState) == 0))
  535. {
  536. if (nexus->montage != (char *) NULL)
  537. {
  538. /*
  539. User selected a visual directory image (montage).
  540. */
  541. image_stack[k]=DestroyImageList(image_stack[k]);
  542. image_stack[k]=nexus;
  543. break;
  544. }
  545. if (first_scene != last_scene)
  546. image_stack[k]->scene=(unsigned long) scene;
  547. image=XDisplayImage(display,&resource_info,argv,argc,&nexus,
  548. &state);
  549. if ((image == (Image *) NULL) &&
  550. (GetNextImageInList(nexus) != (Image *) NULL))
  551. {
  552. image_stack[k]=DestroyImageList(image_stack[k]);
  553. image_stack[k]=GetNextImageInList(nexus);
  554. nexus=NewImageList();
  555. }
  556. else
  557. {
  558. if (nexus != image_stack[k])
  559. nexus=DestroyImageList(nexus);
  560. nexus=image;
  561. }
  562. }
  563. } while ((state & ExitState) == 0);
  564. if (resource_info.write_filename != (char *) NULL)
  565. {
  566. /*
  567. Write image.
  568. */
  569. (void) CopyMagickString(image_stack[k]->filename,
  570. resource_info.write_filename,MaxTextExtent);
  571. (void) SetImageInfo(image_info,MagickTrue,
  572. &image_stack[k]->exception);
  573. status&=WriteImage(image_info,image_stack[k]);
  574. GetImageException(image_stack[k],exception);
  575. }
  576. /*
  577. Proceed to next/previous image.
  578. */
  579. image=image_stack[k];
  580. if ((state & FormerImageState) != 0)
  581. for (l=0; l < resource_info.quantum; l++)
  582. {
  583. image=GetPreviousImageInList(image);
  584. if (image == (Image *) NULL)
  585. break;
  586. }
  587. else
  588. for (l=0; l < resource_info.quantum; l++)
  589. {
  590. image=GetNextImageInList(image);
  591. if (image == (Image *) NULL)
  592. break;
  593. }
  594. if (image != (Image *) NULL)
  595. image_stack[k]=image;
  596. } while ((image != (Image *) NULL) && ((state & ExitState) == 0));
  597. /*
  598. Free image resources.
  599. */
  600. image_stack[k]=DestroyImageList(image_stack[k]);
  601. if ((state & FormerImageState) == 0)
  602. {
  603. last_image=(unsigned long) image_number;
  604. image_marker[i]=(unsigned long) image_number++;
  605. }
  606. else
  607. {
  608. /*
  609. Proceed to previous image.
  610. */
  611. for (i--; i > 0; i--)
  612. if (image_marker[i] == (unsigned long) (image_number-2))
  613. break;
  614. image_number--;
  615. }
  616. if ((i == (long) (argc-1)) && ((state & ExitState) == 0))
  617. i=0;
  618. if ((state & ExitState) != 0)
  619. break;
  620. }
  621. /*
  622. Determine if we should proceed to the first image.
  623. */
  624. if (image_number < 0)
  625. {
  626. if ((state & FormerImageState) != 0)
  627. {
  628. for (i=1; i < (argc-2); i++)
  629. if (last_image == image_marker[i])
  630. break;
  631. image_number=(long) image_marker[i]+1;
  632. }
  633. continue;
  634. }
  635. if (resource_info.window_id != (char *) NULL)
  636. state|=ExitState;
  637. if (iterations != 0)
  638. if (iteration == (long) iterations)
  639. state|=ExitState;
  640. iteration++;
  641. continue;
  642. }
  643. pend=image_stack[k] != (Image *) NULL ? MagickTrue : MagickFalse;
  644. switch (*(option+1))
  645. {
  646. case 'a':
  647. {
  648. if (LocaleCompare("antialias",option+1) == 0)
  649. break;
  650. if (LocaleCompare("authenticate",option+1) == 0)
  651. {
  652. if (*option == '+')
  653. break;
  654. i++;
  655. if (i == (long) argc)
  656. ThrowDisplayException(OptionError,"MissingArgument",option);
  657. break;
  658. }
  659. if (LocaleCompare("auto-orient",option+1) == 0)
  660. break;
  661. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  662. }
  663. case 'b':
  664. {
  665. if (LocaleCompare("backdrop",option+1) == 0)
  666. {
  667. resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
  668. break;
  669. }
  670. if (LocaleCompare("background",option+1) == 0)
  671. {
  672. if (*option == '+')
  673. break;
  674. i++;
  675. if (i == (long) argc)
  676. ThrowDisplayException(OptionError,"MissingArgument",option);
  677. resource_info.background_color=argv[i];
  678. break;
  679. }
  680. if (LocaleCompare("border",option+1) == 0)
  681. {
  682. if (*option == '+')
  683. break;
  684. i++;
  685. if (i == (long) argc)
  686. ThrowDisplayException(OptionError,"MissingArgument",option);
  687. if (IsGeometry(argv[i]) == MagickFalse)
  688. ThrowDisplayInvalidArgumentException(option,argv[i]);
  689. break;
  690. }
  691. if (LocaleCompare("bordercolor",option+1) == 0)
  692. {
  693. if (*option == '+')
  694. break;
  695. i++;
  696. if (i == (long) argc)
  697. ThrowDisplayException(OptionError,"MissingArgument",option);
  698. resource_info.border_color=argv[i];
  699. break;
  700. }
  701. if (LocaleCompare("borderwidth",option+1) == 0)
  702. {
  703. resource_info.border_width=0;
  704. if (*option == '+')
  705. break;
  706. i++;
  707. if (i == (long) argc)
  708. ThrowDisplayException(OptionError,"MissingArgument",option);
  709. if (IsGeometry(argv[i]) == MagickFalse)
  710. ThrowDisplayInvalidArgumentException(option,argv[i]);
  711. resource_info.border_width=(unsigned int) atoi(argv[i]);
  712. break;
  713. }
  714. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  715. }
  716. case 'c':
  717. {
  718. if (LocaleCompare("cache",option+1) == 0)
  719. {
  720. if (*option == '+')
  721. break;
  722. i++;
  723. if (i == (long) argc)
  724. ThrowDisplayException(OptionError,"MissingArgument",option);
  725. if (IsGeometry(argv[i]) == MagickFalse)
  726. ThrowDisplayInvalidArgumentException(option,argv[i]);
  727. break;
  728. }
  729. if (LocaleCompare("channel",option+1) == 0)
  730. {
  731. long
  732. channel;
  733. if (*option == '+')
  734. break;
  735. i++;
  736. if (i == (long) (argc-1))
  737. ThrowDisplayException(OptionError,"MissingArgument",option);
  738. channel=ParseChannelOption(argv[i]);
  739. if (channel < 0)
  740. ThrowDisplayException(OptionError,"UnrecognizedChannelType",
  741. argv[i]);
  742. break;
  743. }
  744. if (LocaleCompare("clip",option+1) == 0)
  745. break;
  746. if (LocaleCompare("clip-path",option+1) == 0)
  747. {
  748. i++;
  749. if (i == (long) argc)
  750. ThrowDisplayException(OptionError,"MissingArgument",option);
  751. break;
  752. }
  753. if (LocaleCompare("coalesce",option+1) == 0)
  754. break;
  755. if (LocaleCompare("colormap",option+1) == 0)
  756. {
  757. resource_info.colormap=PrivateColormap;
  758. if (*option == '+')
  759. break;
  760. i++;
  761. if (i == (long) argc)
  762. ThrowDisplayException(OptionError,"MissingArgument",option);
  763. resource_info.colormap=UndefinedColormap;
  764. if (LocaleCompare("private",argv[i]) == 0)
  765. resource_info.colormap=PrivateColormap;
  766. if (LocaleCompare("shared",argv[i]) == 0)
  767. resource_info.colormap=SharedColormap;
  768. if (resource_info.colormap == UndefinedColormap)
  769. ThrowDisplayException(OptionError,"UnrecognizedColormapType",
  770. argv[i]);
  771. break;
  772. }
  773. if (LocaleCompare("colors",option+1) == 0)
  774. {
  775. quantize_info->number_colors=0;
  776. if (*option == '+')
  777. break;
  778. i++;
  779. if (i == (long) argc)
  780. ThrowDisplayException(OptionError,"MissingArgument",option);
  781. if (IsGeometry(argv[i]) == MagickFalse)
  782. ThrowDisplayInvalidArgumentException(option,argv[i]);
  783. quantize_info->number_colors=(unsigned long) atol(argv[i]);
  784. break;
  785. }
  786. if (LocaleCompare("colorspace",option+1) == 0)
  787. {
  788. long
  789. colorspace;
  790. if (*option == '+')
  791. break;
  792. i++;
  793. if (i == (long) argc)
  794. ThrowDisplayException(OptionError,"MissingArgument",option);
  795. colorspace=ParseMagickOption(MagickColorspaceOptions,
  796. MagickFalse,argv[i]);
  797. if (colorspace < 0)
  798. ThrowDisplayException(OptionError,"UnrecognizedColorspace",
  799. argv[i]);
  800. break;
  801. }
  802. if (LocaleCompare("comment",option+1) == 0)
  803. {
  804. if (*option == '+')
  805. break;
  806. i++;
  807. if (i == (long) argc)
  808. ThrowDisplayException(OptionError,"MissingArgument",option);
  809. break;
  810. }
  811. if (LocaleCompare("compress",option+1) == 0)
  812. {
  813. long
  814. compression;
  815. if (*option == '+')
  816. break;
  817. i++;
  818. if (i == (long) argc)
  819. ThrowDisplayException(OptionError,"MissingArgument",option);
  820. compression=ParseMagickOption(MagickCompressionOptions,
  821. MagickFalse,argv[i]);
  822. if (compression < 0)
  823. ThrowDisplayException(OptionError,
  824. "UnrecognizedImageCompression",argv[i]);
  825. break;
  826. }
  827. if (LocaleCompare("contrast",option+1) == 0)
  828. break;
  829. if (LocaleCompare("crop",option+1) == 0)
  830. {
  831. if (*option == '+')
  832. break;
  833. i++;
  834. if (i == (long) argc)
  835. ThrowDisplayException(OptionError,"MissingArgument",option);
  836. if (IsGeometry(argv[i]) == MagickFalse)
  837. ThrowDisplayInvalidArgumentException(option,argv[i]);
  838. break;
  839. }
  840. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  841. }
  842. case 'd':
  843. {
  844. if (LocaleCompare("debug",option+1) == 0)
  845. {
  846. long
  847. event;
  848. if (*option == '+')
  849. break;
  850. i++;
  851. if (i == (long) argc)
  852. ThrowDisplayException(OptionError,"MissingArgument",option);
  853. event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
  854. if (event < 0)
  855. ThrowDisplayException(OptionError,"UnrecognizedEventType",
  856. argv[i]);
  857. (void) SetLogEventMask(argv[i]);
  858. break;
  859. }
  860. if (LocaleCompare("define",option+1) == 0)
  861. {
  862. i++;
  863. if (i == (long) argc)
  864. ThrowDisplayException(OptionError,"MissingArgument",option);
  865. if (*option == '+')
  866. {
  867. const char
  868. *define;
  869. define=GetImageOption(image_info,argv[i]);
  870. if (define == (const char *) NULL)
  871. ThrowDisplayException(OptionError,"NoSuchOption",argv[i]);
  872. break;
  873. }
  874. break;
  875. }
  876. if (LocaleCompare("delay",option+1) == 0)
  877. {
  878. if (*option == '+')
  879. break;
  880. i++;
  881. if (i == (long) argc)
  882. ThrowDisplayException(OptionError,"MissingArgument",option);
  883. if (IsGeometry(argv[i]) == MagickFalse)
  884. ThrowDisplayInvalidArgumentException(option,argv[i]);
  885. break;
  886. }
  887. if (LocaleCompare("density",option+1) == 0)
  888. {
  889. if (*option == '+')
  890. break;
  891. i++;
  892. if (i == (long) argc)
  893. ThrowDisplayException(OptionError,"MissingArgument",option);
  894. if (IsGeometry(argv[i]) == MagickFalse)
  895. ThrowDisplayInvalidArgumentException(option,argv[i]);
  896. break;
  897. }
  898. if (LocaleCompare("depth",option+1) == 0)
  899. {
  900. if (*option == '+')
  901. break;
  902. i++;
  903. if (i == (long) argc)
  904. ThrowDisplayException(OptionError,"MissingArgument",option);
  905. if (IsGeometry(argv[i]) == MagickFalse)
  906. ThrowDisplayInvalidArgumentException(option,argv[i]);
  907. break;
  908. }
  909. if (LocaleCompare("despeckle",option+1) == 0)
  910. break;
  911. if (LocaleCompare("display",option+1) == 0)
  912. {
  913. if (*option == '+')
  914. break;
  915. i++;
  916. if (i == (long) argc)
  917. ThrowDisplayException(OptionError,"MissingArgument",option);
  918. break;
  919. }
  920. if (LocaleCompare("dispose",option+1) == 0)
  921. {
  922. long
  923. dispose;
  924. if (*option == '+')
  925. break;
  926. i++;
  927. if (i == (long) argc)
  928. ThrowDisplayException(OptionError,"MissingArgument",option);
  929. dispose=ParseMagickOption(MagickDisposeOptions,MagickFalse,argv[i]);
  930. if (dispose < 0)
  931. ThrowDisplayException(OptionError,"UnrecognizedDisposeMethod",
  932. argv[i]);
  933. break;
  934. }
  935. if (LocaleCompare("dither",option+1) == 0)
  936. {
  937. quantize_info->dither=(*option == '-') ? MagickTrue : MagickFalse;
  938. break;
  939. }
  940. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  941. }
  942. case 'e':
  943. {
  944. if (LocaleCompare("edge",option+1) == 0)
  945. {
  946. if (*option == '+')
  947. break;
  948. i++;
  949. if (i == (long) argc)
  950. ThrowDisplayException(OptionError,"MissingArgument",option);
  951. if (IsGeometry(argv[i]) == MagickFalse)
  952. ThrowDisplayInvalidArgumentException(option,argv[i]);
  953. break;
  954. }
  955. if (LocaleCompare("endian",option+1) == 0)
  956. {
  957. long
  958. endian;
  959. if (*option == '+')
  960. break;
  961. i++;
  962. if (i == (long) argc)
  963. ThrowDisplayException(OptionError,"MissingArgument",option);
  964. endian=ParseMagickOption(MagickEndianOptions,MagickFalse,
  965. argv[i]);
  966. if (endian < 0)
  967. ThrowDisplayException(OptionError,"UnrecognizedEndianType",
  968. argv[i]);
  969. break;
  970. }
  971. if (LocaleCompare("enhance",option+1) == 0)
  972. break;
  973. if (LocaleCompare("extract",option+1) == 0)
  974. {
  975. if (*option == '+')
  976. break;
  977. i++;
  978. if (i == (long) argc)
  979. ThrowDisplayException(OptionError,"MissingArgument",option);
  980. if (IsGeometry(argv[i]) == MagickFalse)
  981. ThrowDisplayInvalidArgumentException(option,argv[i]);
  982. break;
  983. }
  984. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  985. }
  986. case 'f':
  987. {
  988. if (LocaleCompare("filter",option+1) == 0)
  989. {
  990. long
  991. filter;
  992. if (*option == '+')
  993. break;
  994. i++;
  995. if (i == (long) argc)
  996. ThrowDisplayException(OptionError,"MissingArgument",option);
  997. filter=ParseMagickOption(MagickFilterOptions,MagickFalse,
  998. argv[i]);
  999. if (filter < 0)
  1000. ThrowDisplayException(OptionError,"UnrecognizedImageFilter",
  1001. argv[i]);
  1002. break;
  1003. }
  1004. if (LocaleCompare("flatten",option+1) == 0)
  1005. break;
  1006. if (LocaleCompare("flip",option+1) == 0)
  1007. break;
  1008. if (LocaleCompare("flop",option+1) == 0)
  1009. break;
  1010. if (LocaleCompare("font",option+1) == 0)
  1011. {
  1012. if (*option == '+')
  1013. break;
  1014. i++;
  1015. if (i == (long) argc)
  1016. ThrowDisplayException(OptionError,"MissingArgument",option);
  1017. resource_info.font=XGetResourceClass(resource_database,
  1018. GetClientName(),"font",argv[i]);
  1019. break;
  1020. }
  1021. if (LocaleCompare("foreground",option+1) == 0)
  1022. {
  1023. if (*option == '+')
  1024. break;
  1025. i++;
  1026. if (i == (long) argc)
  1027. ThrowDisplayException(OptionError,"MissingArgument",option);
  1028. resource_info.foreground_color=argv[i];
  1029. break;
  1030. }
  1031. if (LocaleCompare("format",option+1) == 0)
  1032. {
  1033. if (*option == '+')
  1034. break;
  1035. i++;
  1036. if (i == (long) (argc-1))
  1037. ThrowDisplayException(OptionError,"MissingArgument",option);
  1038. break;
  1039. }
  1040. if (LocaleCompare("frame",option+1) == 0)
  1041. {
  1042. if (*option == '+')
  1043. break;
  1044. i++;
  1045. if (i == (long) argc)
  1046. ThrowDisplayException(OptionError,"MissingArgument",option);
  1047. if (IsGeometry(argv[i]) == MagickFalse)
  1048. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1049. break;
  1050. }
  1051. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1052. }
  1053. case 'g':
  1054. {
  1055. if (LocaleCompare("gamma",option+1) == 0)
  1056. {
  1057. i++;
  1058. if (i == (long) argc)
  1059. ThrowDisplayException(OptionError,"MissingArgument",option);
  1060. if (IsGeometry(argv[i]) == MagickFalse)
  1061. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1062. break;
  1063. }
  1064. if (LocaleCompare("geometry",option+1) == 0)
  1065. {
  1066. resource_info.image_geometry=(char *) NULL;
  1067. if (*option == '+')
  1068. break;
  1069. (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
  1070. i++;
  1071. if (i == (long) argc)
  1072. ThrowDisplayException(OptionError,"MissingArgument",option);
  1073. if (IsGeometry(argv[i]) == MagickFalse)
  1074. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1075. resource_info.image_geometry=ConstantString(argv[i]);
  1076. break;
  1077. }
  1078. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1079. }
  1080. case 'h':
  1081. {
  1082. if ((LocaleCompare("help",option+1) == 0) ||
  1083. (LocaleCompare("-help",option+1) == 0))
  1084. break;
  1085. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1086. }
  1087. case 'i':
  1088. {
  1089. if (LocaleCompare("identify",option+1) == 0)
  1090. break;
  1091. if (LocaleCompare("iconGeometry",option+1) == 0)
  1092. {
  1093. resource_info.icon_geometry=(char *) NULL;
  1094. if (*option == '+')
  1095. break;
  1096. i++;
  1097. if (i == (long) argc)
  1098. ThrowDisplayException(OptionError,"MissingArgument",option);
  1099. if (IsGeometry(argv[i]) == MagickFalse)
  1100. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1101. resource_info.icon_geometry=argv[i];
  1102. break;
  1103. }
  1104. if (LocaleCompare("iconic",option+1) == 0)
  1105. {
  1106. resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
  1107. break;
  1108. }
  1109. if (LocaleCompare("immutable",option+1) == 0)
  1110. {
  1111. resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
  1112. break;
  1113. }
  1114. if (LocaleCompare("interlace",option+1) == 0)
  1115. {
  1116. long
  1117. interlace;
  1118. if (*option == '+')
  1119. break;
  1120. i++;
  1121. if (i == (long) argc)
  1122. ThrowDisplayException(OptionError,"MissingArgument",option);
  1123. interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
  1124. argv[i]);
  1125. if (interlace < 0)
  1126. ThrowDisplayException(OptionError,"UnrecognizedInterlaceType",
  1127. argv[i]);
  1128. break;
  1129. }
  1130. if (LocaleCompare("interpolate",option+1) == 0)
  1131. {
  1132. long
  1133. interpolate;
  1134. if (*option == '+')
  1135. break;
  1136. i++;
  1137. if (i == (long) argc)
  1138. ThrowDisplayException(OptionError,"MissingArgument",option);
  1139. interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
  1140. argv[i]);
  1141. if (interpolate < 0)
  1142. ThrowDisplayException(OptionError,"UnrecognizedInterpolateMethod",
  1143. argv[i]);
  1144. break;
  1145. }
  1146. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1147. }
  1148. case 'l':
  1149. {
  1150. if (LocaleCompare("label",option+1) == 0)
  1151. {
  1152. if (*option == '+')
  1153. break;
  1154. i++;
  1155. if (i == (long) argc)
  1156. ThrowDisplayException(OptionError,"MissingArgument",option);
  1157. break;
  1158. }
  1159. if (LocaleCompare("limit",option+1) == 0)
  1160. {
  1161. long
  1162. resource;
  1163. if (*option == '+')
  1164. break;
  1165. i++;
  1166. if (i == (long) argc)
  1167. ThrowDisplayException(OptionError,"MissingArgument",option);
  1168. resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
  1169. argv[i]);
  1170. if (resource < 0)
  1171. ThrowDisplayException(OptionError,"UnrecognizedResourceType",
  1172. argv[i]);
  1173. i++;
  1174. if (i == (long) argc)
  1175. ThrowDisplayException(OptionError,"MissingArgument",option);
  1176. if ((LocaleCompare("unlimited",argv[i]) != 0) &&
  1177. (IsGeometry(argv[i]) == MagickFalse))
  1178. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1179. break;
  1180. }
  1181. if (LocaleCompare("log",option+1) == 0)
  1182. {
  1183. if (*option == '+')
  1184. break;
  1185. i++;
  1186. if ((i == (long) argc) ||
  1187. (strchr(argv[i],'%') == (char *) NULL))
  1188. ThrowDisplayException(OptionError,"MissingArgument",option);
  1189. break;
  1190. }
  1191. if (LocaleCompare("loop",option+1) == 0)
  1192. {
  1193. if (*option == '+')
  1194. break;
  1195. i++;
  1196. if (i == (long) (argc-1))
  1197. ThrowDisplayException(OptionError,"MissingArgument",option);
  1198. if (IsGeometry(argv[i]) == MagickFalse)
  1199. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1200. iterations=(unsigned long) atol(argv[i]);
  1201. break;
  1202. }
  1203. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1204. }
  1205. case 'm':
  1206. {
  1207. if (LocaleCompare("magnify",option+1) == 0)
  1208. {
  1209. resource_info.magnify=2;
  1210. if (*option == '+')
  1211. break;
  1212. i++;
  1213. if (i == (long) argc)
  1214. ThrowDisplayException(OptionError,"MissingArgument",option);
  1215. if (IsGeometry(argv[i]) == MagickFalse)
  1216. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1217. resource_info.magnify=(unsigned int) atoi(argv[i]);
  1218. break;
  1219. }
  1220. if (LocaleCompare("map",option+1) == 0)
  1221. {
  1222. resource_info.map_type=(char *) NULL;
  1223. if (*option == '+')
  1224. break;
  1225. (void) CopyMagickString(argv[i]+1,"sans",MaxTextExtent);
  1226. i++;
  1227. if (i == (long) argc)
  1228. ThrowDisplayException(OptionError,"MissingArgument",option);
  1229. resource_info.map_type=argv[i];
  1230. break;
  1231. }
  1232. if (LocaleCompare("matte",option+1) == 0)
  1233. break;
  1234. if (LocaleCompare("mattecolor",option+1) == 0)
  1235. {
  1236. if (*option == '+')
  1237. break;
  1238. i++;
  1239. if (i == (long) argc)
  1240. ThrowDisplayException(OptionError,"MissingArgument",option);
  1241. resource_info.matte_color=argv[i];
  1242. break;
  1243. }
  1244. if (LocaleCompare("monitor",option+1) == 0)
  1245. break;
  1246. if (LocaleCompare("monochrome",option+1) == 0)
  1247. {
  1248. if (*option == '+')
  1249. break;
  1250. quantize_info->number_colors=2;
  1251. quantize_info->colorspace=GRAYColorspace;
  1252. break;
  1253. }
  1254. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1255. }
  1256. case 'n':
  1257. {
  1258. if (LocaleCompare("name",option+1) == 0)
  1259. {
  1260. resource_info.name=(char *) NULL;
  1261. if (*option == '+')
  1262. break;
  1263. i++;
  1264. if (i == (long) argc)
  1265. ThrowDisplayException(OptionError,"MissingArgument",option);
  1266. resource_info.name=argv[i];
  1267. break;
  1268. }
  1269. if (LocaleCompare("negate",option+1) == 0)
  1270. break;
  1271. if (LocaleCompare("noop",option+1) == 0)
  1272. break;
  1273. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1274. }
  1275. case 'p':
  1276. {
  1277. if (LocaleCompare("page",option+1) == 0)
  1278. {
  1279. resource_info.image_geometry=(char *) NULL;
  1280. if (*option == '+')
  1281. break;
  1282. i++;
  1283. if (i == (long) argc)
  1284. ThrowDisplayException(OptionError,"MissingArgument",option);
  1285. resource_info.image_geometry=ConstantString(argv[i]);
  1286. break;
  1287. }
  1288. if (LocaleCompare("profile",option+1) == 0)
  1289. {
  1290. i++;
  1291. if (i == (long) argc)
  1292. ThrowDisplayException(OptionError,"MissingArgument",option);
  1293. break;
  1294. }
  1295. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1296. }
  1297. case 'q':
  1298. {
  1299. if (LocaleCompare("quality",option+1) == 0)
  1300. {
  1301. if (*option == '+')
  1302. break;
  1303. i++;
  1304. if (i == (long) argc)
  1305. ThrowDisplayException(OptionError,"MissingArgument",option);
  1306. if (IsGeometry(argv[i]) == MagickFalse)
  1307. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1308. break;
  1309. }
  1310. if (LocaleCompare("quantize",option+1) == 0)
  1311. {
  1312. long
  1313. colorspace;
  1314. if (*option == '+')
  1315. break;
  1316. i++;
  1317. if (i == (long) (argc-1))
  1318. ThrowDisplayException(OptionError,"MissingArgument",option);
  1319. colorspace=ParseMagickOption(MagickColorspaceOptions,
  1320. MagickFalse,argv[i]);
  1321. if (colorspace < 0)
  1322. ThrowDisplayException(OptionError,"UnrecognizedColorspace",
  1323. argv[i]);
  1324. break;
  1325. }
  1326. if (LocaleCompare("quiet",option+1) == 0)
  1327. break;
  1328. ThrowDisplayException(OptionError,"UnrecognizedOption",option);
  1329. }
  1330. case 'r':
  1331. {
  1332. if (LocaleCompare("raise",option+1) == 0)
  1333. {
  1334. i++;
  1335. if (i == (long) argc)
  1336. ThrowDisplayException(OptionError,"MissingArgument",option);
  1337. if (IsGeometry(argv[i]) == MagickFalse)
  1338. ThrowDisplayInvalidArgumentException(option,argv[i]);
  1339. break;
  1340. }
  1341. if (LocaleCompare("regard-warnings",option+1) == 0)
  1342. break;
  1343. if (LocaleCompare("remote",option+1) == 0)
  1344. {
  1345. i++;
  1346. if (i == (long) argc)
  1347. ThrowDisplayException(OptionError,"MissingArgument",option);
  1348. if (XRemoteCommand(

Large files files are truncated, but you can click here to view the full file