PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/sisko/operation-caribou
C | 718 lines | 601 code | 27 blank | 90 comment | 239 complexity | 9b061a25c88d13a0fc7cb24aba5c8ab3 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-2.1
  1. /*
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % %
  4. % %
  5. % %
  6. % IIIII DDDD EEEEE N N TTTTT IIIII FFFFF Y Y %
  7. % I D D E NN N T I F Y Y %
  8. % I D D EEE N N N T I FFF Y %
  9. % I D D E N NN T I F Y %
  10. % IIIII DDDD EEEEE N N T IIIII F Y %
  11. % %
  12. % %
  13. % Identify an Image Format and Characteristics. %
  14. % %
  15. % Software Design %
  16. % John Cristy %
  17. % September 1994 %
  18. % %
  19. % %
  20. % Copyright 1999-2006 ImageMagick Studio LLC, a non-profit organization %
  21. % dedicated to making software imaging solutions freely available. %
  22. % %
  23. % You may not use this file except in compliance with the License. You may %
  24. % obtain a copy of the License at %
  25. % %
  26. % http://www.imagemagick.org/script/license.php %
  27. % %
  28. % Unless required by applicable law or agreed to in writing, software %
  29. % distributed under the License is distributed on an "AS IS" BASIS, %
  30. % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
  31. % See the License for the specific language governing permissions and %
  32. % limitations under the License. %
  33. % %
  34. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  35. %
  36. % Identify describes the format and characteristics of one or more image
  37. % files. It will also report if an image is incomplete or corrupt.
  38. %
  39. %
  40. */
  41. /*
  42. Include declarations.
  43. */
  44. #include "wand/studio.h"
  45. #include "wand/MagickWand.h"
  46. #include "wand/mogrify-private.h"
  47. /*
  48. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  49. % %
  50. % %
  51. % %
  52. + I d e n t i f y I m a g e C o m m a n d %
  53. % %
  54. % %
  55. % %
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57. %
  58. % IdentifyImageCommand() describes the format and characteristics of one or
  59. % more image files. It will also report if an image is incomplete or corrupt.
  60. % The information displayed includes the scene number, the file name, the
  61. % width and height of the image, whether the image is colormapped or not,
  62. % the number of colors in the image, the number of bytes in the image, the
  63. % format of the image (JPEG, PNM, etc.), and finally the number of seconds
  64. % it took to read and process the image.
  65. %
  66. % The format of the IdentifyImageCommand method is:
  67. %
  68. % MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,int argc,
  69. % char **argv,char **metadata,ExceptionInfo *exception)
  70. %
  71. % A description of each parameter follows:
  72. %
  73. % o image_info: The image info.
  74. %
  75. % o argc: The number of elements in the argument vector.
  76. %
  77. % o argv: A text array containing the command line arguments.
  78. %
  79. % o metadata: any metadata is returned here.
  80. %
  81. % o exception: Return any errors or warnings in this structure.
  82. %
  83. %
  84. */
  85. static void IdentifyUsage(void)
  86. {
  87. const char
  88. **p;
  89. static const char
  90. *settings[]=
  91. {
  92. "-antialias remove pixel-aliasing",
  93. "-authenticate value decrypt image with this password",
  94. "-channel type apply option to select image channels",
  95. "-crop geometry cut out a rectangular region of the image",
  96. "-debug events display copious debugging information",
  97. "-define format:option",
  98. " define one or more image format options",
  99. "-density geometry horizontal and vertical density of the image",
  100. "-depth value image depth",
  101. "-extract geometry extract area from image",
  102. "-format \"string\" output formatted image characteristics",
  103. "-fuzz distance colors within this distance are considered equal",
  104. "-help print program options",
  105. "-interlace type type of image interlacing scheme",
  106. "-interpolate method pixel color interpolation method",
  107. "-limit type value pixel cache resource limit",
  108. "-list type Color, Configure, Delegate, Format, Magic, Module,",
  109. " Resource, or Type",
  110. "-log format format of debugging information",
  111. "-matte store matte channel if the image has one",
  112. "-monitor monitor progress",
  113. "-ping efficiently determine image attributes",
  114. "-quiet suppress all error or warning messages",
  115. "-regard-warnings pay attention to warning messages",
  116. "-sampling-factor geometry",
  117. " horizontal and vertical sampling factor",
  118. "-set attribute value set an image attribute",
  119. "-size geometry width and height of image",
  120. "-strip strip image of all profiles and comments",
  121. "-units type the units of image resolution",
  122. "-verbose print detailed information about the image",
  123. "-version print version information",
  124. "-virtual-pixel method",
  125. " virtual pixel access method",
  126. (char *) NULL
  127. };
  128. (void) printf("Version: %s\n",GetMagickVersion((unsigned long *) NULL));
  129. (void) printf("Copyright: %s\n\n",GetMagickCopyright());
  130. (void) printf("Usage: %s [options ...] file [ [options ...] "
  131. "file ... ]\n",GetClientName());
  132. (void) printf("\nImage Settings:\n");
  133. for (p=settings; *p != (char *) NULL; p++)
  134. (void) printf(" %s\n",*p);
  135. (void) printf(
  136. "\nBy default, the image format of `file' is determined by its magic\n");
  137. (void) printf(
  138. "number. To specify a particular image format, precede the filename\n");
  139. (void) printf(
  140. "with an image format name and a colon (i.e. ps:image) or specify the\n");
  141. (void) printf(
  142. "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
  143. (void) printf("'-' for standard input or output.\n");
  144. exit(0);
  145. }
  146. WandExport MagickBooleanType IdentifyImageCommand(ImageInfo *image_info,
  147. int argc,char **argv,char **metadata,ExceptionInfo *exception)
  148. {
  149. #define DestroyIdentify() \
  150. { \
  151. for ( ; k >= 0; k--) \
  152. image_stack[k]=DestroyImageList(image_stack[k]); \
  153. for (i=0; i < (long) argc; i++) \
  154. argv[i]=(char *) RelinquishMagickMemory(argv[i]); \
  155. argv=(char **) RelinquishMagickMemory(argv); \
  156. }
  157. #define ThrowIdentifyException(asperity,tag,option) \
  158. { \
  159. if (exception->severity == UndefinedException) \
  160. (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag, \
  161. "`%s'",option); \
  162. DestroyIdentify(); \
  163. return(MagickFalse); \
  164. }
  165. #define ThrowIdentifyInvalidArgumentException(option,argument) \
  166. { \
  167. (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
  168. "InvalidArgument","`%s': %s",argument,option); \
  169. DestroyIdentify(); \
  170. return(MagickFalse); \
  171. }
  172. const char
  173. *format,
  174. *option;
  175. Image
  176. *image_stack[MaxImageStackDepth+1];
  177. long
  178. j,
  179. k;
  180. MagickBooleanType
  181. fire,
  182. pend;
  183. MagickStatusType
  184. status;
  185. register long
  186. i;
  187. unsigned long
  188. count;
  189. /*
  190. Set defaults.
  191. */
  192. assert(image_info != (ImageInfo *) NULL);
  193. assert(image_info->signature == MagickSignature);
  194. if (image_info->debug != MagickFalse)
  195. (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
  196. assert(exception != (ExceptionInfo *) NULL);
  197. if (argc < 2)
  198. IdentifyUsage();
  199. count=0;
  200. format=NULL;
  201. j=1;
  202. k=0;
  203. image_stack[k]=NewImageList();
  204. option=(char *) NULL;
  205. pend=MagickFalse;
  206. status=MagickTrue;
  207. /*
  208. Identify an image.
  209. */
  210. ReadCommandlLine(argc,&argv);
  211. status=ExpandFilenames(&argc,&argv);
  212. if (status == MagickFalse)
  213. {
  214. char
  215. *message;
  216. message=GetExceptionMessage(errno);
  217. ThrowIdentifyException(ResourceLimitError,"MemoryAllocationFailed",
  218. message);
  219. message=(char *) RelinquishMagickMemory(message);
  220. }
  221. for (i=1; i < (long) argc; i++)
  222. {
  223. option=argv[i];
  224. if (LocaleCompare(option,"(") == 0)
  225. {
  226. if (k == MaxImageStackDepth)
  227. ThrowIdentifyException(OptionError,"ParenthesisNestedTooDeeply",
  228. option);
  229. MogrifyImageStack(image_stack[k],MagickTrue,pend);
  230. k++;
  231. image_stack[k]=NewImageList();
  232. continue;
  233. }
  234. if (LocaleCompare(option,")") == 0)
  235. {
  236. if (k == 0)
  237. ThrowIdentifyException(OptionError,"UnableToParseExpression",option);
  238. if (image_stack[k] != (Image *) NULL)
  239. {
  240. MogrifyImageStack(image_stack[k],MagickTrue,MagickTrue);
  241. AppendImageToList(&image_stack[k-1],image_stack[k]);
  242. }
  243. k--;
  244. continue;
  245. }
  246. if (IsMagickOption(option) == MagickFalse)
  247. {
  248. char
  249. *filename;
  250. Image
  251. *image;
  252. ImageInfo
  253. *identify_info;
  254. /*
  255. Read input image.
  256. */
  257. MogrifyImageStack(image_stack[k],MagickFalse,pend);
  258. identify_info=CloneImageInfo(image_info);
  259. identify_info->verbose=MagickFalse;
  260. filename=argv[i];
  261. if ((LocaleCompare(filename,"--") == 0) && (i < (argc-1)))
  262. filename=argv[++i];
  263. (void) CopyMagickString(identify_info->filename,filename,MaxTextExtent);
  264. if ((image_info->verbose != MagickFalse) ||
  265. (identify_info->ping == MagickFalse))
  266. image=ReadImage(identify_info,exception);
  267. else
  268. image=PingImage(identify_info,exception);
  269. identify_info=DestroyImageInfo(identify_info);
  270. status&=(image != (Image *) NULL) &&
  271. (exception->severity < ErrorException);
  272. if (image == (Image *) NULL)
  273. continue;
  274. AppendImageToList(&image_stack[k],image);
  275. MogrifyImageStack(image_stack[k],MagickFalse,MagickTrue);
  276. image=image_stack[k];
  277. for ( ; image != (Image *) NULL; image=GetNextImageInList(image))
  278. {
  279. if (image->scene == 0)
  280. image->scene=count++;
  281. if (format == (char *) NULL)
  282. {
  283. (void) IdentifyImage(image,stdout,image_info->verbose);
  284. continue;
  285. }
  286. if (metadata != (char **) NULL)
  287. {
  288. char
  289. *text;
  290. text=InterpretImageProperties(image_info,image,format);
  291. if (text == (char *) NULL)
  292. {
  293. char
  294. *message;
  295. message=GetExceptionMessage(errno);
  296. ThrowIdentifyException(ResourceLimitError,
  297. "MemoryAllocationFailed",message);
  298. message=(char *) RelinquishMagickMemory(message);
  299. }
  300. (void) ConcatenateString(&(*metadata),text);
  301. text=(char *) RelinquishMagickMemory(text);
  302. if (LocaleCompare(format,"%n") == 0)
  303. break;
  304. }
  305. }
  306. image_stack[k]=DestroyImageList(image_stack[k]);
  307. continue;
  308. }
  309. pend=image_stack[k] != (Image *) NULL ? MagickTrue : MagickFalse;
  310. switch (*(option+1))
  311. {
  312. case 'a':
  313. {
  314. if (LocaleCompare("antialias",option+1) == 0)
  315. break;
  316. if (LocaleCompare("authenticate",option+1) == 0)
  317. {
  318. if (*option == '+')
  319. break;
  320. i++;
  321. if (i == (long) (argc-1))
  322. ThrowIdentifyException(OptionError,"MissingArgument",option);
  323. break;
  324. }
  325. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  326. }
  327. case 'c':
  328. {
  329. if (LocaleCompare("cache",option+1) == 0)
  330. {
  331. if (*option == '+')
  332. break;
  333. i++;
  334. if (i == (long) argc)
  335. ThrowIdentifyException(OptionError,"MissingArgument",option);
  336. if (IsGeometry(argv[i]) == MagickFalse)
  337. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  338. break;
  339. }
  340. if (LocaleCompare("channel",option+1) == 0)
  341. {
  342. long
  343. channel;
  344. if (*option == '+')
  345. break;
  346. i++;
  347. if (i == (long) (argc-1))
  348. ThrowIdentifyException(OptionError,"MissingArgument",option);
  349. channel=ParseChannelOption(argv[i]);
  350. if (channel < 0)
  351. ThrowIdentifyException(OptionError,"UnrecognizedChannelType",
  352. argv[i]);
  353. break;
  354. }
  355. if (LocaleCompare("crop",option+1) == 0)
  356. {
  357. if (*option == '+')
  358. break;
  359. i++;
  360. if (i == (long) (argc-1))
  361. ThrowIdentifyException(OptionError,"MissingArgument",option);
  362. if (IsGeometry(argv[i]) == MagickFalse)
  363. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  364. image_info->ping=MagickFalse;
  365. break;
  366. }
  367. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  368. }
  369. case 'd':
  370. {
  371. if (LocaleCompare("debug",option+1) == 0)
  372. {
  373. long
  374. event;
  375. if (*option == '+')
  376. break;
  377. i++;
  378. if (i == (long) argc)
  379. ThrowIdentifyException(OptionError,"MissingArgument",option);
  380. event=ParseMagickOption(MagickLogEventOptions,MagickFalse,argv[i]);
  381. if (event < 0)
  382. ThrowIdentifyException(OptionError,"UnrecognizedEventType",
  383. argv[i]);
  384. (void) SetLogEventMask(argv[i]);
  385. break;
  386. break;
  387. }
  388. if (LocaleCompare("define",option+1) == 0)
  389. {
  390. i++;
  391. if (i == (long) argc)
  392. ThrowIdentifyException(OptionError,"MissingArgument",option);
  393. if (*option == '+')
  394. {
  395. const char
  396. *define;
  397. define=GetImageOption(image_info,argv[i]);
  398. if (define == (const char *) NULL)
  399. ThrowIdentifyException(OptionError,"NoSuchOption",argv[i]);
  400. break;
  401. }
  402. break;
  403. }
  404. if (LocaleCompare("density",option+1) == 0)
  405. {
  406. if (*option == '+')
  407. break;
  408. i++;
  409. if (i == (long) argc)
  410. ThrowIdentifyException(OptionError,"MissingArgument",option);
  411. if (IsGeometry(argv[i]) == MagickFalse)
  412. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  413. break;
  414. }
  415. if (LocaleCompare("depth",option+1) == 0)
  416. {
  417. if (*option == '+')
  418. break;
  419. i++;
  420. if (i == (long) argc)
  421. ThrowIdentifyException(OptionError,"MissingArgument",option);
  422. if (IsGeometry(argv[i]) == MagickFalse)
  423. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  424. break;
  425. }
  426. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  427. }
  428. case 'f':
  429. {
  430. if (LocaleCompare("format",option+1) == 0)
  431. {
  432. format=(char *) NULL;
  433. if (*option == '+')
  434. break;
  435. i++;
  436. if (i == (long) argc)
  437. ThrowIdentifyException(OptionError,"MissingArgument",option);
  438. format=argv[i];
  439. break;
  440. }
  441. if (LocaleCompare("fuzz",option+1) == 0)
  442. {
  443. if (*option == '+')
  444. break;
  445. i++;
  446. if (i == (long) (argc-1))
  447. ThrowIdentifyException(OptionError,"MissingArgument",option);
  448. if (IsGeometry(argv[i]) == MagickFalse)
  449. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  450. break;
  451. }
  452. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  453. }
  454. case 'h':
  455. {
  456. if ((LocaleCompare("help",option+1) == 0) ||
  457. (LocaleCompare("-help",option+1) == 0))
  458. IdentifyUsage();
  459. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  460. }
  461. case 'i':
  462. {
  463. if (LocaleCompare("interlace",option+1) == 0)
  464. {
  465. long
  466. interlace;
  467. if (*option == '+')
  468. break;
  469. i++;
  470. if (i == (long) argc)
  471. ThrowIdentifyException(OptionError,"MissingArgument",option);
  472. interlace=ParseMagickOption(MagickInterlaceOptions,MagickFalse,
  473. argv[i]);
  474. if (interlace < 0)
  475. ThrowIdentifyException(OptionError,
  476. "UnrecognizedInterlaceType",argv[i]);
  477. break;
  478. }
  479. if (LocaleCompare("interpolate",option+1) == 0)
  480. {
  481. long
  482. interpolate;
  483. if (*option == '+')
  484. break;
  485. i++;
  486. if (i == (long) argc)
  487. ThrowIdentifyException(OptionError,"MissingArgument",option);
  488. interpolate=ParseMagickOption(MagickInterpolateOptions,MagickFalse,
  489. argv[i]);
  490. if (interpolate < 0)
  491. ThrowIdentifyException(OptionError,
  492. "UnrecognizedInterpolateMethod",argv[i]);
  493. break;
  494. }
  495. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  496. }
  497. case 'l':
  498. {
  499. if (LocaleCompare("limit",option+1) == 0)
  500. {
  501. long
  502. resource;
  503. if (*option == '+')
  504. break;
  505. i++;
  506. if (i == (long) argc)
  507. ThrowIdentifyException(OptionError,"MissingArgument",option);
  508. resource=ParseMagickOption(MagickResourceOptions,MagickFalse,
  509. argv[i]);
  510. if (resource < 0)
  511. ThrowIdentifyException(OptionError,"UnrecognizedResourceType",
  512. argv[i]);
  513. i++;
  514. if (i == (long) argc)
  515. ThrowIdentifyException(OptionError,"MissingArgument",option);
  516. if ((LocaleCompare("unlimited",argv[i]) != 0) &&
  517. (IsGeometry(argv[i]) == MagickFalse))
  518. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  519. break;
  520. }
  521. if (LocaleCompare("list",option+1) == 0)
  522. {
  523. long
  524. list;
  525. if (*option == '+')
  526. break;
  527. i++;
  528. if (i == (long) argc)
  529. ThrowIdentifyException(OptionError,"MissingArgument",option);
  530. list=ParseMagickOption(MagickListOptions,MagickFalse,argv[i]);
  531. if (list < 0)
  532. ThrowIdentifyException(OptionError,"UnrecognizedListType",
  533. argv[i]);
  534. (void) MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
  535. argv+j,exception);
  536. DestroyIdentify();
  537. return(MagickTrue);
  538. }
  539. if (LocaleCompare("log",option+1) == 0)
  540. {
  541. if (*option == '+')
  542. break;
  543. i++;
  544. if ((i == (long) argc) ||
  545. (strchr(argv[i],'%') == (char *) NULL))
  546. ThrowIdentifyException(OptionError,"MissingArgument",option);
  547. break;
  548. }
  549. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  550. }
  551. case 'm':
  552. {
  553. if (LocaleCompare("matte",option+1) == 0)
  554. break;
  555. if (LocaleCompare("monitor",option+1) == 0)
  556. break;
  557. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  558. }
  559. case 'p':
  560. {
  561. if (LocaleCompare("ping",option+1) == 0)
  562. break;
  563. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  564. }
  565. case 'q':
  566. {
  567. if (LocaleCompare("quiet",option+1) == 0)
  568. break;
  569. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  570. }
  571. case 'r':
  572. {
  573. if (LocaleCompare("regard-warnings",option+1) == 0)
  574. break;
  575. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  576. }
  577. case 's':
  578. {
  579. if (LocaleCompare("sampling-factor",option+1) == 0)
  580. {
  581. if (*option == '+')
  582. break;
  583. i++;
  584. if (i == (long) argc)
  585. ThrowIdentifyException(OptionError,"MissingArgument",option);
  586. if (IsGeometry(argv[i]) == MagickFalse)
  587. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  588. break;
  589. }
  590. if (LocaleCompare("set",option+1) == 0)
  591. {
  592. i++;
  593. if (i == (long) argc)
  594. ThrowIdentifyException(OptionError,"MissingArgument",option);
  595. if (*option == '+')
  596. break;
  597. i++;
  598. if (i == (long) argc)
  599. ThrowIdentifyException(OptionError,"MissingArgument",option);
  600. break;
  601. }
  602. if (LocaleCompare("size",option+1) == 0)
  603. {
  604. if (*option == '+')
  605. break;
  606. i++;
  607. if (i == (long) argc)
  608. ThrowIdentifyException(OptionError,"MissingArgument",option);
  609. if (IsGeometry(argv[i]) == MagickFalse)
  610. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  611. break;
  612. }
  613. if (LocaleCompare("strip",option+1) == 0)
  614. break;
  615. if (LocaleCompare("support",option+1) == 0)
  616. {
  617. if (*option == '+')
  618. break;
  619. i++;
  620. if (i == (long) argc)
  621. ThrowIdentifyException(OptionError,"MissingArgument",option);
  622. if (IsGeometry(argv[i]) == MagickFalse)
  623. ThrowIdentifyInvalidArgumentException(option,argv[i]);
  624. break;
  625. }
  626. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  627. }
  628. case 'u':
  629. {
  630. if (LocaleCompare("units",option+1) == 0)
  631. {
  632. long
  633. units;
  634. if (*option == '+')
  635. break;
  636. i++;
  637. if (i == (long) (argc-1))
  638. ThrowIdentifyException(OptionError,"MissingArgument",option);
  639. units=ParseMagickOption(MagickResolutionOptions,MagickFalse,
  640. argv[i]);
  641. if (units < 0)
  642. ThrowIdentifyException(OptionError,"UnrecognizedUnitsType",
  643. argv[i]);
  644. break;
  645. }
  646. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  647. }
  648. case 'v':
  649. {
  650. if (LocaleCompare("verbose",option+1) == 0)
  651. break;
  652. if ((LocaleCompare("version",option+1) == 0) ||
  653. (LocaleCompare("-version",option+1) == 0))
  654. break;
  655. if (LocaleCompare("virtual-pixel",option+1) == 0)
  656. {
  657. long
  658. method;
  659. if (*option == '+')
  660. break;
  661. i++;
  662. if (i == (long) (argc-1))
  663. ThrowIdentifyException(OptionError,"MissingArgument",option);
  664. method=ParseMagickOption(MagickVirtualPixelOptions,MagickFalse,
  665. argv[i]);
  666. if (method < 0)
  667. ThrowIdentifyException(OptionError,
  668. "UnrecognizedVirtualPixelMethod",argv[i]);
  669. break;
  670. }
  671. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  672. }
  673. case '?':
  674. break;
  675. default:
  676. ThrowIdentifyException(OptionError,"UnrecognizedOption",option)
  677. }
  678. fire=(MagickBooleanType) ParseMagickOption(MagickMogrifyOptions,
  679. MagickFalse,option+1);
  680. if (fire == MagickTrue)
  681. MogrifyImageStack(image_stack[k],MagickTrue,MagickTrue);
  682. }
  683. if (k != 0)
  684. ThrowIdentifyException(OptionError,"UnbalancedParenthesis",argv[i]);
  685. if (i != argc)
  686. ThrowIdentifyException(OptionError,"MissingAnImageFilename",argv[i]);
  687. DestroyIdentify();
  688. return(status != 0 ? MagickTrue : MagickFalse);
  689. }