MagickWand 7.1.2-25
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
stream.c
1/*
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% %
4% %
5% %
6% SSSSS TTTTT RRRR EEEEE AAA M M %
7% SS T R R E A A MM MM %
8% SSS T RRRR EEE AAAAA M M M %
9% SS T R R E A A M M %
10% SSSSS T R R EEEEE A A M M %
11% %
12% %
13% Stream Image to a Raw Image Format %
14% %
15% Software Design %
16% Cristy %
17% July 1992 %
18% %
19% %
20% Copyright @ 1999 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% https://imagemagick.org/license/ %
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% Stream is a lightweight tool to stream one or more pixel components of the
37% image or portion of the image to your choice of storage formats. It writes
38% the pixel components as they are read from the input image a row at a time
39% making stream desirable when working with large images or when you require
40% raw pixel components.
41%
42*/
43
44/*
45 Include declarations.
46*/
47#include "MagickWand/studio.h"
48#include "MagickWand/MagickWand.h"
49#include "MagickWand/mogrify-private.h"
50#include "MagickCore/stream-private.h"
51#include "MagickCore/string-private.h"
52
53/*
54%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55% %
56% %
57% %
58% S t r e a m I m a g e C o m m a n d %
59% %
60% %
61% %
62%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63%
64% StreamImageCommand() is a lightweight method designed to extract pixels
65% from large image files to a raw format using a minimum of system resources.
66% The entire image or any regular portion of the image can be extracted.
67%
68% The format of the StreamImageCommand method is:
69%
70% MagickBooleanType StreamImageCommand(ImageInfo *image_info,int argc,
71% char **argv,char **metadata,ExceptionInfo *exception)
72%
73% A description of each parameter follows:
74%
75% o image_info: the image info.
76%
77% o argc: the number of elements in the argument vector.
78%
79% o argv: A text array containing the command line arguments.
80%
81% o metadata: any metadata is returned here.
82%
83% o exception: return any errors or warnings in this structure.
84%
85*/
86
87static MagickBooleanType StreamUsage(void)
88{
89 static const char
90 miscellaneous[] =
91 " -channel mask set the image channel mask\n"
92 " -debug events display copious debugging information\n"
93 " -help print program options\n"
94 " -list type print a list of supported option arguments\n"
95 " -log format format of debugging information\n"
96 " -version print version information",
97 settings[] =
98 " -authenticate password\n"
99 " decipher image with this password\n"
100 " -colorspace type alternate image colorspace\n"
101 " -compress type type of pixel compression when writing the image\n"
102 " -define format:option\n"
103 " define one or more image format options\n"
104 " -density geometry horizontal and vertical density of the image\n"
105 " -depth value image depth\n"
106 " -extract geometry extract area from image\n"
107 " -identify identify the format and characteristics of the image\n"
108 " -interlace type type of image interlacing scheme\n"
109 " -interpolate method pixel color interpolation method\n"
110 " -limit type value pixel cache resource limit\n"
111 " -map components one or more pixel components\n"
112 " -monitor monitor progress\n"
113 " -quantize colorspace reduce colors in this colorspace\n"
114 " -quiet suppress all warning messages\n"
115 " -regard-warnings pay attention to warning messages\n"
116 " -respect-parentheses settings remain in effect until parenthesis boundary\n"
117 " -sampling-factor geometry\n"
118 " horizontal and vertical sampling factor\n"
119 " -seed value seed a new sequence of pseudo-random numbers\n"
120 " -set attribute value set an image attribute\n"
121 " -size geometry width and height of image\n"
122 " -storage-type type pixel storage type\n"
123 " -synchronize synchronize image to storage device\n"
124 " -taint declare the image as modified\n"
125 " -transparent-color color\n"
126 " transparent color\n"
127 " -verbose print detailed information about the image\n"
128 " -virtual-pixel method\n"
129 " virtual pixel access method";
130
131 ListMagickVersion(stdout);
132 (void) printf("Usage: %s [options ...] input-image raw-image\n",
133 GetClientName());
134 (void) printf("\nImage Settings:\n");
135 (void) puts(settings);
136 (void) printf("\nMiscellaneous Options:\n");
137 (void) puts(miscellaneous);
138 (void) printf(
139 "\nBy default, the image format of 'file' is determined by its magic\n");
140 (void) printf(
141 "number. To specify a particular image format, precede the filename\n");
142 (void) printf(
143 "with an image format name and a colon (i.e. ps:image) or specify the\n");
144 (void) printf(
145 "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
146 (void) printf("'-' for standard input or output.\n");
147 return(MagickTrue);
148}
149
150WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info,
151 int argc,char **argv,char **metadata,ExceptionInfo *exception)
152{
153#define DestroyStream() \
154{ \
155 DestroyImageStack(); \
156 stream_info=DestroyStreamInfo(stream_info); \
157 for (i=0; i < (ssize_t) argc; i++) \
158 argv[i]=DestroyString(argv[i]); \
159 argv=(char **) RelinquishMagickMemory(argv); \
160}
161#define ThrowStreamException(asperity,tag,option) \
162{ \
163 char *message = GetExceptionMessage(errno); \
164 (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag, \
165 "`%s'",option == (char *) NULL ? message : option); \
166 message=DestroyString(message); \
167 DestroyStream(); \
168 return(MagickFalse); \
169}
170#define ThrowStreamInvalidArgumentException(option,argument) \
171{ \
172 (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
173 "InvalidArgument","'%s': %s",option,argument); \
174 DestroyStream(); \
175 return(MagickFalse); \
176}
177
178 char
179 *filename,
180 *option;
181
182 const char
183 *format;
184
185 Image
186 *image = (Image *) NULL;
187
188 ImageStack
189 image_stack[MaxImageStackDepth+1];
190
191 MagickBooleanType
192 fire,
193 pend,
194 respect_parentheses;
195
196 MagickStatusType
197 status;
198
199 ssize_t
200 i;
201
202 ssize_t
203 j,
204 k;
205
206 StreamInfo
207 *stream_info;
208
209 /*
210 Set defaults.
211 */
212 assert(image_info != (ImageInfo *) NULL);
213 assert(image_info->signature == MagickCoreSignature);
214 assert(exception != (ExceptionInfo *) NULL);
215 if (IsEventLogging() != MagickFalse)
216 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
217 (void) metadata;
218 if (argc == 2)
219 {
220 option=argv[1];
221 if ((LocaleCompare("help",option+1) == 0) ||
222 (LocaleCompare("-help",option+1) == 0))
223 return(StreamUsage());
224 if ((LocaleCompare("version",option+1) == 0) ||
225 (LocaleCompare("-version",option+1) == 0))
226 {
227 ListMagickVersion(stdout);
228 return(MagickFalse);
229 }
230 }
231 if (argc < 3)
232 {
233 (void) ThrowMagickException(exception,GetMagickModule(),OptionError,
234 "MissingArgument","%s","");
235 (void) StreamUsage();
236 return(MagickFalse);
237 }
238 format="%w,%h,%m";
239 (void) format;
240 j=1;
241 k=0;
242 NewImageStack();
243 option=(char *) NULL;
244 pend=MagickFalse;
245 respect_parentheses=MagickFalse;
246 stream_info=AcquireStreamInfo(image_info,exception);
247 status=MagickTrue;
248 /*
249 Stream an image.
250 */
251 ReadCommandlLine(argc,&argv);
252 status=ExpandFilenames(&argc,&argv);
253 if (status == MagickFalse)
254 ThrowStreamException(ResourceLimitError,"MemoryAllocationFailed",
255 (char *) NULL);
256 status=OpenStream(image_info,stream_info,argv[argc-1],exception);
257 if (status == MagickFalse)
258 {
259 DestroyStream();
260 return(MagickFalse);
261 }
262 for (i=1; i < ((ssize_t) argc-1); i++)
263 {
264 option=argv[i];
265 if (LocaleCompare(option,"(") == 0)
266 {
267 FireImageStack(MagickFalse,MagickTrue,pend);
268 if (k == MaxImageStackDepth)
269 ThrowStreamException(OptionError,"ParenthesisNestedTooDeeply",option);
270 PushImageStack();
271 continue;
272 }
273 if (LocaleCompare(option,")") == 0)
274 {
275 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
276 if (k == 0)
277 ThrowStreamException(OptionError,"UnableToParseExpression",option);
278 PopImageStack();
279 continue;
280 }
281 if (IsCommandOption(option) == MagickFalse)
282 {
283 Image
284 *images;
285
286 /*
287 Stream input image.
288 */
289 FireImageStack(MagickFalse,MagickFalse,pend);
290 filename=argv[i];
291 if ((LocaleCompare(filename,"--") == 0) && (i < ((ssize_t) argc-1)))
292 filename=argv[++i];
293 (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
294 images=StreamImage(image_info,stream_info,exception);
295 status&=(MagickStatusType) (images != (Image *) NULL) &&
296 (exception->severity < ErrorException);
297 if (images == (Image *) NULL)
298 continue;
299 AppendImageStack(images);
300 continue;
301 }
302 pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
303 switch (*(option+1))
304 {
305 case 'a':
306 {
307 if (LocaleCompare("authenticate",option+1) == 0)
308 {
309 if (*option == '+')
310 break;
311 i++;
312 if (i == (ssize_t) argc)
313 ThrowStreamException(OptionError,"MissingArgument",option);
314 break;
315 }
316 ThrowStreamException(OptionError,"UnrecognizedOption",option)
317 }
318 case 'c':
319 {
320 if (LocaleCompare("cache",option+1) == 0)
321 {
322 if (*option == '+')
323 break;
324 i++;
325 if (i == (ssize_t) argc)
326 ThrowStreamException(OptionError,"MissingArgument",option);
327 if (IsGeometry(argv[i]) == MagickFalse)
328 ThrowStreamInvalidArgumentException(option,argv[i]);
329 break;
330 }
331 if (LocaleCompare("channel",option+1) == 0)
332 {
333 ssize_t
334 channel;
335
336 if (*option == '+')
337 break;
338 i++;
339 if (i == (ssize_t) argc)
340 ThrowStreamException(OptionError,"MissingArgument",option);
341 channel=ParseChannelOption(argv[i]);
342 if (channel < 0)
343 ThrowStreamException(OptionError,"UnrecognizedChannelType",
344 argv[i]);
345 break;
346 }
347 if (LocaleCompare("colorspace",option+1) == 0)
348 {
349 ssize_t
350 colorspace;
351
352 if (*option == '+')
353 break;
354 i++;
355 if (i == (ssize_t) argc)
356 ThrowStreamException(OptionError,"MissingArgument",option);
357 colorspace=ParseCommandOption(MagickColorspaceOptions,MagickFalse,
358 argv[i]);
359 if (colorspace < 0)
360 ThrowStreamException(OptionError,"UnrecognizedColorspace",
361 argv[i]);
362 break;
363 }
364 if (LocaleCompare("compress",option+1) == 0)
365 {
366 ssize_t
367 compress;
368
369 if (*option == '+')
370 break;
371 i++;
372 if (i == (ssize_t) argc)
373 ThrowStreamException(OptionError,"MissingArgument",option);
374 compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
375 argv[i]);
376 if (compress < 0)
377 ThrowStreamException(OptionError,"UnrecognizedImageCompression",
378 argv[i]);
379 break;
380 }
381 if (LocaleCompare("concurrent",option+1) == 0)
382 break;
383 ThrowStreamException(OptionError,"UnrecognizedOption",option)
384 }
385 case 'd':
386 {
387 if (LocaleCompare("debug",option+1) == 0)
388 {
389 ssize_t
390 event;
391
392 if (*option == '+')
393 break;
394 i++;
395 if (i == (ssize_t) argc)
396 ThrowStreamException(OptionError,"MissingArgument",option);
397 event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
398 if (event < 0)
399 ThrowStreamException(OptionError,"UnrecognizedEventType",argv[i]);
400 (void) SetLogEventMask(argv[i]);
401 break;
402 }
403 if (LocaleCompare("define",option+1) == 0)
404 {
405 i++;
406 if (i == (ssize_t) argc)
407 ThrowStreamException(OptionError,"MissingArgument",option);
408 if (*option == '+')
409 {
410 const char
411 *define;
412
413 define=GetImageOption(image_info,argv[i]);
414 if (define == (const char *) NULL)
415 ThrowStreamException(OptionError,"NoSuchOption",argv[i]);
416 break;
417 }
418 break;
419 }
420 if (LocaleCompare("density",option+1) == 0)
421 {
422 if (*option == '+')
423 break;
424 i++;
425 if (i == (ssize_t) argc)
426 ThrowStreamException(OptionError,"MissingArgument",option);
427 if (IsGeometry(argv[i]) == MagickFalse)
428 ThrowStreamInvalidArgumentException(option,argv[i]);
429 break;
430 }
431 if (LocaleCompare("depth",option+1) == 0)
432 {
433 if (*option == '+')
434 break;
435 i++;
436 if (i == (ssize_t) argc)
437 ThrowStreamException(OptionError,"MissingArgument",option);
438 if (IsGeometry(argv[i]) == MagickFalse)
439 ThrowStreamInvalidArgumentException(option,argv[i]);
440 break;
441 }
442 if (LocaleCompare("duration",option+1) == 0)
443 {
444 if (*option == '+')
445 break;
446 i++;
447 if (i == (ssize_t) argc)
448 ThrowStreamException(OptionError,"MissingArgument",option);
449 if (IsGeometry(argv[i]) == MagickFalse)
450 ThrowStreamInvalidArgumentException(option,argv[i]);
451 break;
452 }
453 ThrowStreamException(OptionError,"UnrecognizedOption",option)
454 }
455 case 'e':
456 {
457 if (LocaleCompare("extract",option+1) == 0)
458 {
459 if (*option == '+')
460 break;
461 i++;
462 if (i == (ssize_t) argc)
463 ThrowStreamException(OptionError,"MissingArgument",option);
464 if (IsGeometry(argv[i]) == MagickFalse)
465 ThrowStreamInvalidArgumentException(option,argv[i]);
466 break;
467 }
468 ThrowStreamException(OptionError,"UnrecognizedOption",option)
469 }
470 case 'h':
471 {
472 if ((LocaleCompare("help",option+1) == 0) ||
473 (LocaleCompare("-help",option+1) == 0))
474 {
475 DestroyStream();
476 return(StreamUsage());
477 }
478 ThrowStreamException(OptionError,"UnrecognizedOption",option)
479 }
480 case 'i':
481 {
482 if (LocaleCompare("identify",option+1) == 0)
483 break;
484 if (LocaleCompare("interlace",option+1) == 0)
485 {
486 ssize_t
487 interlace;
488
489 if (*option == '+')
490 break;
491 i++;
492 if (i == (ssize_t) argc)
493 ThrowStreamException(OptionError,"MissingArgument",option);
494 interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
495 argv[i]);
496 if (interlace < 0)
497 ThrowStreamException(OptionError,"UnrecognizedInterlaceType",
498 argv[i]);
499 break;
500 }
501 if (LocaleCompare("interpolate",option+1) == 0)
502 {
503 ssize_t
504 interpolate;
505
506 if (*option == '+')
507 break;
508 i++;
509 if (i == (ssize_t) argc)
510 ThrowStreamException(OptionError,"MissingArgument",option);
511 interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
512 argv[i]);
513 if (interpolate < 0)
514 ThrowStreamException(OptionError,"UnrecognizedInterpolateMethod",
515 argv[i]);
516 break;
517 }
518 ThrowStreamException(OptionError,"UnrecognizedOption",option)
519 }
520 case 'l':
521 {
522 if (LocaleCompare("limit",option+1) == 0)
523 {
524 char
525 *p;
526
527 double
528 value;
529
530 ssize_t
531 resource;
532
533 if (*option == '+')
534 break;
535 i++;
536 if (i == (ssize_t) argc)
537 ThrowStreamException(OptionError,"MissingArgument",option);
538 resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
539 argv[i]);
540 if (resource < 0)
541 ThrowStreamException(OptionError,"UnrecognizedResourceType",
542 argv[i]);
543 i++;
544 if (i == (ssize_t) argc)
545 ThrowStreamException(OptionError,"MissingArgument",option);
546 value=StringToDouble(argv[i],&p);
547 (void) value;
548 if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
549 ThrowStreamInvalidArgumentException(option,argv[i]);
550 break;
551 }
552 if (LocaleCompare("list",option+1) == 0)
553 {
554 ssize_t
555 list;
556
557 if (*option == '+')
558 break;
559 i++;
560 if (i == (ssize_t) argc)
561 ThrowStreamException(OptionError,"MissingArgument",option);
562 list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
563 if (list < 0)
564 ThrowStreamException(OptionError,"UnrecognizedListType",argv[i]);
565 status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
566 argv+j,exception);
567 DestroyStream();
568 return(status == 0 ? MagickFalse : MagickTrue);
569 }
570 if (LocaleCompare("log",option+1) == 0)
571 {
572 if (*option == '+')
573 break;
574 i++;
575 if ((i == (ssize_t) argc) || (strchr(argv[i],'%') == (char *) NULL))
576 ThrowStreamException(OptionError,"MissingArgument",option);
577 break;
578 }
579 ThrowStreamException(OptionError,"UnrecognizedOption",option)
580 }
581 case 'm':
582 {
583 if (LocaleCompare("map",option+1) == 0)
584 {
585 (void) CopyMagickString(argv[i]+1,"san",MagickPathExtent);
586 if (*option == '+')
587 break;
588 i++;
589 SetStreamInfoMap(stream_info,argv[i]);
590 break;
591 }
592 if (LocaleCompare("monitor",option+1) == 0)
593 break;
594 ThrowStreamException(OptionError,"UnrecognizedOption",option)
595 }
596 case 'q':
597 {
598 if (LocaleCompare("quantize",option+1) == 0)
599 {
600 ssize_t
601 colorspace;
602
603 if (*option == '+')
604 break;
605 i++;
606 if (i == (ssize_t) argc)
607 ThrowStreamException(OptionError,"MissingArgument",option);
608 colorspace=ParseCommandOption(MagickColorspaceOptions,
609 MagickFalse,argv[i]);
610 if (colorspace < 0)
611 ThrowStreamException(OptionError,"UnrecognizedColorspace",
612 argv[i]);
613 break;
614 }
615 if (LocaleCompare("quiet",option+1) == 0)
616 break;
617 ThrowStreamException(OptionError,"UnrecognizedOption",option)
618 }
619 case 'r':
620 {
621 if (LocaleCompare("regard-warnings",option+1) == 0)
622 break;
623 if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
624 {
625 respect_parentheses=(*option == '-') ? MagickTrue : MagickFalse;
626 break;
627 }
628 ThrowStreamException(OptionError,"UnrecognizedOption",option)
629 }
630 case 's':
631 {
632 if (LocaleCompare("sampling-factor",option+1) == 0)
633 {
634 if (*option == '+')
635 break;
636 i++;
637 if (i == (ssize_t) argc)
638 ThrowStreamException(OptionError,"MissingArgument",option);
639 if (IsGeometry(argv[i]) == MagickFalse)
640 ThrowStreamInvalidArgumentException(option,argv[i]);
641 break;
642 }
643 if (LocaleCompare("seed",option+1) == 0)
644 {
645 if (*option == '+')
646 break;
647 i++;
648 if (i == (ssize_t) argc)
649 ThrowStreamException(OptionError,"MissingArgument",option);
650 if (IsGeometry(argv[i]) == MagickFalse)
651 ThrowStreamInvalidArgumentException(option,argv[i]);
652 break;
653 }
654 if (LocaleCompare("set",option+1) == 0)
655 {
656 i++;
657 if (i == (ssize_t) argc)
658 ThrowStreamException(OptionError,"MissingArgument",option);
659 if (*option == '+')
660 break;
661 i++;
662 if (i == (ssize_t) argc)
663 ThrowStreamException(OptionError,"MissingArgument",option);
664 break;
665 }
666 if (LocaleCompare("size",option+1) == 0)
667 {
668 if (*option == '+')
669 break;
670 i++;
671 if (i == (ssize_t) argc)
672 ThrowStreamException(OptionError,"MissingArgument",option);
673 if (IsGeometry(argv[i]) == MagickFalse)
674 ThrowStreamInvalidArgumentException(option,argv[i]);
675 break;
676 }
677 if (LocaleCompare("storage-type",option+1) == 0)
678 {
679 ssize_t
680 type;
681
682 if (*option == '+')
683 break;
684 i++;
685 if (i == (ssize_t) argc)
686 ThrowStreamException(OptionError,"MissingArgument",option);
687 type=ParseCommandOption(MagickStorageOptions,MagickFalse,argv[i]);
688 if (type < 0)
689 ThrowStreamException(OptionError,"UnrecognizedStorageType",
690 argv[i]);
691 SetStreamInfoStorageType(stream_info,(StorageType) type);
692 break;
693 }
694 if (LocaleCompare("synchronize",option+1) == 0)
695 break;
696 ThrowStreamException(OptionError,"UnrecognizedOption",option)
697 }
698 case 't':
699 {
700 if (LocaleCompare("taint",option+1) == 0)
701 break;
702 if (LocaleCompare("transparent-color",option+1) == 0)
703 {
704 if (*option == '+')
705 break;
706 i++;
707 if (i == (ssize_t) argc)
708 ThrowStreamException(OptionError,"MissingArgument",option);
709 break;
710 }
711 ThrowStreamException(OptionError,"UnrecognizedOption",option)
712 }
713 case 'v':
714 {
715 if (LocaleCompare("verbose",option+1) == 0)
716 break;
717 if ((LocaleCompare("version",option+1) == 0) ||
718 (LocaleCompare("-version",option+1) == 0))
719 {
720 ListMagickVersion(stdout);
721 break;
722 }
723 if (LocaleCompare("virtual-pixel",option+1) == 0)
724 {
725 ssize_t
726 method;
727
728 if (*option == '+')
729 break;
730 i++;
731 if (i == (ssize_t) argc)
732 ThrowStreamException(OptionError,"MissingArgument",option);
733 method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
734 argv[i]);
735 if (method < 0)
736 ThrowStreamException(OptionError,"UnrecognizedVirtualPixelMethod",
737 argv[i]);
738 break;
739 }
740 ThrowStreamException(OptionError,"UnrecognizedOption",option)
741 }
742 case '?':
743 break;
744 default:
745 ThrowStreamException(OptionError,"UnrecognizedOption",option)
746 }
747 fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
748 FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
749 if (fire != MagickFalse)
750 FireImageStack(MagickFalse,MagickTrue,MagickTrue);
751 }
752 if (k != 0)
753 ThrowStreamException(OptionError,"UnbalancedParenthesis",argv[i]);
754 if (i-- != ((ssize_t) argc-1))
755 ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
756 if (image == (Image *) NULL)
757 ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
758 FinalizeImageSettings(image_info,image,MagickTrue);
759 if (image == (Image *) NULL)
760 ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
761 DestroyStream();
762 return(status != 0 ? MagickTrue : MagickFalse);
763}