PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/ImageMagick-6.7.7-5/wand/composite.c

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

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