PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/wand/composite.c

http://github.com/idaunis/binarytiers
C | 1673 lines | 1509 code | 55 blank | 109 comment | 667 complexity | 2c87743d1341dd13aad1ee949f8e2df3 MD5 | raw file

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-2011 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. "-synchronize synchronize image to storage device",
  301. "-taint declare the image as modified",
  302. "-transparent-color color",
  303. " transparent color",
  304. "-treedepth value color tree depth",
  305. "-tile repeat composite operation across and down image",
  306. "-units type the units of image resolution",
  307. "-verbose print detailed information about the image",
  308. "-virtual-pixel method",
  309. " virtual pixel access method",
  310. "-white-point point chromaticity white point",
  311. (char *) NULL
  312. },
  313. *stack_operators[]=
  314. {
  315. "-swap indexes swap two images in the image sequence",
  316. (char *) NULL
  317. };
  318. (void) printf("Version: %s\n",GetMagickVersion((size_t *) NULL));
  319. (void) printf("Copyright: %s\n",GetMagickCopyright());
  320. (void) printf("Features: %s\n\n",GetMagickFeatures());
  321. (void) printf("Usage: %s [options ...] image [options ...] composite\n"
  322. " [ [options ...] mask ] [options ...] composite\n",
  323. GetClientName());
  324. (void) printf("\nImage Settings:\n");
  325. for (p=settings; *p != (char *) NULL; p++)
  326. (void) printf(" %s\n",*p);
  327. (void) printf("\nImage Operators:\n");
  328. for (p=operators; *p != (char *) NULL; p++)
  329. (void) printf(" %s\n",*p);
  330. (void) printf("\nImage Stack Operators:\n");
  331. for (p=stack_operators; *p != (char *) NULL; p++)
  332. (void) printf(" %s\n",*p);
  333. (void) printf("\nMiscellaneous Options:\n");
  334. for (p=miscellaneous; *p != (char *) NULL; p++)
  335. (void) printf(" %s\n",*p);
  336. (void) printf(
  337. "\nBy default, the image format of `file' is determined by its magic\n");
  338. (void) printf(
  339. "number. To specify a particular image format, precede the filename\n");
  340. (void) printf(
  341. "with an image format name and a colon (i.e. ps:image) or specify the\n");
  342. (void) printf(
  343. "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
  344. (void) printf("'-' for standard input or output.\n");
  345. return(MagickFalse);
  346. }
  347. static void GetCompositeOptions(CompositeOptions *composite_options)
  348. {
  349. (void) ResetMagickMemory(composite_options,0,sizeof(*composite_options));
  350. composite_options->channel=DefaultChannels;
  351. composite_options->compose=OverCompositeOp;
  352. }
  353. static void RelinquishCompositeOptions(CompositeOptions *composite_options)
  354. {
  355. if (composite_options->compose_args != (char *) NULL)
  356. composite_options->compose_args=(char *)
  357. RelinquishMagickMemory(composite_options->compose_args);
  358. }
  359. WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
  360. int argc,char **argv,char **metadata,ExceptionInfo *exception)
  361. {
  362. #define NotInitialized (unsigned int) (~0)
  363. #define DestroyComposite() \
  364. { \
  365. RelinquishCompositeOptions(&composite_options); \
  366. DestroyImageStack(); \
  367. for (i=0; i < (ssize_t) argc; i++) \
  368. argv[i]=DestroyString(argv[i]); \
  369. argv=(char **) RelinquishMagickMemory(argv); \
  370. }
  371. #define ThrowCompositeException(asperity,tag,option) \
  372. { \
  373. (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
  374. option == (char *) NULL ? GetExceptionMessage(errno) : option); \
  375. DestroyComposite(); \
  376. return(MagickFalse); \
  377. }
  378. #define ThrowCompositeInvalidArgumentException(option,argument) \
  379. { \
  380. (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
  381. "InvalidArgument","`%s': %s",option,argument); \
  382. DestroyComposite(); \
  383. return(MagickFalse); \
  384. }
  385. char
  386. *filename,
  387. *option;
  388. CompositeOptions
  389. composite_options;
  390. const char
  391. *format;
  392. Image
  393. *composite_image,
  394. *image,
  395. *images,
  396. *mask_image;
  397. ImageStack
  398. image_stack[MaxImageStackDepth+1];
  399. MagickBooleanType
  400. fire,
  401. pend,
  402. respect_parenthesis;
  403. MagickStatusType
  404. status;
  405. ssize_t
  406. j,
  407. k;
  408. register ssize_t
  409. i;
  410. /*
  411. Set default.
  412. */
  413. assert(image_info != (ImageInfo *) NULL);
  414. assert(image_info->signature == MagickSignature);
  415. if (image_info->debug != MagickFalse)
  416. (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
  417. assert(exception != (ExceptionInfo *) NULL);
  418. if (argc == 2)
  419. {
  420. option=argv[1];
  421. if ((LocaleCompare("version",option+1) == 0) ||
  422. (LocaleCompare("-version",option+1) == 0))
  423. {
  424. (void) fprintf(stdout,"Version: %s\n",
  425. GetMagickVersion((size_t *) NULL));
  426. (void) fprintf(stdout,"Copyright: %s\n",GetMagickCopyright());
  427. (void) fprintf(stdout,"Features: %s\n\n",GetMagickFeatures());
  428. return(MagickFalse);
  429. }
  430. }
  431. if (argc < 4)
  432. return(CompositeUsage());
  433. GetCompositeOptions(&composite_options);
  434. filename=(char *) NULL;
  435. format="%w,%h,%m";
  436. j=1;
  437. k=0;
  438. NewImageStack();
  439. option=(char *) NULL;
  440. pend=MagickFalse;
  441. respect_parenthesis=MagickFalse;
  442. status=MagickTrue;
  443. /*
  444. Check command syntax.
  445. */
  446. composite_image=NewImageList();
  447. image=NewImageList();
  448. mask_image=NewImageList();
  449. ReadCommandlLine(argc,&argv);
  450. status=ExpandFilenames(&argc,&argv);
  451. if (status == MagickFalse)
  452. ThrowCompositeException(ResourceLimitError,"MemoryAllocationFailed",
  453. GetExceptionMessage(errno));
  454. for (i=1; i < (ssize_t) (argc-1); i++)
  455. {
  456. option=argv[i];
  457. if (LocaleCompare(option,"(") == 0)
  458. {
  459. FireImageStack(MagickFalse,MagickTrue,pend);
  460. if (k == MaxImageStackDepth)
  461. ThrowCompositeException(OptionError,"ParenthesisNestedTooDeeply",
  462. option);
  463. PushImageStack();
  464. continue;
  465. }
  466. if (LocaleCompare(option,")") == 0)
  467. {
  468. FireImageStack(MagickFalse,MagickTrue,MagickTrue);
  469. if (k == 0)
  470. ThrowCompositeException(OptionError,"UnableToParseExpression",option);
  471. PopImageStack();
  472. continue;
  473. }
  474. if (IsMagickOption(option) == MagickFalse)
  475. {
  476. Image
  477. *images;
  478. /*
  479. Read input image.
  480. */
  481. FireImageStack(MagickFalse,MagickFalse,pend);
  482. filename=argv[i];
  483. if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
  484. filename=argv[++i];
  485. (void) CopyMagickString(image_info->filename,filename,MaxTextExtent);
  486. images=ReadImages(image_info,exception);
  487. status&=(images != (Image *) NULL) &&
  488. (exception->severity < ErrorException);
  489. if (images == (Image *) NULL)
  490. continue;
  491. AppendImageStack(images);
  492. continue;
  493. }
  494. pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
  495. switch (*(option+1))
  496. {
  497. case 'a':
  498. {
  499. if (LocaleCompare("affine",option+1) == 0)
  500. {
  501. if (*option == '+')
  502. break;
  503. i++;
  504. if (i == (ssize_t) argc)
  505. ThrowCompositeException(OptionError,"MissingArgument",option);
  506. if (IsGeometry(argv[i]) == MagickFalse)
  507. ThrowCompositeInvalidArgumentException(option,argv[i]);
  508. break;
  509. }
  510. if (LocaleCompare("alpha",option+1) == 0)
  511. {
  512. ssize_t
  513. type;
  514. if (*option == '+')
  515. break;
  516. i++;
  517. if (i == (ssize_t) argc)
  518. ThrowCompositeException(OptionError,"MissingArgument",option);
  519. type=ParseMagickOption(MagickAlphaOptions,MagickFalse,argv[i]);
  520. if (type < 0)
  521. ThrowCompositeException(OptionError,
  522. "UnrecognizedAlphaChannelType",argv[i]);
  523. break;
  524. }
  525. if (LocaleCompare("authenticate",option+1) == 0)
  526. {
  527. if (*option == '+')
  528. break;
  529. i++;
  530. if (i == (ssize_t) argc)
  531. ThrowCompositeException(OptionError,"MissingArgument",option);
  532. break;
  533. }
  534. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  535. }
  536. case 'b':
  537. {
  538. if (LocaleCompare("background",option+1) == 0)
  539. {
  540. if (*option == '+')
  541. break;
  542. i++;
  543. if (i == (ssize_t) argc)
  544. ThrowCompositeException(OptionError,"MissingArgument",option);
  545. break;
  546. }
  547. if (LocaleCompare("blend",option+1) == 0)
  548. {
  549. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  550. if (*option == '+')
  551. break;
  552. i++;
  553. if (i == (ssize_t) argc)
  554. ThrowCompositeException(OptionError,"MissingArgument",option);
  555. if (IsGeometry(argv[i]) == MagickFalse)
  556. ThrowCompositeInvalidArgumentException(option,argv[i]);
  557. (void) CloneString(&composite_options.compose_args,argv[i]);
  558. composite_options.compose=BlendCompositeOp;
  559. break;
  560. }
  561. if (LocaleCompare("blur",option+1) == 0)
  562. {
  563. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  564. if (*option == '+')
  565. break;
  566. i++;
  567. if (i == (ssize_t) argc)
  568. ThrowCompositeException(OptionError,"MissingArgument",option);
  569. if (IsGeometry(argv[i]) == MagickFalse)
  570. ThrowCompositeInvalidArgumentException(option,argv[i]);
  571. (void) CloneString(&composite_options.compose_args,argv[i]);
  572. composite_options.compose=BlurCompositeOp;
  573. break;
  574. }
  575. if (LocaleCompare("blue-primary",option+1) == 0)
  576. {
  577. if (*option == '+')
  578. break;
  579. i++;
  580. if (i == (ssize_t) argc)
  581. ThrowCompositeException(OptionError,"MissingArgument",option);
  582. if (IsGeometry(argv[i]) == MagickFalse)
  583. ThrowCompositeInvalidArgumentException(option,argv[i]);
  584. break;
  585. }
  586. if (LocaleCompare("border",option+1) == 0)
  587. {
  588. if (*option == '+')
  589. break;
  590. i++;
  591. if (i == (ssize_t) (argc-1))
  592. ThrowCompositeException(OptionError,"MissingArgument",option);
  593. if (IsGeometry(argv[i]) == MagickFalse)
  594. ThrowCompositeInvalidArgumentException(option,argv[i]);
  595. break;
  596. }
  597. if (LocaleCompare("bordercolor",option+1) == 0)
  598. {
  599. if (*option == '+')
  600. break;
  601. i++;
  602. if (i == (ssize_t) (argc-1))
  603. ThrowCompositeException(OptionError,"MissingArgument",option);
  604. break;
  605. }
  606. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  607. }
  608. case 'c':
  609. {
  610. if (LocaleCompare("cache",option+1) == 0)
  611. {
  612. if (*option == '+')
  613. break;
  614. i++;
  615. if (i == (ssize_t) argc)
  616. ThrowCompositeException(OptionError,"MissingArgument",option);
  617. if (IsGeometry(argv[i]) == MagickFalse)
  618. ThrowCompositeInvalidArgumentException(option,argv[i]);
  619. break;
  620. }
  621. if (LocaleCompare("channel",option+1) == 0)
  622. {
  623. ssize_t
  624. channel;
  625. if (*option == '+')
  626. {
  627. composite_options.channel=DefaultChannels;
  628. break;
  629. }
  630. i++;
  631. if (i == (ssize_t) (argc-1))
  632. ThrowCompositeException(OptionError,"MissingArgument",option);
  633. channel=ParseChannelOption(argv[i]);
  634. if (channel < 0)
  635. ThrowCompositeException(OptionError,"UnrecognizedChannelType",
  636. argv[i]);
  637. composite_options.channel=(ChannelType) channel;
  638. break;
  639. }
  640. if (LocaleCompare("colors",option+1) == 0)
  641. {
  642. if (*option == '+')
  643. break;
  644. i++;
  645. if (i == (ssize_t) argc)
  646. ThrowCompositeException(OptionError,"MissingArgument",option);
  647. if (IsGeometry(argv[i]) == MagickFalse)
  648. ThrowCompositeInvalidArgumentException(option,argv[i]);
  649. break;
  650. }
  651. if (LocaleCompare("colorspace",option+1) == 0)
  652. {
  653. ssize_t
  654. colorspace;
  655. if (*option == '+')
  656. break;
  657. i++;
  658. if (i == (ssize_t) argc)
  659. ThrowCompositeException(OptionError,"MissingArgument",option);
  660. colorspace=ParseMagickOption(MagickColorspaceOptions,
  661. MagickFalse,argv[i]);
  662. if (colorspace < 0)
  663. ThrowCompositeException(OptionError,"UnrecognizedColorspace",
  664. argv[i]);
  665. break;
  666. }
  667. if (LocaleCompare("comment",option+1) == 0)
  668. {
  669. if (*option == '+')
  670. break;
  671. i++;
  672. if (i == (ssize_t) argc)
  673. ThrowCompositeException(OptionError,"MissingArgument",option);
  674. break;
  675. }
  676. if (LocaleCompare("compose",option+1) == 0)
  677. {
  678. ssize_t
  679. compose;
  680. composite_options.compose=UndefinedCompositeOp;
  681. if (*option == '+')
  682. break;
  683. i++;
  684. if (i == (ssize_t) argc)
  685. ThrowCompositeException(OptionError,"MissingArgument",option);
  686. compose=ParseMagickOption(MagickComposeOptions,MagickFalse,
  687. argv[i]);
  688. if (compose < 0)
  689. ThrowCompositeException(OptionError,"UnrecognizedComposeOperator",
  690. argv[i]);
  691. composite_options.compose=(CompositeOperator) compose;
  692. break;
  693. }
  694. if (LocaleCompare("compress",option+1) == 0)
  695. {
  696. ssize_t
  697. compress;
  698. if (*option == '+')
  699. break;
  700. i++;
  701. if (i == (ssize_t) argc)
  702. ThrowCompositeException(OptionError,"MissingArgument",option);
  703. compress=ParseMagickOption(MagickCompressOptions,MagickFalse,
  704. argv[i]);
  705. if (compress < 0)
  706. ThrowCompositeException(OptionError,
  707. "UnrecognizedImageCompression",argv[i]);
  708. break;
  709. }
  710. if (LocaleCompare("concurrent",option+1) == 0)
  711. break;
  712. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  713. }
  714. case 'd':
  715. {
  716. if (LocaleCompare("debug",option+1) == 0)
  717. {
  718. ssize_t
  719. event;
  720. if (*option == '+')
  721. break;
  722. i++;
  723. if (i == (ssize_t) argc)
  724. ThrowCompositeException(OptionError,"MissingArgument",option);
  725. event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
  726. if (event < 0)
  727. ThrowCompositeException(OptionError,"UnrecognizedEventType",
  728. argv[i]);
  729. (void) SetLogEventMask(argv[i]);
  730. break;
  731. }
  732. if (LocaleCompare("decipher",option+1) == 0)
  733. {
  734. if (*option == '+')
  735. break;
  736. i++;
  737. if (i == (ssize_t) (argc-1))
  738. ThrowCompositeException(OptionError,"MissingArgument",option);
  739. break;
  740. }
  741. if (LocaleCompare("define",option+1) == 0)
  742. {
  743. i++;
  744. if (i == (ssize_t) argc)
  745. ThrowCompositeException(OptionError,"MissingArgument",option);
  746. if (*option == '+')
  747. {
  748. const char
  749. *define;
  750. define=GetImageOption(image_info,argv[i]);
  751. if (define == (const char *) NULL)
  752. ThrowCompositeException(OptionError,"NoSuchOption",argv[i]);
  753. break;
  754. }
  755. break;
  756. }
  757. if (LocaleCompare("density",option+1) == 0)
  758. {
  759. if (*option == '+')
  760. break;
  761. i++;
  762. if (i == (ssize_t) argc)
  763. ThrowCompositeException(OptionError,"MissingArgument",option);
  764. if (IsGeometry(argv[i]) == MagickFalse)
  765. ThrowCompositeInvalidArgumentException(option,argv[i]);
  766. break;
  767. }
  768. if (LocaleCompare("depth",option+1) == 0)
  769. {
  770. if (*option == '+')
  771. break;
  772. i++;
  773. if (i == (ssize_t) argc)
  774. ThrowCompositeException(OptionError,"MissingArgument",option);
  775. if (IsGeometry(argv[i]) == MagickFalse)
  776. ThrowCompositeInvalidArgumentException(option,argv[i]);
  777. break;
  778. }
  779. if (LocaleCompare("displace",option+1) == 0)
  780. {
  781. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  782. if (*option == '+')
  783. break;
  784. i++;
  785. if (i == (ssize_t) argc)
  786. ThrowCompositeException(OptionError,"MissingArgument",option);
  787. if (IsGeometry(argv[i]) == MagickFalse)
  788. ThrowCompositeInvalidArgumentException(option,argv[i]);
  789. (void) CloneString(&composite_options.compose_args,argv[i]);
  790. composite_options.compose=DisplaceCompositeOp;
  791. break;
  792. }
  793. if (LocaleCompare("display",option+1) == 0)
  794. {
  795. if (*option == '+')
  796. break;
  797. i++;
  798. if (i == (ssize_t) argc)
  799. ThrowCompositeException(OptionError,"MissingArgument",option);
  800. break;
  801. }
  802. if (LocaleCompare("dispose",option+1) == 0)
  803. {
  804. ssize_t
  805. dispose;
  806. if (*option == '+')
  807. break;
  808. i++;
  809. if (i == (ssize_t) argc)
  810. ThrowCompositeException(OptionError,"MissingArgument",option);
  811. dispose=ParseMagickOption(MagickDisposeOptions,MagickFalse,argv[i]);
  812. if (dispose < 0)
  813. ThrowCompositeException(OptionError,"UnrecognizedDisposeMethod",
  814. argv[i]);
  815. break;
  816. }
  817. if (LocaleCompare("dissolve",option+1) == 0)
  818. {
  819. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  820. if (*option == '+')
  821. break;
  822. i++;
  823. if (i == (ssize_t) argc)
  824. ThrowCompositeException(OptionError,"MissingArgument",option);
  825. if (IsGeometry(argv[i]) == MagickFalse)
  826. ThrowCompositeInvalidArgumentException(option,argv[i]);
  827. (void) CloneString(&composite_options.compose_args,argv[i]);
  828. composite_options.compose=DissolveCompositeOp;
  829. break;
  830. }
  831. if (LocaleCompare("distort",option+1) == 0)
  832. {
  833. (void) CloneString(&composite_options.compose_args,(char *) NULL);
  834. if (*option == '+')
  835. break;
  836. i++;
  837. if (i == (ssize_t) argc)
  838. ThrowCompositeException(OptionError,"MissingArgument",option);
  839. if (IsGeometry(argv[i]) == MagickFalse)
  840. ThrowCompositeInvalidArgumentException(option,argv[i]);
  841. (void) CloneString(&composite_options.compose_args,argv[i]);
  842. composite_options.compose=DistortCompositeOp;
  843. break;
  844. }
  845. if (LocaleCompare("dither",option+1) == 0)
  846. {
  847. ssize_t
  848. method;
  849. if (*option == '+')
  850. break;
  851. i++;
  852. if (i == (ssize_t) argc)
  853. ThrowCompositeException(OptionError,"MissingArgument",option);
  854. method=ParseMagickOption(MagickDitherOptions,MagickFalse,argv[i]);
  855. if (method < 0)
  856. ThrowCompositeException(OptionError,"UnrecognizedDitherMethod",
  857. argv[i]);
  858. break;
  859. }
  860. if (LocaleCompare("duration",option+1) == 0)
  861. {
  862. if (*option == '+')
  863. break;
  864. i++;
  865. if (i == (ssize_t) (argc-1))
  866. ThrowCompositeException(OptionError,"MissingArgument",option);
  867. if (IsGeometry(argv[i]) == MagickFalse)
  868. ThrowCompositeInvalidArgumentException(option,argv[i]);
  869. break;
  870. }
  871. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  872. }
  873. case 'e':
  874. {
  875. if (LocaleCompare("encipher",option+1) == 0)
  876. {
  877. if (*option == '+')
  878. break;
  879. i++;
  880. if (i == (ssize_t) (argc-1))
  881. ThrowCompositeException(OptionError,"MissingArgument",option);
  882. break;
  883. }
  884. if (LocaleCompare("encoding",option+1) == 0)
  885. {
  886. if (*option == '+')
  887. break;
  888. i++;
  889. if (i == (ssize_t) argc)
  890. ThrowCompositeException(OptionError,"MissingArgument",option);
  891. break;
  892. }
  893. if (LocaleCompare("endian",option+1) == 0)
  894. {
  895. ssize_t
  896. endian;
  897. if (*option == '+')
  898. break;
  899. i++;
  900. if (i == (ssize_t) argc)
  901. ThrowCompositeException(OptionError,"MissingArgument",option);
  902. endian=ParseMagickOption(MagickEndianOptions,MagickFalse,
  903. argv[i]);
  904. if (endian < 0)
  905. ThrowCompositeException(OptionError,"UnrecognizedEndianType",
  906. argv[i]);
  907. break;
  908. }
  909. if (LocaleCompare("extract",option+1) == 0)
  910. {
  911. if (*option == '+')
  912. break;
  913. i++;
  914. if (i == (ssize_t) argc)
  915. ThrowCompositeException(OptionError,"MissingArgument",option);
  916. if (IsGeometry(argv[i]) == MagickFalse)
  917. ThrowCompositeInvalidArgumentException(option,argv[i]);
  918. break;
  919. }
  920. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  921. }
  922. case 'f':
  923. {
  924. if (LocaleCompare("filter",option+1) == 0)
  925. {
  926. ssize_t
  927. filter;
  928. if (*option == '+')
  929. break;
  930. i++;
  931. if (i == (ssize_t) argc)
  932. ThrowCompositeException(OptionError,"MissingArgument",option);
  933. filter=ParseMagickOption(MagickFilterOptions,MagickFalse,argv[i]);
  934. if (filter < 0)
  935. ThrowCompositeException(OptionError,"UnrecognizedImageFilter",
  936. argv[i]);
  937. break;
  938. }
  939. if (LocaleCompare("font",option+1) == 0)
  940. {
  941. if (*option == '+')
  942. break;
  943. i++;
  944. if (i == (ssize_t) argc)
  945. ThrowCompositeException(OptionError,"MissingArgument",option);
  946. break;
  947. }
  948. if (LocaleCompare("format",option+1) == 0)
  949. {
  950. if (*option == '+')
  951. break;
  952. i++;
  953. if (i == (ssize_t) argc)
  954. ThrowCompositeException(OptionError,"MissingArgument",option);
  955. format=argv[i];
  956. break;
  957. }
  958. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  959. }
  960. case 'g':
  961. {
  962. if (LocaleCompare("geometry",option+1) == 0)
  963. {
  964. (void) CloneString(&composite_options.geometry,(char *) NULL);
  965. if (*option == '+')
  966. break;
  967. i++;
  968. if (i == (ssize_t) argc)
  969. ThrowCompositeException(OptionError,"MissingArgument",option);
  970. if (IsGeometry(argv[i]) == MagickFalse)
  971. ThrowCompositeInvalidArgumentException(option,argv[i]);
  972. (void) CloneString(&composite_options.geometry,argv[i]);
  973. break;
  974. }
  975. if (LocaleCompare("gravity",option+1) == 0)
  976. {
  977. ssize_t
  978. gravity;
  979. composite_options.gravity=UndefinedGravity;
  980. if (*option == '+')
  981. break;
  982. i++;
  983. if (i == (ssize_t) argc)
  984. ThrowCompositeException(OptionError,"MissingArgument",option);
  985. gravity=ParseMagickOption(MagickGravityOptions,MagickFalse,
  986. argv[i]);
  987. if (gravity < 0)
  988. ThrowCompositeException(OptionError,"UnrecognizedGravityType",
  989. argv[i]);
  990. composite_options.gravity=(GravityType) gravity;
  991. break;
  992. }
  993. if (LocaleCompare("green-primary",option+1) == 0)
  994. {
  995. if (*option == '+')
  996. break;
  997. i++;
  998. if (i == (ssize_t) argc)
  999. ThrowCompositeException(OptionError,"MissingArgument",option);
  1000. if (IsGeometry(argv[i]) == MagickFalse)
  1001. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1002. break;
  1003. }
  1004. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1005. }
  1006. case 'h':
  1007. {
  1008. if ((LocaleCompare("help",option+1) == 0) ||
  1009. (LocaleCompare("-help",option+1) == 0))
  1010. return(CompositeUsage());
  1011. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1012. }
  1013. case 'i':
  1014. {
  1015. if (LocaleCompare("identify",option+1) == 0)
  1016. break;
  1017. if (LocaleCompare("interlace",option+1) == 0)
  1018. {
  1019. ssize_t
  1020. interlace;
  1021. if (*option == '+')
  1022. break;
  1023. i++;
  1024. if (i == (ssize_t) argc)
  1025. ThrowCompositeException(OptionError,"MissingArgument",option);
  1026. interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
  1027. argv[i]);
  1028. if (interlace < 0)
  1029. ThrowCompositeException(OptionError,
  1030. "UnrecognizedInterlaceType",argv[i]);
  1031. break;
  1032. }
  1033. if (LocaleCompare("interpolate",option+1) == 0)
  1034. {
  1035. ssize_t
  1036. interpolate;
  1037. if (*option == '+')
  1038. break;
  1039. i++;
  1040. if (i == (ssize_t) argc)
  1041. ThrowCompositeException(OptionError,"MissingArgument",option);
  1042. interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
  1043. argv[i]);
  1044. if (interpolate < 0)
  1045. ThrowCompositeException(OptionError,
  1046. "UnrecognizedInterpolateMethod",argv[i]);
  1047. break;
  1048. }
  1049. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1050. }
  1051. case 'l':
  1052. {
  1053. if (LocaleCompare("label",option+1) == 0)
  1054. {
  1055. if (*option == '+')
  1056. break;
  1057. i++;
  1058. if (i == (ssize_t) argc)
  1059. ThrowCompositeException(OptionError,"MissingArgument",option);
  1060. break;
  1061. }
  1062. if (LocaleCompare("limit",option+1) == 0)
  1063. {
  1064. char
  1065. *p;
  1066. double
  1067. value;
  1068. ssize_t
  1069. resource;
  1070. if (*option == '+')
  1071. break;
  1072. i++;
  1073. if (i == (ssize_t) argc)
  1074. ThrowCompositeException(OptionError,"MissingArgument",option);
  1075. resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
  1076. argv[i]);
  1077. if (resource < 0)
  1078. ThrowCompositeException(OptionError,"UnrecognizedResourceType",
  1079. argv[i]);
  1080. i++;
  1081. if (i == (ssize_t) argc)
  1082. ThrowCompositeException(OptionError,"MissingArgument",option);
  1083. value=strtod(argv[i],&p);
  1084. (void) value;
  1085. if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
  1086. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1087. break;
  1088. }
  1089. if (LocaleCompare("list",option+1) == 0)
  1090. {
  1091. ssize_t
  1092. list;
  1093. if (*option == '+')
  1094. break;
  1095. i++;
  1096. if (i == (ssize_t) argc)
  1097. ThrowCompositeException(OptionError,"MissingArgument",option);
  1098. list=ParseMagickOption(MagickListOptions,MagickFalse,argv[i]);
  1099. if (list < 0)
  1100. ThrowCompositeException(OptionError,"UnrecognizedListType",
  1101. argv[i]);
  1102. status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
  1103. argv+j,exception);
  1104. DestroyComposite();
  1105. return(status != 0 ? MagickFalse : MagickTrue);
  1106. }
  1107. if (LocaleCompare("log",option+1) == 0)
  1108. {
  1109. if (*option == '+')
  1110. break;
  1111. i++;
  1112. if ((i == (ssize_t) argc) || (strchr(argv[i],'%') == (char *) NULL))
  1113. ThrowCompositeException(OptionError,"MissingArgument",option);
  1114. break;
  1115. }
  1116. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1117. }
  1118. case 'm':
  1119. {
  1120. if (LocaleCompare("matte",option+1) == 0)
  1121. break;
  1122. if (LocaleCompare("monitor",option+1) == 0)
  1123. break;
  1124. if (LocaleCompare("monochrome",option+1) == 0)
  1125. break;
  1126. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1127. }
  1128. case 'n':
  1129. {
  1130. if (LocaleCompare("negate",option+1) == 0)
  1131. break;
  1132. if (LocaleCompare("noop",option+1) == 0)
  1133. break;
  1134. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1135. }
  1136. case 'p':
  1137. {
  1138. if (LocaleCompare("page",option+1) == 0)
  1139. {
  1140. if (*option == '+')
  1141. break;
  1142. i++;
  1143. if (i == (ssize_t) argc)
  1144. ThrowCompositeException(OptionError,"MissingArgument",option);
  1145. break;
  1146. }
  1147. if (LocaleCompare("pointsize",option+1) == 0)
  1148. {
  1149. if (*option == '+')
  1150. break;
  1151. i++;
  1152. if (i == (ssize_t) (argc-1))
  1153. ThrowCompositeException(OptionError,"MissingArgument",option);
  1154. if (IsGeometry(argv[i]) == MagickFalse)
  1155. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1156. break;
  1157. }
  1158. if (LocaleCompare("process",option+1) == 0)
  1159. {
  1160. if (*option == '+')
  1161. break;
  1162. i++;
  1163. if (i == (ssize_t) argc)
  1164. ThrowCompositeException(OptionError,"MissingArgument",option);
  1165. break;
  1166. }
  1167. if (LocaleCompare("profile",option+1) == 0)
  1168. {
  1169. i++;
  1170. if (i == (ssize_t) argc)
  1171. ThrowCompositeException(OptionError,"MissingArgument",option);
  1172. break;
  1173. }
  1174. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1175. }
  1176. case 'q':
  1177. {
  1178. if (LocaleCompare("quality",option+1) == 0)
  1179. {
  1180. if (*option == '+')
  1181. break;
  1182. i++;
  1183. if (i == (ssize_t) argc)
  1184. ThrowCompositeException(OptionError,"MissingArgument",option);
  1185. if (IsGeometry(argv[i]) == MagickFalse)
  1186. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1187. break;
  1188. }
  1189. if (LocaleCompare("quantize",option+1) == 0)
  1190. {
  1191. ssize_t
  1192. colorspace;
  1193. if (*option == '+')
  1194. break;
  1195. i++;
  1196. if (i == (ssize_t) (argc-1))
  1197. ThrowCompositeException(OptionError,"MissingArgument",option);
  1198. colorspace=ParseMagickOption(MagickColorspaceOptions,
  1199. MagickFalse,argv[i]);
  1200. if (colorspace < 0)
  1201. ThrowCompositeException(OptionError,"UnrecognizedColorspace",
  1202. argv[i]);
  1203. break;
  1204. }
  1205. if (LocaleCompare("quiet",option+1) == 0)
  1206. break;
  1207. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1208. }
  1209. case 'r':
  1210. {
  1211. if (LocaleCompare("red-primary",option+1) == 0)
  1212. {
  1213. if (*option == '+')
  1214. break;
  1215. i++;
  1216. if (i == (ssize_t) argc)
  1217. ThrowCompositeException(OptionError,"MissingArgument",option);
  1218. if (IsGeometry(argv[i]) == MagickFalse)
  1219. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1220. break;
  1221. }
  1222. if (LocaleCompare("regard-warnings",option+1) == 0)
  1223. break;
  1224. if (LocaleCompare("render",option+1) == 0)
  1225. break;
  1226. if (LocaleCompare("repage",option+1) == 0)
  1227. {
  1228. if (*option == '+')
  1229. break;
  1230. i++;
  1231. if (i == (ssize_t) argc)
  1232. ThrowCompositeException(OptionError,"MissingArgument",option);
  1233. if (IsGeometry(argv[i]) == MagickFalse)
  1234. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1235. break;
  1236. }
  1237. if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
  1238. {
  1239. respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
  1240. break;
  1241. }
  1242. if (LocaleCompare("resize",option+1) == 0)
  1243. {
  1244. if (*option == '+')
  1245. break;
  1246. i++;
  1247. if (i == (ssize_t) argc)
  1248. ThrowCompositeException(OptionError,"MissingArgument",option);
  1249. if (IsGeometry(argv[i]) == MagickFalse)
  1250. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1251. break;
  1252. }
  1253. if (LocaleCompare("rotate",option+1) == 0)
  1254. {
  1255. i++;
  1256. if (i == (ssize_t) argc)
  1257. ThrowCompositeException(OptionError,"MissingArgument",option);
  1258. if (IsGeometry(argv[i]) == MagickFalse)
  1259. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1260. break;
  1261. }
  1262. ThrowCompositeException(OptionError,"UnrecognizedOption",option)
  1263. }
  1264. case 's':
  1265. {
  1266. if (LocaleCompare("sampling-factor",option+1) == 0)
  1267. {
  1268. if (*option == '+')
  1269. break;
  1270. i++;
  1271. if (i == (ssize_t) argc)
  1272. ThrowCompositeException(OptionError,"MissingArgument",option);
  1273. if (IsGeometry(argv[i]) == MagickFalse)
  1274. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1275. break;
  1276. }
  1277. if (LocaleCompare("scene",option+1) == 0)
  1278. {
  1279. if (*option == '+')
  1280. break;
  1281. i++;
  1282. if (i == (ssize_t) argc)
  1283. ThrowCompositeException(OptionError,"MissingArgument",option);
  1284. if (IsGeometry(argv[i]) == MagickFalse)
  1285. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1286. break;
  1287. }
  1288. if (LocaleCompare("seed",option+1) == 0)
  1289. {
  1290. if (*option == '+')
  1291. break;
  1292. i++;
  1293. if (i == (ssize_t) (argc-1))
  1294. ThrowCompositeException(OptionError,"MissingArgument",option);
  1295. if (IsGeometry(argv[i]) == MagickFalse)
  1296. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1297. break;
  1298. }
  1299. if (LocaleCompare("sharpen",option+1) == 0)
  1300. {
  1301. i++;
  1302. if (i == (ssize_t) argc)
  1303. ThrowCompositeException(OptionError,"MissingArgument",option);
  1304. if (IsGeometry(argv[i]) == MagickFalse)
  1305. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1306. break;
  1307. }
  1308. if (LocaleCompare("shave",option+1) == 0)
  1309. {
  1310. if (*option == '+')
  1311. break;
  1312. i++;
  1313. if (i == (ssize_t) (argc-1))
  1314. ThrowCompositeException(OptionError,"MissingArgument",option);
  1315. if (IsGeometry(argv[i]) == MagickFalse)
  1316. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1317. break;
  1318. }
  1319. if (LocaleCompare("size",option+1) == 0)
  1320. {
  1321. if (*option == '+')
  1322. break;
  1323. i++;
  1324. if (i == (ssize_t) argc)
  1325. ThrowCompositeException(OptionError,"MissingArgument",option);
  1326. if (IsGeometry(argv[i]) == MagickFalse)
  1327. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1328. break;
  1329. }
  1330. if (LocaleCompare("stegano",option+1) == 0)
  1331. {
  1332. composite_options.stegano=0;
  1333. if (*option == '+')
  1334. break;
  1335. i++;
  1336. if (i == (ssize_t) argc)
  1337. ThrowCompositeException(OptionError,"MissingArgument",option);
  1338. if (IsGeometry(argv[i]) == MagickFalse)
  1339. ThrowCompositeInvalidArgumentException(option,argv[i]);
  1340. composite_options.stegano=(ssize_t) StringToLong(argv[

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