MagickWand  7.0.3
stream.c
Go to the documentation of this file.
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-2019 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/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 % 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"
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 
87 static 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(MagickFalse);
148 }
149 
150 WandExport 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  (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
164  option); \
165  DestroyStream(); \
166  return(MagickFalse); \
167 }
168 #define ThrowStreamInvalidArgumentException(option,argument) \
169 { \
170  (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
171  "InvalidArgument","'%s': %s",option,argument); \
172  DestroyStream(); \
173  return(MagickFalse); \
174 }
175 
176  char
177  *filename,
178  *option;
179 
180  const char
181  *format;
182 
183  Image
184  *image;
185 
186  ImageStack
187  image_stack[MaxImageStackDepth+1];
188 
189  MagickBooleanType
190  fire,
191  pend,
192  respect_parenthesis;
193 
194  MagickStatusType
195  status;
196 
197  register ssize_t
198  i;
199 
200  ssize_t
201  j,
202  k;
203 
204  StreamInfo
205  *stream_info;
206 
207  /*
208  Set defaults.
209  */
210  assert(image_info != (ImageInfo *) NULL);
211  assert(image_info->signature == MagickCoreSignature);
212  if (image_info->debug != MagickFalse)
213  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
214  assert(exception != (ExceptionInfo *) NULL);
215  (void) metadata;
216  if (argc == 2)
217  {
218  option=argv[1];
219  if ((LocaleCompare("version",option+1) == 0) ||
220  (LocaleCompare("-version",option+1) == 0))
221  {
222  ListMagickVersion(stdout);
223  return(MagickFalse);
224  }
225  }
226  if (argc < 3)
227  return(StreamUsage());
228  format="%w,%h,%m";
229  (void) format;
230  j=1;
231  k=0;
232  NewImageStack();
233  option=(char *) NULL;
234  pend=MagickFalse;
235  respect_parenthesis=MagickFalse;
236  stream_info=AcquireStreamInfo(image_info,exception);
237  status=MagickTrue;
238  /*
239  Stream an image.
240  */
241  ReadCommandlLine(argc,&argv);
242  status=ExpandFilenames(&argc,&argv);
243  if (status == MagickFalse)
244  ThrowStreamException(ResourceLimitError,"MemoryAllocationFailed",
245  GetExceptionMessage(errno));
246  status=OpenStream(image_info,stream_info,argv[argc-1],exception);
247  if (status == MagickFalse)
248  {
249  DestroyStream();
250  return(MagickFalse);
251  }
252  for (i=1; i < (ssize_t) (argc-1); i++)
253  {
254  option=argv[i];
255  if (LocaleCompare(option,"(") == 0)
256  {
257  FireImageStack(MagickFalse,MagickTrue,pend);
258  if (k == MaxImageStackDepth)
259  ThrowStreamException(OptionError,"ParenthesisNestedTooDeeply",option);
260  PushImageStack();
261  continue;
262  }
263  if (LocaleCompare(option,")") == 0)
264  {
265  FireImageStack(MagickFalse,MagickTrue,MagickTrue);
266  if (k == 0)
267  ThrowStreamException(OptionError,"UnableToParseExpression",option);
268  PopImageStack();
269  continue;
270  }
271  if (IsCommandOption(option) == MagickFalse)
272  {
273  Image
274  *images;
275 
276  /*
277  Stream input image.
278  */
279  FireImageStack(MagickFalse,MagickFalse,pend);
280  filename=argv[i];
281  if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
282  filename=argv[++i];
283  (void) CopyMagickString(image_info->filename,filename,MagickPathExtent);
284  images=StreamImage(image_info,stream_info,exception);
285  status&=(images != (Image *) NULL) &&
286  (exception->severity < ErrorException);
287  if (images == (Image *) NULL)
288  continue;
289  AppendImageStack(images);
290  continue;
291  }
292  pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
293  switch (*(option+1))
294  {
295  case 'a':
296  {
297  if (LocaleCompare("authenticate",option+1) == 0)
298  {
299  if (*option == '+')
300  break;
301  i++;
302  if (i == (ssize_t) argc)
303  ThrowStreamException(OptionError,"MissingArgument",option);
304  break;
305  }
306  ThrowStreamException(OptionError,"UnrecognizedOption",option)
307  }
308  case 'c':
309  {
310  if (LocaleCompare("cache",option+1) == 0)
311  {
312  if (*option == '+')
313  break;
314  i++;
315  if (i == (ssize_t) argc)
316  ThrowStreamException(OptionError,"MissingArgument",option);
317  if (IsGeometry(argv[i]) == MagickFalse)
318  ThrowStreamInvalidArgumentException(option,argv[i]);
319  break;
320  }
321  if (LocaleCompare("channel",option+1) == 0)
322  {
323  ssize_t
324  channel;
325 
326  if (*option == '+')
327  break;
328  i++;
329  if (i == (ssize_t) argc)
330  ThrowStreamException(OptionError,"MissingArgument",option);
331  channel=ParseChannelOption(argv[i]);
332  if (channel < 0)
333  ThrowStreamException(OptionError,"UnrecognizedChannelType",
334  argv[i]);
335  break;
336  }
337  if (LocaleCompare("colorspace",option+1) == 0)
338  {
339  ssize_t
340  colorspace;
341 
342  if (*option == '+')
343  break;
344  i++;
345  if (i == (ssize_t) argc)
346  ThrowStreamException(OptionError,"MissingArgument",option);
347  colorspace=ParseCommandOption(MagickColorspaceOptions,MagickFalse,
348  argv[i]);
349  if (colorspace < 0)
350  ThrowStreamException(OptionError,"UnrecognizedColorspace",
351  argv[i]);
352  break;
353  }
354  if (LocaleCompare("compress",option+1) == 0)
355  {
356  ssize_t
357  compress;
358 
359  if (*option == '+')
360  break;
361  i++;
362  if (i == (ssize_t) argc)
363  ThrowStreamException(OptionError,"MissingArgument",option);
364  compress=ParseCommandOption(MagickCompressOptions,MagickFalse,
365  argv[i]);
366  if (compress < 0)
367  ThrowStreamException(OptionError,"UnrecognizedImageCompression",
368  argv[i]);
369  break;
370  }
371  if (LocaleCompare("concurrent",option+1) == 0)
372  break;
373  ThrowStreamException(OptionError,"UnrecognizedOption",option)
374  }
375  case 'd':
376  {
377  if (LocaleCompare("debug",option+1) == 0)
378  {
379  ssize_t
380  event;
381 
382  if (*option == '+')
383  break;
384  i++;
385  if (i == (ssize_t) argc)
386  ThrowStreamException(OptionError,"MissingArgument",option);
387  event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
388  if (event < 0)
389  ThrowStreamException(OptionError,"UnrecognizedEventType",argv[i]);
390  (void) SetLogEventMask(argv[i]);
391  break;
392  }
393  if (LocaleCompare("define",option+1) == 0)
394  {
395  i++;
396  if (i == (ssize_t) argc)
397  ThrowStreamException(OptionError,"MissingArgument",option);
398  if (*option == '+')
399  {
400  const char
401  *define;
402 
403  define=GetImageOption(image_info,argv[i]);
404  if (define == (const char *) NULL)
405  ThrowStreamException(OptionError,"NoSuchOption",argv[i]);
406  break;
407  }
408  break;
409  }
410  if (LocaleCompare("density",option+1) == 0)
411  {
412  if (*option == '+')
413  break;
414  i++;
415  if (i == (ssize_t) argc)
416  ThrowStreamException(OptionError,"MissingArgument",option);
417  if (IsGeometry(argv[i]) == MagickFalse)
418  ThrowStreamInvalidArgumentException(option,argv[i]);
419  break;
420  }
421  if (LocaleCompare("depth",option+1) == 0)
422  {
423  if (*option == '+')
424  break;
425  i++;
426  if (i == (ssize_t) argc)
427  ThrowStreamException(OptionError,"MissingArgument",option);
428  if (IsGeometry(argv[i]) == MagickFalse)
429  ThrowStreamInvalidArgumentException(option,argv[i]);
430  break;
431  }
432  if (LocaleCompare("duration",option+1) == 0)
433  {
434  if (*option == '+')
435  break;
436  i++;
437  if (i == (ssize_t) argc)
438  ThrowStreamException(OptionError,"MissingArgument",option);
439  if (IsGeometry(argv[i]) == MagickFalse)
440  ThrowStreamInvalidArgumentException(option,argv[i]);
441  break;
442  }
443  ThrowStreamException(OptionError,"UnrecognizedOption",option)
444  }
445  case 'e':
446  {
447  if (LocaleCompare("extract",option+1) == 0)
448  {
449  if (*option == '+')
450  break;
451  i++;
452  if (i == (ssize_t) argc)
453  ThrowStreamException(OptionError,"MissingArgument",option);
454  if (IsGeometry(argv[i]) == MagickFalse)
455  ThrowStreamInvalidArgumentException(option,argv[i]);
456  break;
457  }
458  ThrowStreamException(OptionError,"UnrecognizedOption",option)
459  }
460  case 'h':
461  {
462  if ((LocaleCompare("help",option+1) == 0) ||
463  (LocaleCompare("-help",option+1) == 0))
464  return(StreamUsage());
465  ThrowStreamException(OptionError,"UnrecognizedOption",option)
466  }
467  case 'i':
468  {
469  if (LocaleCompare("identify",option+1) == 0)
470  break;
471  if (LocaleCompare("interlace",option+1) == 0)
472  {
473  ssize_t
474  interlace;
475 
476  if (*option == '+')
477  break;
478  i++;
479  if (i == (ssize_t) argc)
480  ThrowStreamException(OptionError,"MissingArgument",option);
481  interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
482  argv[i]);
483  if (interlace < 0)
484  ThrowStreamException(OptionError,"UnrecognizedInterlaceType",
485  argv[i]);
486  break;
487  }
488  if (LocaleCompare("interpolate",option+1) == 0)
489  {
490  ssize_t
491  interpolate;
492 
493  if (*option == '+')
494  break;
495  i++;
496  if (i == (ssize_t) argc)
497  ThrowStreamException(OptionError,"MissingArgument",option);
498  interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
499  argv[i]);
500  if (interpolate < 0)
501  ThrowStreamException(OptionError,"UnrecognizedInterpolateMethod",
502  argv[i]);
503  break;
504  }
505  ThrowStreamException(OptionError,"UnrecognizedOption",option)
506  }
507  case 'l':
508  {
509  if (LocaleCompare("limit",option+1) == 0)
510  {
511  char
512  *p;
513 
514  double
515  value;
516 
517  ssize_t
518  resource;
519 
520  if (*option == '+')
521  break;
522  i++;
523  if (i == (ssize_t) argc)
524  ThrowStreamException(OptionError,"MissingArgument",option);
525  resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
526  argv[i]);
527  if (resource < 0)
528  ThrowStreamException(OptionError,"UnrecognizedResourceType",
529  argv[i]);
530  i++;
531  if (i == (ssize_t) argc)
532  ThrowStreamException(OptionError,"MissingArgument",option);
533  value=StringToDouble(argv[i],&p);
534  (void) value;
535  if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
536  ThrowStreamInvalidArgumentException(option,argv[i]);
537  break;
538  }
539  if (LocaleCompare("list",option+1) == 0)
540  {
541  ssize_t
542  list;
543 
544  if (*option == '+')
545  break;
546  i++;
547  if (i == (ssize_t) argc)
548  ThrowStreamException(OptionError,"MissingArgument",option);
549  list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
550  if (list < 0)
551  ThrowStreamException(OptionError,"UnrecognizedListType",argv[i]);
552  status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
553  argv+j,exception);
554  DestroyStream();
555  return(status == 0 ? MagickFalse : MagickTrue);
556  }
557  if (LocaleCompare("log",option+1) == 0)
558  {
559  if (*option == '+')
560  break;
561  i++;
562  if ((i == (ssize_t) argc) || (strchr(argv[i],'%') == (char *) NULL))
563  ThrowStreamException(OptionError,"MissingArgument",option);
564  break;
565  }
566  ThrowStreamException(OptionError,"UnrecognizedOption",option)
567  }
568  case 'm':
569  {
570  if (LocaleCompare("map",option+1) == 0)
571  {
572  (void) CopyMagickString(argv[i]+1,"san",MagickPathExtent);
573  if (*option == '+')
574  break;
575  i++;
576  SetStreamInfoMap(stream_info,argv[i]);
577  break;
578  }
579  if (LocaleCompare("monitor",option+1) == 0)
580  break;
581  ThrowStreamException(OptionError,"UnrecognizedOption",option)
582  }
583  case 'q':
584  {
585  if (LocaleCompare("quantize",option+1) == 0)
586  {
587  ssize_t
588  colorspace;
589 
590  if (*option == '+')
591  break;
592  i++;
593  if (i == (ssize_t) argc)
594  ThrowStreamException(OptionError,"MissingArgument",option);
595  colorspace=ParseCommandOption(MagickColorspaceOptions,
596  MagickFalse,argv[i]);
597  if (colorspace < 0)
598  ThrowStreamException(OptionError,"UnrecognizedColorspace",
599  argv[i]);
600  break;
601  }
602  if (LocaleCompare("quiet",option+1) == 0)
603  break;
604  ThrowStreamException(OptionError,"UnrecognizedOption",option)
605  }
606  case 'r':
607  {
608  if (LocaleCompare("regard-warnings",option+1) == 0)
609  break;
610  if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
611  {
612  respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
613  break;
614  }
615  ThrowStreamException(OptionError,"UnrecognizedOption",option)
616  }
617  case 's':
618  {
619  if (LocaleCompare("sampling-factor",option+1) == 0)
620  {
621  if (*option == '+')
622  break;
623  i++;
624  if (i == (ssize_t) argc)
625  ThrowStreamException(OptionError,"MissingArgument",option);
626  if (IsGeometry(argv[i]) == MagickFalse)
627  ThrowStreamInvalidArgumentException(option,argv[i]);
628  break;
629  }
630  if (LocaleCompare("seed",option+1) == 0)
631  {
632  if (*option == '+')
633  break;
634  i++;
635  if (i == (ssize_t) argc)
636  ThrowStreamException(OptionError,"MissingArgument",option);
637  if (IsGeometry(argv[i]) == MagickFalse)
638  ThrowStreamInvalidArgumentException(option,argv[i]);
639  break;
640  }
641  if (LocaleCompare("set",option+1) == 0)
642  {
643  i++;
644  if (i == (ssize_t) argc)
645  ThrowStreamException(OptionError,"MissingArgument",option);
646  if (*option == '+')
647  break;
648  i++;
649  if (i == (ssize_t) argc)
650  ThrowStreamException(OptionError,"MissingArgument",option);
651  break;
652  }
653  if (LocaleCompare("size",option+1) == 0)
654  {
655  if (*option == '+')
656  break;
657  i++;
658  if (i == (ssize_t) argc)
659  ThrowStreamException(OptionError,"MissingArgument",option);
660  if (IsGeometry(argv[i]) == MagickFalse)
661  ThrowStreamInvalidArgumentException(option,argv[i]);
662  break;
663  }
664  if (LocaleCompare("storage-type",option+1) == 0)
665  {
666  ssize_t
667  type;
668 
669  if (*option == '+')
670  break;
671  i++;
672  if (i == (ssize_t) argc)
673  ThrowStreamException(OptionError,"MissingArgument",option);
674  type=ParseCommandOption(MagickStorageOptions,MagickFalse,argv[i]);
675  if (type < 0)
676  ThrowStreamException(OptionError,"UnrecognizedStorageType",
677  argv[i]);
678  SetStreamInfoStorageType(stream_info,(StorageType) type);
679  break;
680  }
681  if (LocaleCompare("synchronize",option+1) == 0)
682  break;
683  ThrowStreamException(OptionError,"UnrecognizedOption",option)
684  }
685  case 't':
686  {
687  if (LocaleCompare("taint",option+1) == 0)
688  break;
689  if (LocaleCompare("transparent-color",option+1) == 0)
690  {
691  if (*option == '+')
692  break;
693  i++;
694  if (i == (ssize_t) argc)
695  ThrowStreamException(OptionError,"MissingArgument",option);
696  break;
697  }
698  ThrowStreamException(OptionError,"UnrecognizedOption",option)
699  }
700  case 'v':
701  {
702  if (LocaleCompare("verbose",option+1) == 0)
703  break;
704  if ((LocaleCompare("version",option+1) == 0) ||
705  (LocaleCompare("-version",option+1) == 0))
706  {
707  ListMagickVersion(stdout);
708  break;
709  }
710  if (LocaleCompare("virtual-pixel",option+1) == 0)
711  {
712  ssize_t
713  method;
714 
715  if (*option == '+')
716  break;
717  i++;
718  if (i == (ssize_t) argc)
719  ThrowStreamException(OptionError,"MissingArgument",option);
720  method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
721  argv[i]);
722  if (method < 0)
723  ThrowStreamException(OptionError,"UnrecognizedVirtualPixelMethod",
724  argv[i]);
725  break;
726  }
727  ThrowStreamException(OptionError,"UnrecognizedOption",option)
728  }
729  case '?':
730  break;
731  default:
732  ThrowStreamException(OptionError,"UnrecognizedOption",option)
733  }
734  fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
735  FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
736  if (fire != MagickFalse)
737  FireImageStack(MagickFalse,MagickTrue,MagickTrue);
738  }
739  if (k != 0)
740  ThrowStreamException(OptionError,"UnbalancedParenthesis",argv[i]);
741  if (i-- != (ssize_t) (argc-1))
742  ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
743  if (image == (Image *) NULL)
744  ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
745  FinalizeImageSettings(image_info,image,MagickTrue);
746  if (image == (Image *) NULL)
747  ThrowStreamException(OptionError,"MissingAnImageFilename",argv[i]);
748  DestroyStream();
749  return(status != 0 ? MagickTrue : MagickFalse);
750 }
#define FinalizeImageSettings(image_info, image, advance)
#define NewImageStack()
ExceptionInfo * exception
Definition: pixel-wand.c:72
#define WandExport
#define AppendImageStack(images)
WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, const int argc, const char **argv, ExceptionInfo *exception)
Definition: mogrify.c:6577
#define MagickPathExtent
#define ReadCommandlLine(argc, argv)
Definition: studio.h:260
#define DestroyStream()
static MagickBooleanType StreamUsage(void)
Definition: stream.c:87
#define PopImageStack()
#define ThrowStreamInvalidArgumentException(option, argument)
WandExport MagickBooleanType StreamImageCommand(ImageInfo *image_info, int argc, char **argv, char **metadata, ExceptionInfo *exception)
Definition: stream.c:150
#define PushImageStack()
#define ThrowStreamException(asperity, tag, option)
#define FireImageStack(postfix, advance, fire)
#define MaxImageStackDepth