PageRenderTime 29ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/scripts/ImageMagick-6.6.2-6/wand/composite.c

https://bitbucket.org/JasonGross/alphabets
C | 1664 lines | 1500 code | 55 blank | 109 comment | 663 complexity | 710c54b489c9a8b8505715f14d4ab2da MD5 | raw file
Possible License(s): BSD-3-Clause-No-Nuclear-License-2014, Apache-2.0, MPL-2.0-no-copyleft-exception

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

  1. /*
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % %
  4. % %
  5. % %
  6. % CCCC OOO M M PPPP OOO SSSSS IIIII TTTTT EEEEE %
  7. % C O O MM MM P P O O SS I T E %
  8. % C O O M M M PPPP O O SSS I T EEE %
  9. % C O O M M P O O SS I T E %
  10. % CCCC OOO M M P OOO SSSSS IIIII T EEEEE %
  11. % %
  12. % %
  13. % MagickWand Image Composite Methods %
  14. % %
  15. % Software Design %
  16. % John Cristy %
  17. % July 1992 %
  18. % %
  19. % %
  20. % Copyright 1999-2010 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. % Use the composite program to overlap one image over another.
  37. %
  38. */
  39. /*
  40. Include declarations.
  41. */
  42. #include "wand/studio.h"
  43. #include "wand/MagickWand.h"
  44. #include "wand/mogrify-private.h"
  45. #include "magick/string-private.h"
  46. /*
  47. Typedef declarations.
  48. */
  49. typedef struct _CompositeOptions
  50. {
  51. ChannelType
  52. channel;
  53. char
  54. *compose_args,
  55. *geometry;
  56. CompositeOperator
  57. compose;
  58. GravityType
  59. gravity;
  60. ssize_t
  61. stegano;
  62. RectangleInfo
  63. offset;
  64. MagickBooleanType
  65. stereo,
  66. tile;
  67. } CompositeOptions;
  68. /*
  69. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  70. % %
  71. % %
  72. % %
  73. % C o m p o s i t e I m a g e C o m m a n d %
  74. % %
  75. % %
  76. % %
  77. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  78. %
  79. % CompositeImageCommand() reads one or more images and an optional mask and
  80. % composites them into a new image.
  81. %
  82. % The format of the CompositeImageCommand method is:
  83. %
  84. % MagickBooleanType CompositeImageCommand(ImageInfo *image_info,int argc,
  85. % char **argv,char **metadata,ExceptionInfo *exception)
  86. %
  87. % A description of each parameter follows:
  88. %
  89. % o image_info: the image info.
  90. %
  91. % o argc: the number of elements in the argument vector.
  92. %
  93. % o argv: A text array containing the command line arguments.
  94. %
  95. % o metadata: any metadata is returned here.
  96. %
  97. % o exception: return any errors or warnings in this structure.
  98. %
  99. */
  100. static MagickBooleanType CompositeImageList(ImageInfo *image_info,Image **image,
  101. Image *composite_image,CompositeOptions *composite_options,
  102. ExceptionInfo *exception)
  103. {
  104. MagickStatusType
  105. status;
  106. assert(image_info != (ImageInfo *) NULL);
  107. assert(image_info->signature == MagickSignature);
  108. assert(image != (Image **) NULL);
  109. assert((*image)->signature == MagickSignature);
  110. if ((*image)->debug != MagickFalse)
  111. (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",(*image)->filename);
  112. assert(exception != (ExceptionInfo *) NULL);
  113. status=MagickTrue;
  114. if (composite_image != (Image *) NULL)
  115. {
  116. assert(composite_image->signature == MagickSignature);
  117. switch( composite_options->compose )
  118. {
  119. case BlendCompositeOp:
  120. case BlurCompositeOp:
  121. case DisplaceCompositeOp:
  122. case DistortCompositeOp:
  123. case DissolveCompositeOp:
  124. case ModulateCompositeOp:
  125. case ThresholdCompositeOp:
  126. (void) SetImageArtifact(composite_image,"compose:args",
  127. composite_options->compose_args);
  128. break;
  129. default:
  130. break;
  131. }
  132. /*
  133. Composite image.
  134. */
  135. if (composite_options->stegano != 0)
  136. {
  137. Image
  138. *stegano_image;
  139. (*image)->offset=composite_options->stegano-1;
  140. stegano_image=SteganoImage(*image,composite_image,exception);
  141. if (stegano_image != (Image *) NULL)
  142. {
  143. *image=DestroyImageList(*image);
  144. *image=stegano_image;
  145. }
  146. }
  147. else
  148. if (composite_options->stereo != MagickFalse)
  149. {
  150. Image
  151. *stereo_image;
  152. stereo_image=StereoAnaglyphImage(*image,composite_image,
  153. composite_options->offset.x,composite_options->offset.y,
  154. exception);
  155. if (stereo_image != (Image *) NULL)
  156. {
  157. *image=DestroyImageList(*image);
  158. *image=stereo_image;
  159. }
  160. }
  161. else
  162. if (composite_options->tile != MagickFalse)
  163. {
  164. ssize_t
  165. x,
  166. y;
  167. size_t
  168. columns;
  169. /*
  170. Tile the composite image.
  171. */
  172. (void) SetImageArtifact(composite_image,"compose:outside-overlay",
  173. "false");
  174. columns=composite_image->columns;
  175. for (y=0; y < (ssize_t) (*image)->rows; y+=(ssize_t) composite_image->rows)
  176. for (x=0; x < (ssize_t) (*image)->columns; x+=(ssize_t) columns)
  177. status&=CompositeImageChannel(*image,
  178. composite_options->channel,composite_options->compose,
  179. composite_image,x,y);
  180. GetImageException(*image,exception);
  181. }
  182. else
  183. {
  184. RectangleInfo
  185. geometry;
  186. /*
  187. Work out gravity Adjustment of Offset
  188. */
  189. SetGeometry(*image,&geometry);
  190. (void) ParseAbsoluteGeometry(composite_options->geometry,
  191. &geometry);
  192. geometry.width=composite_image->columns;
  193. geometry.height=composite_image->rows;
  194. GravityAdjustGeometry((*image)->columns,(*image)->rows,
  195. composite_options->gravity, &geometry);
  196. (*image)->gravity=(GravityType) composite_options->gravity;
  197. /*
  198. Digitally composite image.
  199. */
  200. status&=CompositeImageChannel(*image,composite_options->channel,
  201. composite_options->compose,composite_image,geometry.x,
  202. geometry.y);
  203. GetImageException(*image,exception);
  204. }
  205. }
  206. return(status != 0 ? MagickTrue : MagickFalse);
  207. }
  208. static MagickBooleanType CompositeUsage(void)
  209. {
  210. const char
  211. **p;
  212. static const char
  213. *miscellaneous[]=
  214. {
  215. "-debug events display copious debugging information",
  216. "-help print program options",
  217. "-list type print a list of supported option arguments",
  218. "-log format format of debugging information",
  219. "-version print version information",
  220. (char *) NULL
  221. },
  222. *operators[]=
  223. {
  224. "-blend geometry blend images",
  225. "-border geometry surround image with a border of color",
  226. "-bordercolor color border color",
  227. "-colors value preferred number of colors in the image",
  228. "-decipher filename convert cipher pixels to plain pixels",
  229. "-displace geometry shift lookup according to a relative displacement map",
  230. "-dissolve value dissolve the two images a given percent",
  231. "-distort geometry shift lookup according to a absolute distortion map",
  232. "-encipher filename convert plain pixels to cipher pixels",
  233. "-extract geometry extract area from image",
  234. "-geometry geometry location of the composite image",
  235. "-identify identify the format and characteristics of the image",
  236. "-monochrome transform image to black and white",
  237. "-negate replace every pixel with its complementary color ",
  238. "-profile filename add ICM or IPTC information profile to image",
  239. "-quantize colorspace reduce colors in this colorspace",
  240. "-repage geometry size and location of an image canvas (operator)",
  241. "-rotate degrees apply Paeth rotation to the image",
  242. "-resize geometry resize the image",
  243. "-sharpen geometry sharpen the image",
  244. "-shave geometry shave pixels from the image edges",
  245. "-stegano offset hide watermark within an image",
  246. "-stereo geometry combine two image to create a stereo anaglyph",
  247. "-strip strip image of all profiles and comments",
  248. "-thumbnail geometry create a thumbnail of the image",
  249. "-transform affine transform image",
  250. "-type type image type",
  251. "-unsharp geometry sharpen the image",
  252. "-watermark geometry percent brightness and saturation of a watermark",
  253. "-write filename write images to this file",
  254. (char *) NULL
  255. },
  256. *settings[]=
  257. {
  258. "-affine matrix affine transform matrix",
  259. "-alpha option on, activate, off, deactivate, set, opaque, copy",
  260. " transparent, extract, background, or shape",
  261. "-authenticate password",
  262. " decipher image with this password",
  263. "-blue-primary point chromaticity blue primary point",
  264. "-channel type apply option to select image channels",
  265. "-colorspace type alternate image colorspace",
  266. "-comment string annotate image with comment",
  267. "-compose operator composite operator",
  268. "-compress type type of pixel compression when writing the image",
  269. "-define format:option",
  270. " define one or more image format options",
  271. "-depth value image depth",
  272. "-density geometry horizontal and vertical density of the image",
  273. "-display server get image or font from this X server",
  274. "-dispose method layer disposal method",
  275. "-dither method apply error diffusion to image",
  276. "-encoding type text encoding type",
  277. "-endian type endianness (MSB or LSB) of the image",
  278. "-filter type use this filter when resizing an image",
  279. "-font name render text with this font",
  280. "-format \"string\" output formatted image characteristics",
  281. "-gravity type which direction to gravitate towards",
  282. "-green-primary point chromaticity green primary point",
  283. "-interlace type type of image interlacing scheme",
  284. "-interpolate method pixel color interpolation method",
  285. "-label string assign a label to an image",
  286. "-limit type value pixel cache resource limit",
  287. "-monitor monitor progress",
  288. "-page geometry size and location of an image canvas (setting)",
  289. "-pointsize value font point size",
  290. "-quality value JPEG/MIFF/PNG compression level",
  291. "-quiet suppress all warning messages",
  292. "-red-primary point chromaticity red primary point",
  293. "-regard-warnings pay attention to warning messages",
  294. "-respect-parentheses settings remain in effect until parenthesis boundary",
  295. "-sampling-factor geometry",
  296. " horizontal and vertical sampling factor",
  297. "-scene value image scene number",
  298. "-seed value seed a new sequence of pseudo-random numbers",
  299. "-size geometry width and height of image",
  300. "-transparent-color color",
  301. " transparent color",
  302. "-treedepth value color tree depth",
  303. "-tile repeat composite operation across and down image",
  304. "-units type the units of image resolution",
  305. "-verbose print detailed information about the image",
  306. "-virtual-pixel method",
  307. " virtual pixel access method",
  308. "-white-point point chromaticity white point",
  309. (char *) NULL
  310. },
  311. *stack_operators[]=
  312. {
  313. "-swap indexes swap two images in the image sequence",
  314. (char *) NULL
  315. };
  316. (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
  317. (void) printf("Copyright: %s\n",GetMagickCopyright());
  318. (void) printf("Features: %s\n\n",GetMagickFeatures());
  319. (void) printf("Usage: %s [options ...] image [options ...] composite\n"
  320. " [ [options ...] mask ] [options ...] composite\n",
  321. GetClientName());
  322. (void) printf("\nImage Settings:\n");
  323. for (p=settings; *p != (char *) NULL; p++)
  324. (void) printf(" %s\n",*p);
  325. (void) printf("\nImage Operators:\n");
  326. for (p=operators; *p != (char *) NULL; p++)
  327. (void) printf(" %s\n",*p);
  328. (void) printf("\nImage Stack Operators:\n");
  329. for (p=stack_operators; *p != (char *) NULL; p++)
  330. (void) printf(" %s\n",*p);
  331. (void) printf("\nMiscellaneous Options:\n");
  332. for (p=miscellaneous; *p != (char *) NULL; p++)
  333. (void) printf(" %s\n",*p);
  334. (void) printf(
  335. "\nBy default, the image format of `file' is determined by its magic\n");
  336. (void) printf(
  337. "number. To specify a particular image format, precede the filename\n");
  338. (void) printf(
  339. "with an image format name and a colon (i.e. ps:image) or specify the\n");
  340. (void) printf(
  341. "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
  342. (void) printf("'-' for standard input or output.\n");
  343. return(MagickFalse);
  344. }
  345. static void GetCompositeOptions(CompositeOptions *composite_options)
  346. {
  347. (void) ResetMagickMemory(composite_options,0,sizeof(*composite_options));
  348. composite_options->channel=DefaultChannels;
  349. composite_options->compose=OverCompositeOp;
  350. }
  351. static void RelinquishCompositeOptions(CompositeOptions *composite_options)
  352. {
  353. if (composite_options->compose_args != (char *) NULL)
  354. composite_options->compose_args=(char *)
  355. RelinquishMagickMemory(composite_options->compose_args);
  356. }
  357. WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
  358. int argc,char **argv,char **metadata,ExceptionInfo *exception)
  359. {
  360. #define NotInitialized (unsigned int) (~0)
  361. #define DestroyComposite() \
  362. { \
  363. RelinquishCompositeOptions(&composite_options); \
  364. DestroyImageStack(); \
  365. for (i=0; i < (ssize_t) argc; i++) \
  366. argv[i]=DestroyString(argv[i]); \
  367. argv=(char **) RelinquishMagickMemory(argv); \
  368. }
  369. #define ThrowCompositeException(asperity,tag,option) \
  370. { \
  371. (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
  372. option == (char *) NULL ? GetExceptionMessage(errno) : option); \
  373. DestroyComposite(); \
  374. return(MagickFalse); \
  375. }
  376. #define ThrowCompositeInvalidArgumentException(option,argument) \
  377. { \
  378. (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
  379. "InvalidArgument","`%s': %s",option,argument); \
  380. DestroyComposite(); \
  381. return(MagickFalse); \
  382. }
  383. char
  384. *filename,
  385. *option;
  386. CompositeOptions
  387. composite_options;
  388. const char
  389. *format;
  390. Image
  391. *composite_image,
  392. *image,
  393. *images,
  394. *mask_image;
  395. ImageStack
  396. image_stack[MaxImageStackDepth+1];
  397. MagickBooleanType
  398. fire,
  399. pend;
  400. MagickStatusType
  401. status;
  402. ssize_t
  403. j,
  404. k;
  405. register ssize_t
  406. i;
  407. /*
  408. Set default.
  409. */
  410. assert(image_info != (ImageInfo *) NULL);
  411. assert(image_info->signature == MagickSignature);
  412. if (image_info->debug != MagickFalse)
  413. (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
  414. assert(exception != (ExceptionInfo *) NULL);
  415. if (argc == 2)
  416. {
  417. option=argv[1];
  418. if ((LocaleCompare("version",option+1) == 0) ||
  419. (LocaleCompare("-version",option+1) == 0))
  420. {
  421. (void) fprintf(stdout,"Version: %s\n",
  422. GetMagickVersion((size_t *) NULL));
  423. (void) fprintf(stdout,"Copyright: %s\n",GetMagickCopyright());
  424. (void) fprintf(stdout,"Features: %s\n\n",GetMagickFeatures());
  425. return(MagickFalse);
  426. }
  427. }
  428. if (argc < 4)
  429. return(CompositeUsage());
  430. GetCompositeOptions(&composite_options);
  431. filename=(char *) NULL;
  432. format="%w,%h,%m";
  433. j=1;
  434. k=0;
  435. NewImageStack();
  436. option=(char *) NULL;
  437. pend=MagickFalse;
  438. status=MagickTrue;
  439. /*
  440. Check command syntax.
  441. */
  442. composite_image=NewImageList();
  443. image=NewImageList();
  444. mask_image=NewImageList();
  445. ReadCommandlLine(argc,&argv);
  446. status=ExpandFilenames(&argc,&argv);
  447. if (status == MagickFalse)
  448. ThrowCompositeException(ResourceLimitError,"MemoryAllocationFailed",
  449. GetExceptionMessage(errno));
  450. for (i=1; i < (ssize_t) (argc-1); i++)
  451. {
  452. option=argv[i];
  453. if (LocaleCompare(option,"(") == 0)
  454. {
  455. FireImageStack(MagickFalse,MagickTrue,pend);
  456. if (k == MaxImageStackDepth)
  457. ThrowCompositeException(OptionError,"ParenthesisNestedTooDeeply",
  458. option);
  459. PushImageStack();
  460. continue;
  461. }
  462. if (LocaleCompare(option,")") == 0)
  463. {
  464. FireImageStack(MagickFalse,MagickTrue,MagickTrue);
  465. if (k == 0)
  466. ThrowCompositeException(OptionError,"UnableToParseExpression",option);
  467. PopImageStack();
  468. continue;
  469. }
  470. if (IsMagickOption(option) == MagickFalse)
  471. {
  472. Image
  473. *images;
  474. /*
  475. Read input image.
  476. */
  477. FireImageStack(MagickFalse,MagickFalse,pend);
  478. filename=argv[i];
  479. if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
  480. filename=argv[++i];
  481. (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
  482. images=ReadImages(image_info,exception);
  483. status&=(images != (Image *) NULL) &&
  484. (exception->severity < ErrorException);
  485. if (images == (Image *) NULL)
  486. continue;
  487. AppendImageStack(images);
  488. continue;
  489. }
  490. pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
  491. switch (*(option+1))
  492. {
  493. case 'a':
  494. {
  495. if (LocaleCompare("affine",option+1) == 0)
  496. {
  497. if (*option == '+')
  498. break;
  499. i++;
  500. if (i == (ssize_t) argc)
  501. ThrowCompositeException(OptionError,"MissingArgument",option);
  502. if (IsGeometry(argv[i]) == MagickFalse)
  503. ThrowCompositeInvalidArgumentException(option,argv[i]);
  504. break;
  505. }
  506. if (LocaleCompare("alpha",option+1) == 0)
  507. {
  508. ssize_t
  509. type;
  510. if (*option == '+')
  511. break;
  512. i++;
  513. if (i == (ssize_t) argc)
  514. ThrowCompositeException(OptionError,"MissingArgument",option);
  515. type=ParseMagickOption(MagickAlphaOptions,MagickFalse,argv[i]);
  516. if (type < 0)
  517. ThrowCompositeException(OptionError,
  518. "UnrecognizedAlphaChannelType",argv[i]);
  519. break;
  520. }
  521. if (LocaleCompare("authenticate",option+1) == 0)
  522. {
  523. if (*option == '+')
  524. break;
  525. i++;
  526. if (i == (ssize_t) argc)
  527. ThrowCompositeException(OptionError,"MissingArgument",option);
  528. break;
  529. }
  530. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  531. }
  532. case 'b':
  533. {
  534. if (LocaleCompare("background",option+1) == 0)
  535. {
  536. if (*option == '+')
  537. break;
  538. i++;
  539. if (i == (ssize_t) argc)
  540. ThrowCompositeException(OptionError,"MissingArgument",option);
  541. break;
  542. }
  543. if (LocaleCompare("blend",option+1) == 0)
  544. {
  545. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  546. if (*option == '+')
  547. break;
  548. i++;
  549. if (i == (ssize_t) argc)
  550. ThrowCompositeException(OptionError,"MissingArgument",option);
  551. if (IsGeometry(argv[i]) == MagickFalse)
  552. ThrowCompositeInvalidArgumentException(option,argv[i]);
  553. (void) CloneString(&composite_options.compose_args,argv[i]);
  554. composite_options.compose=BlendCompositeOp;
  555. break;
  556. }
  557. if (LocaleCompare("blur",option+1) == 0)
  558. {
  559. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  560. if (*option == '+')
  561. break;
  562. i++;
  563. if (i == (ssize_t) argc)
  564. ThrowCompositeException(OptionError,"MissingArgument",option);
  565. if (IsGeometry(argv[i]) == MagickFalse)
  566. ThrowCompositeInvalidArgumentException(option,argv[i]);
  567. (void) CloneString(&composite_options.compose_args,argv[i]);
  568. composite_options.compose=BlurCompositeOp;
  569. break;
  570. }
  571. if (LocaleCompare("blue-primary",option+1) == 0)
  572. {
  573. if (*option == '+')
  574. break;
  575. i++;
  576. if (i == (ssize_t) argc)
  577. ThrowCompositeException(OptionError,"MissingArgument",option);
  578. if (IsGeometry(argv[i]) == MagickFalse)
  579. ThrowCompositeInvalidArgumentException(option,argv[i]);
  580. break;
  581. }
  582. if (LocaleCompare("border",option+1) == 0)
  583. {
  584. if (*option == '+')
  585. break;
  586. i++;
  587. if (i == (ssize_t) (argc-1))
  588. ThrowCompositeException(OptionError,"MissingArgument",option);
  589. if (IsGeometry(argv[i]) == MagickFalse)
  590. ThrowCompositeInvalidArgumentException(option,argv[i]);
  591. break;
  592. }
  593. if (LocaleCompare("bordercolor",option+1) == 0)
  594. {
  595. if (*option == '+')
  596. break;
  597. i++;
  598. if (i == (ssize_t) (argc-1))
  599. ThrowCompositeException(OptionError,"MissingArgument",option);
  600. break;
  601. }
  602. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  603. }
  604. case 'c':
  605. {
  606. if (LocaleCompare("cache",option+1) == 0)
  607. {
  608. if (*option == '+')
  609. break;
  610. i++;
  611. if (i == (ssize_t) argc)
  612. ThrowCompositeException(OptionError,"MissingArgument",option);
  613. if (IsGeometry(argv[i]) == MagickFalse)
  614. ThrowCompositeInvalidArgumentException(option,argv[i]);
  615. break;
  616. }
  617. if (LocaleCompare("channel",option+1) == 0)
  618. {
  619. ssize_t
  620. channel;
  621. if (*option == '+')
  622. {
  623. composite_options.channel=DefaultChannels;
  624. break;
  625. }
  626. i++;
  627. if (i == (ssize_t) (argc-1))
  628. ThrowCompositeException(OptionError,"MissingArgument",option);
  629. channel=ParseChannelOption(argv[i]);
  630. if (channel < 0)
  631. ThrowCompositeException(OptionError,"UnrecognizedChannelType",
  632. argv[i]);
  633. composite_options.channel=(ChannelType) channel;
  634. break;
  635. }
  636. if (LocaleCompare("colors",option+1) == 0)
  637. {
  638. if (*option == '+')
  639. break;
  640. i++;
  641. if (i == (ssize_t) argc)
  642. ThrowCompositeException(OptionError,"MissingArgument",option);
  643. if (IsGeometry(argv[i]) == MagickFalse)
  644. ThrowCompositeInvalidArgumentException(option,argv[i]);
  645. break;
  646. }
  647. if (LocaleCompare("colorspace",option+1) == 0)
  648. {
  649. ssize_t
  650. colorspace;
  651. if (*option == '+')
  652. break;
  653. i++;
  654. if (i == (ssize_t) argc)
  655. ThrowCompositeException(OptionError,"MissingArgument",option);
  656. colorspace=ParseMagickOption(MagickColorspaceOptions,
  657. MagickFalse,argv[i]);
  658. if (colorspace < 0)
  659. ThrowCompositeException(OptionError,"UnrecognizedColorspace",
  660. argv[i]);
  661. break;
  662. }
  663. if (LocaleCompare("comment",option+1) == 0)
  664. {
  665. if (*option == '+')
  666. break;
  667. i++;
  668. if (i == (ssize_t) argc)
  669. ThrowCompositeException(OptionError,"MissingArgument",option);
  670. break;
  671. }
  672. if (LocaleCompare("compose",option+1) == 0)
  673. {
  674. ssize_t
  675. compose;
  676. composite_options.compose=UndefinedCompositeOp;
  677. if (*option == '+')
  678. break;
  679. i++;
  680. if (i == (ssize_t) argc)
  681. ThrowCompositeException(OptionError,"MissingArgument",option);
  682. compose=ParseMagickOption(MagickComposeOptions,MagickFalse,
  683. argv[i]);
  684. if (compose < 0)
  685. ThrowCompositeException(OptionError,"UnrecognizedComposeOperator",
  686. argv[i]);
  687. composite_options.compose=(CompositeOperator) compose;
  688. break;
  689. }
  690. if (LocaleCompare("compress",option+1) == 0)
  691. {
  692. ssize_t
  693. compress;
  694. if (*option == '+')
  695. break;
  696. i++;
  697. if (i == (ssize_t) argc)
  698. ThrowCompositeException(OptionError,"MissingArgument",option);
  699. compress=ParseMagickOption(MagickCompressOptions,MagickFalse,
  700. argv[i]);
  701. if (compress < 0)
  702. ThrowCompositeException(OptionError,
  703. "UnrecognizedImageCompression",argv[i]);
  704. break;
  705. }
  706. if (LocaleCompare("concurrent",option+1) == 0)
  707. break;
  708. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  709. }
  710. case 'd':
  711. {
  712. if (LocaleCompare("debug",option+1) == 0)
  713. {
  714. ssize_t
  715. event;
  716. if (*option == '+')
  717. break;
  718. i++;
  719. if (i == (ssize_t) argc)
  720. ThrowCompositeException(OptionError,"MissingArgument",option);
  721. event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
  722. if (event < 0)
  723. ThrowCompositeException(OptionError,"UnrecognizedEventType",
  724. argv[i]);
  725. (void) SetLogEventMask(argv[i]);
  726. break;
  727. }
  728. if (LocaleCompare("decipher",option+1) == 0)
  729. {
  730. if (*option == '+')
  731. break;
  732. i++;
  733. if (i == (ssize_t) (argc-1))
  734. ThrowCompositeException(OptionError,"MissingArgument",option);
  735. break;
  736. }
  737. if (LocaleCompare("define",option+1) == 0)
  738. {
  739. i++;
  740. if (i == (ssize_t) argc)
  741. ThrowCompositeException(OptionError,"MissingArgument",option);
  742. if (*option == '+')
  743. {
  744. const char
  745. *define;
  746. define=GetImageOption(image_info,argv[i]);
  747. if (define == (const char *) NULL)
  748. ThrowCompositeException(OptionError,"NoSuchOption",argv[i]);
  749. break;
  750. }
  751. break;
  752. }
  753. if (LocaleCompare("density",option+1) == 0)
  754. {
  755. if (*option == '+')
  756. break;
  757. i++;
  758. if (i == (ssize_t) argc)
  759. ThrowCompositeException(OptionError,"MissingArgument",option);
  760. if (IsGeometry(argv[i]) == MagickFalse)
  761. ThrowCompositeInvalidArgumentException(option,argv[i]);
  762. break;
  763. }
  764. if (LocaleCompare("depth",option+1) == 0)
  765. {
  766. if (*option == '+')
  767. break;
  768. i++;
  769. if (i == (ssize_t) argc)
  770. ThrowCompositeException(OptionError,"MissingArgument",option);
  771. if (IsGeometry(argv[i]) == MagickFalse)
  772. ThrowCompositeInvalidArgumentException(option,argv[i]);
  773. break;
  774. }
  775. if (LocaleCompare("displace",option+1) == 0)
  776. {
  777. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  778. if (*option == '+')
  779. break;
  780. i++;
  781. if (i == (ssize_t) argc)
  782. ThrowCompositeException(OptionError,"MissingArgument",option);
  783. if (IsGeometry(argv[i]) == MagickFalse)
  784. ThrowCompositeInvalidArgumentException(option,argv[i]);
  785. (void) CloneString(&composite_options.compose_args,argv[i]);
  786. composite_options.compose=DisplaceCompositeOp;
  787. break;
  788. }
  789. if (LocaleCompare("display",option+1) == 0)
  790. {
  791. if (*option == '+')
  792. break;
  793. i++;
  794. if (i == (ssize_t) argc)
  795. ThrowCompositeException(OptionError,"MissingArgument",option);
  796. break;
  797. }
  798. if (LocaleCompare("dispose",option+1) == 0)
  799. {
  800. ssize_t
  801. dispose;
  802. if (*option == '+')
  803. break;
  804. i++;
  805. if (i == (ssize_t) argc)
  806. ThrowCompositeException(OptionError,"MissingArgument",option);
  807. dispose=ParseMagickOption(MagickDisposeOptions,MagickFalse,argv[i]);
  808. if (dispose < 0)
  809. ThrowCompositeException(OptionError,"UnrecognizedDisposeMethod",
  810. argv[i]);
  811. break;
  812. }
  813. if (LocaleCompare("dissolve",option+1) == 0)
  814. {
  815. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  816. if (*option == '+')
  817. break;
  818. i++;
  819. if (i == (ssize_t) argc)
  820. ThrowCompositeException(OptionError,"MissingArgument",option);
  821. if (IsGeometry(argv[i]) == MagickFalse)
  822. ThrowCompositeInvalidArgumentException(option,argv[i]);
  823. (void) CloneString(&composite_options.compose_args,argv[i]);
  824. composite_options.compose=DissolveCompositeOp;
  825. break;
  826. }
  827. if (LocaleCompare("distort",option+1) == 0)
  828. {
  829. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  830. if (*option == '+')
  831. break;
  832. i++;
  833. if (i == (ssize_t) argc)
  834. ThrowCompositeException(OptionError,"MissingArgument",option);
  835. if (IsGeometry(argv[i]) == MagickFalse)
  836. ThrowCompositeInvalidArgumentException(option,argv[i]);
  837. (void) CloneString(&composite_options.compose_args,argv[i]);
  838. composite_options.compose=DistortCompositeOp;
  839. break;
  840. }
  841. if (LocaleCompare("dither",option+1) == 0)
  842. {
  843. ssize_t
  844. method;
  845. if (*option == '+')
  846. break;
  847. i++;
  848. if (i == (ssize_t) argc)
  849. ThrowCompositeException(OptionError,"MissingArgument",option);
  850. method=ParseMagickOption(MagickDitherOptions,MagickFalse,argv[i]);
  851. if (method < 0)
  852. ThrowCompositeException(OptionError,"UnrecognizedDitherMethod",
  853. argv[i]);
  854. break;
  855. }
  856. if (LocaleCompare("duration",option+1) == 0)
  857. {
  858. if (*option == '+')
  859. break;
  860. i++;
  861. if (i == (ssize_t) (argc-1))
  862. ThrowCompositeException(OptionError,"MissingArgument",option);
  863. if (IsGeometry(argv[i]) == MagickFalse)
  864. ThrowCompositeInvalidArgumentException(option,argv[i]);
  865. break;
  866. }
  867. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  868. }
  869. case 'e':
  870. {
  871. if (LocaleCompare("encipher",option+1) == 0)
  872. {
  873. if (*option == '+')
  874. break;
  875. i++;
  876. if (i == (ssize_t) (argc-1))
  877. ThrowCompositeException(OptionError,"MissingArgument",option);
  878. break;
  879. }
  880. if (LocaleCompare("encoding",option+1) == 0)
  881. {
  882. if (*option == '+')
  883. break;
  884. i++;
  885. if (i == (ssize_t) argc)
  886. ThrowCompositeException(OptionError,"MissingArgument",option);
  887. break;
  888. }
  889. if (LocaleCompare("endian",option+1) == 0)
  890. {
  891. ssize_t
  892. endian;
  893. if (*option == '+')
  894. break;
  895. i++;
  896. if (i == (ssize_t) argc)
  897. ThrowCompositeException(OptionError,"MissingArgument",option);
  898. endian=ParseMagickOption(MagickEndianOptions,MagickFalse,
  899. argv[i]);
  900. if (endian < 0)
  901. ThrowCompositeException(OptionError,"UnrecognizedEndianType",
  902. argv[i]);
  903. break;
  904. }
  905. if (LocaleCompare("extract",option+1) == 0)
  906. {
  907. if (*option == '+')
  908. break;
  909. i++;
  910. if (i == (ssize_t) argc)
  911. ThrowCompositeException(OptionError,"MissingArgument",option);
  912. if (IsGeometry(argv[i]) == MagickFalse)
  913. ThrowCompositeInvalidArgumentException(option,argv[i]);
  914. break;
  915. }
  916. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  917. }
  918. case 'f':
  919. {
  920. if (LocaleCompare("filter",option+1) == 0)
  921. {
  922. ssize_t
  923. filter;
  924. if (*option == '+')
  925. break;
  926. i++;
  927. if (i == (ssize_t) argc)
  928. ThrowCompositeException(OptionError,"MissingArgument",option);
  929. filter=ParseMagickOption(MagickFilterOptions,MagickFalse,argv[i]);
  930. if (filter < 0)
  931. ThrowCompositeException(OptionError,"UnrecognizedImageFilter",
  932. argv[i]);
  933. break;
  934. }
  935. if (LocaleCompare("font",option+1) == 0)
  936. {
  937. if (*option == '+')
  938. break;
  939. i++;
  940. if (i == (ssize_t) argc)
  941. ThrowCompositeException(OptionError,"MissingArgument",option);
  942. break;
  943. }
  944. if (LocaleCompare("format",option+1) == 0)
  945. {
  946. if (*option == '+')
  947. break;
  948. i++;
  949. if (i == (ssize_t) argc)
  950. ThrowCompositeException(OptionError,"MissingArgument",option);
  951. format=argv[i];
  952. break;
  953. }
  954. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  955. }
  956. case 'g':
  957. {
  958. if (LocaleCompare("geometry",option+1) == 0)
  959. {
  960. (void) CloneString(&composite_options.geometry,(char *) NULL);
  961. if (*option == '+')
  962. break;
  963. i++;
  964. if (i == (ssize_t) argc)
  965. ThrowCompositeException(OptionError,"MissingArgument",option);
  966. if (IsGeometry(argv[i]) == MagickFalse)
  967. ThrowCompositeInvalidArgumentException(option,argv[i]);
  968. (void) CloneString(&composite_options.geometry,argv[i]);
  969. break;
  970. }
  971. if (LocaleCompare("gravity",option+1) == 0)
  972. {
  973. ssize_t
  974. gravity;
  975. composite_options.gravity=UndefinedGravity;
  976. if (*option == '+')
  977. break;
  978. i++;
  979. if (i == (ssize_t) argc)
  980. ThrowCompositeException(OptionError,"MissingArgument",option);
  981. gravity=ParseMagickOption(MagickGravityOptions,MagickFalse,
  982. argv[i]);
  983. if (gravity < 0)
  984. ThrowCompositeException(OptionError,"UnrecognizedGravityType",
  985. argv[i]);
  986. composite_options.gravity=(GravityType) gravity;
  987. break;
  988. }
  989. if (LocaleCompare("green-primary",option+1) == 0)
  990. {
  991. if (*option == '+')
  992. break;
  993. i++;
  994. if (i == (ssize_t) argc)
  995. ThrowCompositeException(OptionError,"MissingArgument",option);
  996. if (IsGeometry(argv[i]) == MagickFalse)
  997. ThrowCompositeInvalidArgumentException(option,argv[i]);
  998. break;
  999. }
  1000. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1001. }
  1002. case 'h':
  1003. {
  1004. if ((LocaleCompare("help",option+1) == 0) ||
  1005. (LocaleCompare("-help",option+1) == 0))
  1006. return(CompositeUsage());
  1007. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1008. }
  1009. case 'i':
  1010. {
  1011. if (LocaleCompare("identify",option+1) == 0)
  1012. break;
  1013. if (LocaleCompare("interlace",option+1) == 0)
  1014. {
  1015. ssize_t
  1016. interlace;
  1017. if (*option == '+')
  1018. break;
  1019. i++;
  1020. if (i == (ssize_t) argc)
  1021. ThrowCompositeException(OptionError,"MissingArgument",option);
  1022. interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
  1023. argv[i]);
  1024. if (interlace < 0)
  1025. ThrowCompositeException(OptionError,
  1026. "UnrecognizedInterlaceType",argv[i]);
  1027. break;
  1028. }
  1029. if (LocaleCompare("interpolate",option+1) == 0)
  1030. {
  1031. ssize_t
  1032. interpolate;
  1033. if (*option == '+')
  1034. break;
  1035. i++;
  1036. if (i == (ssize_t) argc)
  1037. ThrowCompositeException(OptionError,"MissingArgument",option);
  1038. interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
  1039. argv[i]);
  1040. if (interpolate < 0)
  1041. ThrowCompositeException(OptionError,
  1042. "UnrecognizedInterpolateMethod",argv[i]);
  1043. break;
  1044. }
  1045. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1046. }
  1047. case 'l':
  1048. {
  1049. if (LocaleCompare("label",option+1) == 0)
  1050. {
  1051. if (*option == '+')
  1052. break;
  1053. i++;
  1054. if (i == (ssize_t) argc)
  1055. ThrowCompositeException(OptionError,"MissingArgument",option);
  1056. break;
  1057. }
  1058. if (LocaleCompare("limit",option+1) == 0)
  1059. {
  1060. char
  1061. *p;
  1062. double
  1063. value;
  1064. ssize_t
  1065. resource;
  1066. if (*option == '+')
  1067. break;
  1068. i++;
  1069. if (i == (ssize_t) argc)
  1070. ThrowCompositeException(OptionError,"MissingArgument",option);
  1071. resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
  1072. argv[i]);
  1073. if (resource < 0)
  1074. ThrowCompositeException(OptionError,"UnrecognizedResourceType",
  1075. argv[i]);
  1076. i++;
  1077. if (i == (ssize_t) argc)
  1078. ThrowCompositeException(OptionError,"MissingArgument",option);
  1079. value=strtod(argv[i],&p);
  1080. if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
  1081. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1082. break;
  1083. }
  1084. if (LocaleCompare("list",option+1) == 0)
  1085. {
  1086. ssize_t
  1087. list;
  1088. if (*option == '+')
  1089. break;
  1090. i++;
  1091. if (i == (ssize_t) argc)
  1092. ThrowCompositeException(OptionError,"MissingArgument",option);
  1093. list=ParseMagickOption(MagickListOptions,MagickFalse,argv[i]);
  1094. if (list < 0)
  1095. ThrowCompositeException(OptionError,"UnrecognizedListType",
  1096. argv[i]);
  1097. status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
  1098. argv+j,exception);
  1099. DestroyComposite();
  1100. return(status != 0 ? MagickFalse : MagickTrue);
  1101. }
  1102. if (LocaleCompare("log",option+1) == 0)
  1103. {
  1104. if (*option == '+')
  1105. break;
  1106. i++;
  1107. if ((i == (ssize_t) argc) || (strchr(argv[i],'%') == (char *) NULL))
  1108. ThrowCompositeException(OptionError,"MissingArgument",option);
  1109. break;
  1110. }
  1111. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1112. }
  1113. case 'm':
  1114. {
  1115. if (LocaleCompare("matte",option+1) == 0)
  1116. break;
  1117. if (LocaleCompare("monitor",option+1) == 0)
  1118. break;
  1119. if (LocaleCompare("monochrome",option+1) == 0)
  1120. break;
  1121. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1122. }
  1123. case 'n':
  1124. {
  1125. if (LocaleCompare("negate",option+1) == 0)
  1126. break;
  1127. if (LocaleCompare("noop",option+1) == 0)
  1128. break;
  1129. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1130. }
  1131. case 'p':
  1132. {
  1133. if (LocaleCompare("page",option+1) == 0)
  1134. {
  1135. if (*option == '+')
  1136. break;
  1137. i++;
  1138. if (i == (ssize_t) argc)
  1139. ThrowCompositeException(OptionError,"MissingArgument",option);
  1140. break;
  1141. }
  1142. if (LocaleCompare("pointsize",option+1) == 0)
  1143. {
  1144. if (*option == '+')
  1145. break;
  1146. i++;
  1147. if (i == (ssize_t) (argc-1))
  1148. ThrowCompositeException(OptionError,"MissingArgument",option);
  1149. if (IsGeometry(argv[i]) == MagickFalse)
  1150. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1151. break;
  1152. }
  1153. if (LocaleCompare("process",option+1) == 0)
  1154. {
  1155. if (*option == '+')
  1156. break;
  1157. i++;
  1158. if (i == (ssize_t) argc)
  1159. ThrowCompositeException(OptionError,"MissingArgument",option);
  1160. break;
  1161. }
  1162. if (LocaleCompare("profile",option+1) == 0)
  1163. {
  1164. i++;
  1165. if (i == (ssize_t) argc)
  1166. ThrowCompositeException(OptionError,"MissingArgument",option);
  1167. break;
  1168. }
  1169. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1170. }
  1171. case 'q':
  1172. {
  1173. if (LocaleCompare("quality",option+1) == 0)
  1174. {
  1175. if (*option == '+')
  1176. break;
  1177. i++;
  1178. if (i == (ssize_t) argc)
  1179. ThrowCompositeException(OptionError,"MissingArgument",option);
  1180. if (IsGeometry(argv[i]) == MagickFalse)
  1181. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1182. break;
  1183. }
  1184. if (LocaleCompare("quantize",option+1) == 0)
  1185. {
  1186. ssize_t
  1187. colorspace;
  1188. if (*option == '+')
  1189. break;
  1190. i++;
  1191. if (i == (ssize_t) (argc-1))
  1192. ThrowCompositeException(OptionError,"MissingArgument",option);
  1193. colorspace=ParseMagickOption(MagickColorspaceOptions,
  1194. MagickFalse,argv[i]);
  1195. if (colorspace < 0)
  1196. ThrowCompositeException(OptionError,"UnrecognizedColorspace",
  1197. argv[i]);
  1198. break;
  1199. }
  1200. if (LocaleCompare("quiet",option+1) == 0)
  1201. break;
  1202. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1203. }
  1204. case 'r':
  1205. {
  1206. if (LocaleCompare("red-primary",option+1) == 0)
  1207. {
  1208. if (*option == '+')
  1209. break;
  1210. i++;
  1211. if (i == (ssize_t) argc)
  1212. ThrowCompositeException(OptionError,"MissingArgument",option);
  1213. if (IsGeometry(argv[i]) == MagickFalse)
  1214. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1215. break;
  1216. }
  1217. if (LocaleCompare("regard-warnings",option+1) == 0)
  1218. break;
  1219. if (LocaleCompare("render",option+1) == 0)
  1220. break;
  1221. if (LocaleCompare("repage",option+1) == 0)
  1222. {
  1223. if (*option == '+')
  1224. break;
  1225. i++;
  1226. if (i == (ssize_t) argc)
  1227. ThrowCompositeException(OptionError,"MissingArgument",option);
  1228. if (IsGeometry(argv[i]) == MagickFalse)
  1229. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1230. break;
  1231. }
  1232. if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
  1233. {
  1234. respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
  1235. break;
  1236. }
  1237. if (LocaleCompare("resize",option+1) == 0)
  1238. {
  1239. if (*option == '+')
  1240. break;
  1241. i++;
  1242. if (i == (ssize_t) argc)
  1243. ThrowCompositeException(OptionError,"MissingArgument",option);
  1244. if (IsGeometry(argv[i]) == MagickFalse)
  1245. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1246. break;
  1247. }
  1248. if (LocaleCompare("rotate",option+1) == 0)
  1249. {
  1250. i++;
  1251. if (i == (ssize_t) argc)
  1252. ThrowCompositeException(OptionError,"MissingArgument",option);
  1253. if (IsGeometry(argv[i]) == MagickFalse)
  1254. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1255. break;
  1256. }
  1257. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1258. }
  1259. case 's':
  1260. {
  1261. if (LocaleCompare("sampling-factor",option+1) == 0)
  1262. {
  1263. if (*option == '+')
  1264. break;
  1265. i++;
  1266. if (i == (ssize_t) argc)
  1267. ThrowCompositeException(OptionError,"MissingArgument",option);
  1268. if (IsGeometry(argv[i]) == MagickFalse)
  1269. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1270. break;
  1271. }
  1272. if (LocaleCompare("scene",option+1) == 0)
  1273. {
  1274. if (*option == '+')
  1275. break;
  1276. i++;
  1277. if (i == (ssize_t) argc)
  1278. ThrowCompositeException(OptionError,"MissingArgument",option);
  1279. if (IsGeometry(argv[i]) == MagickFalse)
  1280. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1281. break;
  1282. }
  1283. if (LocaleCompare("seed",option+1) == 0)
  1284. {
  1285. if (*option == '+')
  1286. break;
  1287. i++;
  1288. if (i == (ssize_t) (argc-1))
  1289. ThrowCompositeException(OptionError,"MissingArgument",option);
  1290. if (IsGeometry(argv[i]) == MagickFalse)
  1291. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1292. break;
  1293. }
  1294. if (LocaleCompare("sharpen",option+1) == 0)
  1295. {
  1296. i++;
  1297. if (i == (ssize_t) argc)
  1298. ThrowCompositeException(OptionError,"MissingArgument",option);
  1299. if (IsGeometry(argv[i]) == MagickFalse)
  1300. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1301. break;
  1302. }
  1303. if (LocaleCompare("shave",option+1) == 0)
  1304. {
  1305. if (*option == '+')
  1306. break;
  1307. i++;
  1308. if (i == (ssize_t) (argc-1))
  1309. ThrowCompositeException(OptionError,"MissingArgument",option);
  1310. if (IsGeometry(argv[i]) == MagickFalse)
  1311. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1312. break;
  1313. }
  1314. if (LocaleCompare("size",option+1) == 0)
  1315. {
  1316. if (*option == '+')
  1317. break;
  1318. i++;
  1319. if (i == (ssize_t) argc)
  1320. ThrowCompositeException(OptionError,"MissingArgument",option);
  1321. if (IsGeometry(argv[i]) == MagickFalse)
  1322. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1323. break;
  1324. }
  1325. if (LocaleCompare("stegano",option+1) == 0)
  1326. {
  1327. composite_options.stegano=0;
  1328. if (*option == '+')
  1329. break;
  1330. i++;
  1331. if (i == (ssize_t) argc)
  1332. ThrowCompositeException(OptionError,"MissingArgument",option);
  1333. if (IsGeometry(argv[i]) == MagickFalse)
  1334. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1335. composite_options.stegano=StringToLong(argv[i])+1;
  1336. break;
  1337. }
  1338. if (LocaleCompare("stereo",option+1) == 0)
  1339. {
  1340. MagickStatusType
  1341. flags;
  1342. composite_options.stereo=MagickFalse;
  1343. if (*opt

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