MagickWand  7.0.3
animate.c
Go to the documentation of this file.
1 /*
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % %
4 % %
5 % %
6 % AAA N N IIIII M M AAA TTTTT EEEEE %
7 % A A NN N I MM MM A A T E %
8 % AAAAA N N N I M M M AAAAA T EEE %
9 % A A N NN I M M A A T E %
10 % A A N N IIIII M M A A T EEEEE %
11 % %
12 % %
13 % Methods to Interactively Animate an Image Sequence %
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 % Use the animate program to animate an image sequence on any X server.
37 %
38 */
39 
40 /*
41  Include declarations.
42 */
43 #include "MagickWand/studio.h"
44 #include "MagickWand/MagickWand.h"
46 #include "MagickCore/animate-private.h"
47 #include "MagickCore/string-private.h"
48 
49 /*
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 % %
52 % %
53 % %
54 + A n i m a t e I m a g e C o m m a n d %
55 % %
56 % %
57 % %
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %
60 % AnimateImageCommand() displays a sequence of images on any workstation
61 % display running an X server. Animate first determines the hardware
62 % capabilities of the workstation. If the number of unique colors in an image
63 % is less than or equal to the number the workstation can support, the image
64 % is displayed in an X window. Otherwise the number of colors in the image is
65 % first reduced to match the color resolution of the workstation before it is
66 % displayed.
67 %
68 % This means that a continuous-tone 24 bits/pixel image can display on a 8
69 % bit pseudo-color device or monochrome device. In most instances the reduced
70 % color image closely resembles the original. Alternatively, a monochrome or
71 % pseudo-color image sequence can display on a continuous-tone 24 bits/pixels
72 % device.
73 %
74 % The format of the AnimateImageCommand method is:
75 %
76 % MagickBooleanType AnimateImageCommand(ImageInfo *image_info,int argc,
77 % char **argv,char **metadata,ExceptionInfo *exception)
78 %
79 % A description of each parameter follows:
80 %
81 % o image_info: the image info.
82 %
83 % o argc: the number of elements in the argument vector.
84 %
85 % o argv: A text array containing the command line arguments.
86 %
87 % o metadata: any metadata is returned here.
88 %
89 % o exception: return any errors or warnings in this structure.
90 %
91 */
92 
93 static MagickBooleanType AnimateUsage(void)
94 {
95  static const char
96  buttons[] =
97  " Press any button to map or unmap the Command widget",
98  miscellaneous[] =
99  " -debug events display copious debugging information\n"
100  " -help print program options\n"
101  " -list type print a list of supported option arguments\n"
102  " -log format format of debugging information\n"
103  " -version print version information",
104  operators[] =
105  " -channel mask set the image channel mask\n"
106  " -colors value preferred number of colors in the image\n"
107  " -crop geometry preferred size and location of the cropped image\n"
108  " -extract geometry extract area from image\n"
109  " -monochrome transform image to black and white\n"
110  " -resample geometry change the resolution of an image\n"
111  " -resize geometry resize the image\n"
112  " -rotate degrees apply Paeth rotation to the image\n"
113  " -strip strip image of all profiles and comments\n"
114  " -thumbnail geometry create a thumbnail of the image\n"
115  " -trim trim image edges",
116  settings[] =
117  " -alpha option on, activate, off, deactivate, set, opaque, copy\n"
118  " transparent, extract, background, or shape\n"
119  " -authenticate password\n"
120  " decipher image with this password\n"
121  " -backdrop display image centered on a backdrop\n"
122  " -colormap type Shared or Private\n"
123  " -colorspace type alternate image colorspace\n"
124  " -decipher filename convert cipher pixels to plain pixels\n"
125  " -define format:option\n"
126  " define one or more image format options\n"
127  " -delay value display the next image after pausing\n"
128  " -density geometry horizontal and vertical density of the image\n"
129  " -depth value image depth\n"
130  " -display server display image to this X server\n"
131  " -dispose method layer disposal method\n"
132  " -dither method apply error diffusion to image\n"
133  " -filter type use this filter when resizing an image\n"
134  " -format \"string\" output formatted image characteristics\n"
135  " -gamma value level of gamma correction\n"
136  " -geometry geometry preferred size and location of the Image window\n"
137  " -gravity type horizontal and vertical backdrop placement\n"
138  " -identify identify the format and characteristics of the image\n"
139  " -immutable displayed image cannot be modified\n"
140  " -interlace type type of image interlacing scheme\n"
141  " -interpolate method pixel color interpolation method\n"
142  " -limit type value pixel cache resource limit\n"
143  " -loop iterations loop images then exit\n"
144  " -matte store matte channel if the image has one\n"
145  " -map type display image using this Standard Colormap\n"
146  " -monitor monitor progress\n"
147  " -pause seconds to pause before reanimating\n"
148  " -page geometry size and location of an image canvas (setting)\n"
149  " -quantize colorspace reduce colors in this colorspace\n"
150  " -quiet suppress all warning messages\n"
151  " -regard-warnings pay attention to warning messages\n"
152  " -remote command execute a command in an remote display process\n"
153  " -repage geometry size and location of an image canvas (operator)\n"
154  " -respect-parentheses settings remain in effect until parenthesis boundary\n"
155  " -sampling-factor geometry\n"
156  " horizontal and vertical sampling factor\n"
157  " -scenes range image scene range\n"
158  " -seed value seed a new sequence of pseudo-random numbers\n"
159  " -set attribute value set an image attribute\n"
160  " -size geometry width and height of image\n"
161  " -support factor resize support: > 1.0 is blurry, < 1.0 is sharp\n"
162  " -transparent-color color\n"
163  " transparent color\n"
164  " -treedepth value color tree depth\n"
165  " -verbose print detailed information about the image\n"
166  " -visual type display image using this visual type\n"
167  " -virtual-pixel method\n"
168  " virtual pixel access method\n"
169  " -window id display image to background of this window",
170  sequence_operators[] =
171  " -coalesce merge a sequence of images\n"
172  " -flatten flatten a sequence of images";
173 
174  ListMagickVersion(stdout);
175  (void) printf("Usage: %s [options ...] file [ [options ...] file ...]\n",
176  GetClientName());
177  (void) printf("\nImage Settings:\n");
178  (void) puts(settings);
179  (void) printf("\nImage Operators:\n");
180  (void) puts(operators);
181  (void) printf("\nImage Sequence Operators:\n");
182  (void) puts(sequence_operators);
183  (void) printf("\nMiscellaneous Options:\n");
184  (void) puts(miscellaneous);
185  (void) printf(
186  "\nIn addition to those listed above, you can specify these standard X\n");
187  (void) printf(
188  "resources as command line options: -background, -bordercolor,\n");
189  (void) printf(
190  "-mattecolor, -borderwidth, -font, -foreground, -iconGeometry,\n");
191  (void) printf("-iconic, -name, -shared-memory, or -title.\n");
192  (void) printf(
193  "\nBy default, the image format of 'file' is determined by its magic\n");
194  (void) printf(
195  "number. To specify a particular image format, precede the filename\n");
196  (void) printf(
197  "with an image format name and a colon (i.e. ps:image) or specify the\n");
198  (void) printf(
199  "image type as the filename suffix (i.e. image.ps). Specify 'file' as\n");
200  (void) printf("'-' for standard input or output.\n");
201  (void) printf("\nButtons: \n");
202  (void) puts(buttons);
203  return(MagickFalse);
204 }
205 
206 WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info,
207  int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
208 {
209 #if defined(MAGICKCORE_X11_DELEGATE)
210 #define DestroyAnimate() \
211 { \
212  XDestroyResourceInfo(&resource_info); \
213  if (display != (Display *) NULL) \
214  { \
215  XCloseDisplay(display); \
216  display=(Display *) NULL; \
217  } \
218  XDestroyResourceInfo(&resource_info); \
219  DestroyImageStack(); \
220  for (i=0; i < (ssize_t) argc; i++) \
221  argv[i]=DestroyString(argv[i]); \
222  argv=(char **) RelinquishMagickMemory(argv); \
223 }
224 #define ThrowAnimateException(asperity,tag,option) \
225 { \
226  (void) ThrowMagickException(exception,GetMagickModule(),asperity,tag,"`%s'", \
227  option); \
228  DestroyAnimate(); \
229  return(MagickFalse); \
230 }
231 #define ThrowAnimateInvalidArgumentException(option,argument) \
232 { \
233  (void) ThrowMagickException(exception,GetMagickModule(),OptionError, \
234  "InvalidArgument","'%s': %s",option,argument); \
235  DestroyAnimate(); \
236  return(MagickFalse); \
237 }
238 
239  char
240  *resource_value,
241  *server_name;
242 
243  const char
244  *option;
245 
246  Display
247  *display;
248 
249  Image
250  *image;
251 
252  ImageStack
253  image_stack[MaxImageStackDepth+1];
254 
255  MagickBooleanType
256  fire,
257  pend,
258  respect_parenthesis;
259 
260  MagickStatusType
261  status;
262 
263  QuantizeInfo
264  *quantize_info;
265 
266  register ssize_t
267  i;
268 
269  ssize_t
270  j,
271  k;
272 
273  XResourceInfo
274  resource_info;
275 
276  XrmDatabase
277  resource_database;
278 
279  /*
280  Set defaults.
281  */
282  assert(image_info != (ImageInfo *) NULL);
283  assert(image_info->signature == MagickCoreSignature);
284  if (image_info->debug != MagickFalse)
285  (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
286  assert(exception != (ExceptionInfo *) NULL);
287  if (argc == 2)
288  {
289  option=argv[1];
290  if ((LocaleCompare("version",option+1) == 0) ||
291  (LocaleCompare("-version",option+1) == 0))
292  {
293  ListMagickVersion(stdout);
294  return(MagickTrue);
295  }
296  }
297  status=MagickTrue;
299  display=(Display *) NULL;
300  j=1;
301  k=0;
302  NewImageStack();
303  option=(char *) NULL;
304  pend=MagickFalse;
305  respect_parenthesis=MagickFalse;
306  resource_database=(XrmDatabase) NULL;
307  (void) memset(&resource_info,0,sizeof(XResourceInfo));
308  server_name=(char *) NULL;
309  status=MagickTrue;
310  /*
311  Check for server name specified on the command line.
312  */
313  ReadCommandlLine(argc,&argv);
314  status=ExpandFilenames(&argc,&argv);
315  if (status == MagickFalse)
316  ThrowAnimateException(ResourceLimitError,"MemoryAllocationFailed",
317  image_info->filename);
318  for (i=1; i < (ssize_t) argc; i++)
319  {
320  /*
321  Check command line for server name.
322  */
323  option=argv[i];
324  if (IsCommandOption(option) == MagickFalse)
325  continue;
326  if (LocaleCompare("display",option+1) == 0)
327  {
328  /*
329  User specified server name.
330  */
331  i++;
332  if (i == (ssize_t) argc)
333  ThrowAnimateException(OptionError,"MissingArgument",option);
334  server_name=argv[i];
335  }
336  if ((LocaleCompare("help",option+1) == 0) ||
337  (LocaleCompare("-help",option+1) == 0))
338  return(AnimateUsage());
339  }
340  /*
341  Get user defaults from X resource database.
342  */
343  display=XOpenDisplay(server_name);
344  if (display == (Display *) NULL)
345  ThrowAnimateException(XServerError,"UnableToOpenXServer",
346  XDisplayName(server_name));
347  (void) XSetErrorHandler(XError);
348  resource_database=XGetResourceDatabase(display,GetClientName());
349  XGetResourceInfo(image_info,resource_database,GetClientName(),
350  &resource_info);
351  quantize_info=resource_info.quantize_info;
352  image_info->density=XGetResourceInstance(resource_database,GetClientName(),
353  "density",(char *) NULL);
354  if (image_info->density == (char *) NULL)
355  image_info->density=XGetScreenDensity(display);
356  resource_value=XGetResourceInstance(resource_database,GetClientName(),
357  "interlace","none");
358  image_info->interlace=(InterlaceType)
359  ParseCommandOption(MagickInterlaceOptions,MagickFalse,resource_value);
360  resource_value=XGetResourceInstance(resource_database,GetClientName(),
361  "verbose","False");
362  image_info->verbose=IsStringTrue(resource_value);
363  resource_value=XGetResourceInstance(resource_database,GetClientName(),
364  "dither","True");
365  quantize_info->dither_method=IsStringTrue(resource_value) != MagickFalse ?
366  RiemersmaDitherMethod : NoDitherMethod;
367  /*
368  Parse command line.
369  */
370  for (i=1; i <= (ssize_t) argc; i++)
371  {
372  if (i < (ssize_t) argc)
373  option=argv[i];
374  else
375  if (image != (Image *) NULL)
376  break;
377  else
378  if (isatty(STDIN_FILENO) != MagickFalse)
379  option="logo:";
380  else
381  option="-";
382  if (LocaleCompare(option,"(") == 0)
383  {
384  FireImageStack(MagickFalse,MagickTrue,pend);
385  if (k == MaxImageStackDepth)
386  ThrowAnimateException(OptionError,"ParenthesisNestedTooDeeply",
387  option);
388  PushImageStack();
389  continue;
390  }
391  if (LocaleCompare(option,")") == 0)
392  {
393  FireImageStack(MagickFalse,MagickTrue,MagickTrue);
394  if (k == 0)
395  ThrowAnimateException(OptionError,"UnableToParseExpression",option);
396  PopImageStack();
397  continue;
398  }
399  if (IsCommandOption(option) == MagickFalse)
400  {
401  const char
402  *filename;
403 
404  Image
405  *images;
406 
407  /*
408  Read input image.
409  */
410  FireImageStack(MagickFalse,MagickFalse,pend);
411  filename=option;
412  if ((LocaleCompare(filename,"--") == 0) && (i < (ssize_t) (argc-1)))
413  {
414  option=argv[++i];
415  filename=option;
416  }
417  if (image_info->ping != MagickFalse)
418  images=PingImages(image_info,filename,exception);
419  else
420  images=ReadImages(image_info,filename,exception);
421  status&=(images != (Image *) NULL) &&
422  (exception->severity < ErrorException);
423  if (images == (Image *) NULL)
424  continue;
425  AppendImageStack(images);
426  continue;
427  }
428  pend=image != (Image *) NULL ? MagickTrue : MagickFalse;
429  switch (*(option+1))
430  {
431  case 'a':
432  {
433  if (LocaleCompare("alpha",option+1) == 0)
434  {
435  ssize_t
436  type;
437 
438  if (*option == '+')
439  break;
440  i++;
441  if (i == (ssize_t) argc)
442  ThrowAnimateException(OptionError,"MissingArgument",option);
443  type=ParseCommandOption(MagickAlphaChannelOptions,MagickFalse,
444  argv[i]);
445  if (type < 0)
446  ThrowAnimateException(OptionError,
447  "UnrecognizedAlphaChannelOption",argv[i]);
448  break;
449  }
450  if (LocaleCompare("authenticate",option+1) == 0)
451  {
452  if (*option == '+')
453  break;
454  i++;
455  if (i == (ssize_t) argc)
456  ThrowAnimateException(OptionError,"MissingArgument",option);
457  break;
458  }
459  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
460  }
461  case 'b':
462  {
463  if (LocaleCompare("backdrop",option+1) == 0)
464  {
465  resource_info.backdrop=(*option == '-') ? MagickTrue : MagickFalse;
466  break;
467  }
468  if (LocaleCompare("background",option+1) == 0)
469  {
470  if (*option == '+')
471  break;
472  i++;
473  if (i == (ssize_t) argc)
474  ThrowAnimateException(OptionError,"MissingArgument",option);
475  resource_info.background_color=argv[i];
476  break;
477  }
478  if (LocaleCompare("bordercolor",option+1) == 0)
479  {
480  if (*option == '+')
481  break;
482  i++;
483  if (i == (ssize_t) argc)
484  ThrowAnimateException(OptionError,"MissingArgument",option);
485  resource_info.border_color=argv[i];
486  break;
487  }
488  if (LocaleCompare("borderwidth",option+1) == 0)
489  {
490  resource_info.border_width=0;
491  if (*option == '+')
492  break;
493  i++;
494  if ((i == (ssize_t) argc) || (IsGeometry(argv[i]) == MagickFalse))
495  ThrowAnimateException(OptionError,"MissingArgument",option);
496  resource_info.border_width=(unsigned int)
497  StringToUnsignedLong(argv[i]);
498  break;
499  }
500  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
501  }
502  case 'c':
503  {
504  if (LocaleCompare("cache",option+1) == 0)
505  {
506  if (*option == '+')
507  break;
508  i++;
509  if (i == (ssize_t) argc)
510  ThrowAnimateException(OptionError,"MissingArgument",option);
511  if (IsGeometry(argv[i]) == MagickFalse)
512  ThrowAnimateInvalidArgumentException(option,argv[i]);
513  break;
514  }
515  if (LocaleCompare("channel",option+1) == 0)
516  {
517  ssize_t
518  channel;
519 
520  if (*option == '+')
521  break;
522  i++;
523  if (i == (ssize_t) argc)
524  ThrowAnimateException(OptionError,"MissingArgument",option);
525  channel=ParseChannelOption(argv[i]);
526  if (channel < 0)
527  ThrowAnimateException(OptionError,"UnrecognizedChannelType",
528  argv[i]);
529  break;
530  }
531  if (LocaleCompare("clone",option+1) == 0)
532  {
533  Image
534  *clone_images;
535 
536  clone_images=image;
537  if (k != 0)
538  clone_images=image_stack[k-1].image;
539  if (clone_images == (Image *) NULL)
540  ThrowAnimateException(ImageError,"UnableToCloneImage",option);
541  FireImageStack(MagickFalse,MagickTrue,MagickTrue);
542  if (*option == '+')
543  clone_images=CloneImages(clone_images,"-1",exception);
544  else
545  {
546  i++;
547  if (i == (ssize_t) argc)
548  ThrowAnimateException(OptionError,"MissingArgument",option);
549  if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
550  ThrowAnimateInvalidArgumentException(option,argv[i]);
551  clone_images=CloneImages(clone_images,argv[i],exception);
552  }
553  if (clone_images == (Image *) NULL)
554  ThrowAnimateException(OptionError,"NoSuchImage",option);
555  AppendImageStack(clone_images);
556  break;
557  }
558  if (LocaleCompare("coalesce",option+1) == 0)
559  break;
560  if (LocaleCompare("colormap",option+1) == 0)
561  {
562  resource_info.colormap=PrivateColormap;
563  if (*option == '+')
564  break;
565  i++;
566  if (i == (ssize_t) argc)
567  ThrowAnimateException(OptionError,"MissingArgument",option);
568  resource_info.colormap=UndefinedColormap;
569  if (LocaleCompare("private",argv[i]) == 0)
570  resource_info.colormap=PrivateColormap;
571  if (LocaleCompare("shared",argv[i]) == 0)
572  resource_info.colormap=SharedColormap;
573  if (resource_info.colormap == UndefinedColormap)
574  ThrowAnimateException(OptionError,"UnrecognizedColormapType",
575  argv[i]);
576  break;
577  }
578  if (LocaleCompare("colors",option+1) == 0)
579  {
580  quantize_info->number_colors=0;
581  if (*option == '+')
582  break;
583  i++;
584  if (i == (ssize_t) argc)
585  ThrowAnimateException(OptionError,"MissingArgument",option);
586  if (IsGeometry(argv[i]) == MagickFalse)
587  ThrowAnimateInvalidArgumentException(option,argv[i]);
588  quantize_info->number_colors=StringToUnsignedLong(argv[i]);
589  break;
590  }
591  if (LocaleCompare("colorspace",option+1) == 0)
592  {
593  ssize_t
594  colorspace;
595 
596  if (*option == '+')
597  break;
598  i++;
599  if (i == (ssize_t) argc)
600  ThrowAnimateException(OptionError,"MissingArgument",option);
601  colorspace=ParseCommandOption(MagickColorspaceOptions,
602  MagickFalse,argv[i]);
603  if (colorspace < 0)
604  ThrowAnimateException(OptionError,"UnrecognizedColorspace",
605  argv[i]);
606  break;
607  }
608  if (LocaleCompare("concurrent",option+1) == 0)
609  break;
610  if (LocaleCompare("crop",option+1) == 0)
611  {
612  if (*option == '+')
613  break;
614  i++;
615  if (i == (ssize_t) argc)
616  ThrowAnimateException(OptionError,"MissingArgument",option);
617  if (IsGeometry(argv[i]) == MagickFalse)
618  ThrowAnimateInvalidArgumentException(option,argv[i]);
619  break;
620  }
621  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
622  }
623  case 'd':
624  {
625  if (LocaleCompare("debug",option+1) == 0)
626  {
627  ssize_t
628  event;
629 
630  if (*option == '+')
631  break;
632  i++;
633  if (i == (ssize_t) argc)
634  ThrowAnimateException(OptionError,"MissingArgument",option);
635  event=ParseCommandOption(MagickLogEventOptions,MagickFalse,argv[i]);
636  if (event < 0)
637  ThrowAnimateException(OptionError,"UnrecognizedEventType",
638  argv[i]);
639  (void) SetLogEventMask(argv[i]);
640  break;
641  }
642  if (LocaleCompare("decipher",option+1) == 0)
643  {
644  if (*option == '+')
645  break;
646  i++;
647  if (i == (ssize_t) argc)
648  ThrowAnimateException(OptionError,"MissingArgument",option);
649  break;
650  }
651  if (LocaleCompare("define",option+1) == 0)
652  {
653  i++;
654  if (i == (ssize_t) argc)
655  ThrowAnimateException(OptionError,"MissingArgument",option);
656  if (*option == '+')
657  {
658  const char
659  *define;
660 
661  define=GetImageOption(image_info,argv[i]);
662  if (define == (const char *) NULL)
663  ThrowAnimateException(OptionError,"NoSuchOption",argv[i]);
664  break;
665  }
666  break;
667  }
668  if (LocaleCompare("delay",option+1) == 0)
669  {
670  if (*option == '+')
671  break;
672  i++;
673  if (i == (ssize_t) argc)
674  ThrowAnimateException(OptionError,"MissingArgument",option);
675  if (IsGeometry(argv[i]) == MagickFalse)
676  ThrowAnimateInvalidArgumentException(option,argv[i]);
677  break;
678  }
679  if (LocaleCompare("density",option+1) == 0)
680  {
681  if (*option == '+')
682  break;
683  i++;
684  if (i == (ssize_t) argc)
685  ThrowAnimateException(OptionError,"MissingArgument",option);
686  if (IsGeometry(argv[i]) == MagickFalse)
687  ThrowAnimateInvalidArgumentException(option,argv[i]);
688  break;
689  }
690  if (LocaleCompare("depth",option+1) == 0)
691  {
692  if (*option == '+')
693  break;
694  i++;
695  if (i == (ssize_t) argc)
696  ThrowAnimateException(OptionError,"MissingArgument",option);
697  if (IsGeometry(argv[i]) == MagickFalse)
698  ThrowAnimateInvalidArgumentException(option,argv[i]);
699  break;
700  }
701  if (LocaleCompare("display",option+1) == 0)
702  {
703  if (*option == '+')
704  break;
705  i++;
706  if (i == (ssize_t) argc)
707  ThrowAnimateException(OptionError,"MissingArgument",option);
708  break;
709  }
710  if (LocaleCompare("dispose",option+1) == 0)
711  {
712  ssize_t
713  dispose;
714 
715  if (*option == '+')
716  break;
717  i++;
718  if (i == (ssize_t) argc)
719  ThrowAnimateException(OptionError,"MissingArgument",option);
720  dispose=ParseCommandOption(MagickDisposeOptions,MagickFalse,argv[i]);
721  if (dispose < 0)
722  ThrowAnimateException(OptionError,"UnrecognizedDisposeMethod",
723  argv[i]);
724  break;
725  }
726  if (LocaleCompare("dither",option+1) == 0)
727  {
728  ssize_t
729  method;
730 
731  quantize_info->dither_method=NoDitherMethod;
732  if (*option == '+')
733  break;
734  i++;
735  if (i == (ssize_t) argc)
736  ThrowAnimateException(OptionError,"MissingArgument",option);
737  method=ParseCommandOption(MagickDitherOptions,MagickFalse,argv[i]);
738  if (method < 0)
739  ThrowAnimateException(OptionError,"UnrecognizedDitherMethod",
740  argv[i]);
741  quantize_info->dither_method=(DitherMethod) method;
742  break;
743  }
744  if (LocaleCompare("duration",option+1) == 0)
745  {
746  if (*option == '+')
747  break;
748  i++;
749  if (i == (ssize_t) argc)
750  ThrowAnimateException(OptionError,"MissingArgument",option);
751  if (IsGeometry(argv[i]) == MagickFalse)
752  ThrowAnimateInvalidArgumentException(option,argv[i]);
753  break;
754  }
755  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
756  }
757  case 'e':
758  {
759  if (LocaleCompare("extract",option+1) == 0)
760  {
761  if (*option == '+')
762  break;
763  i++;
764  if (i == (ssize_t) argc)
765  ThrowAnimateException(OptionError,"MissingArgument",option);
766  if (IsGeometry(argv[i]) == MagickFalse)
767  ThrowAnimateInvalidArgumentException(option,argv[i]);
768  break;
769  }
770  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
771  }
772  case 'f':
773  {
774  if (LocaleCompare("filter",option+1) == 0)
775  {
776  ssize_t
777  filter;
778 
779  if (*option == '+')
780  break;
781  i++;
782  if (i == (ssize_t) argc)
783  ThrowAnimateException(OptionError,"MissingArgument",option);
784  filter=ParseCommandOption(MagickFilterOptions,MagickFalse,argv[i]);
785  if (filter < 0)
786  ThrowAnimateException(OptionError,"UnrecognizedImageFilter",
787  argv[i]);
788  break;
789  }
790  if (LocaleCompare("flatten",option+1) == 0)
791  break;
792  if (LocaleCompare("font",option+1) == 0)
793  {
794  if (*option == '+')
795  break;
796  i++;
797  if (i == (ssize_t) argc)
798  ThrowAnimateException(OptionError,"MissingArgument",option);
799  resource_info.font=XGetResourceClass(resource_database,
800  GetClientName(),"font",argv[i]);
801  break;
802  }
803  if (LocaleCompare("foreground",option+1) == 0)
804  {
805  if (*option == '+')
806  break;
807  i++;
808  if (i == (ssize_t) argc)
809  ThrowAnimateException(OptionError,"MissingArgument",option);
810  resource_info.foreground_color=argv[i];
811  break;
812  }
813  if (LocaleCompare("format",option+1) == 0)
814  {
815  if (*option == '+')
816  break;
817  i++;
818  if (i == (ssize_t) argc)
819  ThrowAnimateException(OptionError,"MissingArgument",option);
820  break;
821  }
822  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
823  }
824  case 'g':
825  {
826  if (LocaleCompare("gamma",option+1) == 0)
827  {
828  i++;
829  if (i == (ssize_t) argc)
830  ThrowAnimateException(OptionError,"MissingArgument",option);
831  if (IsGeometry(argv[i]) == MagickFalse)
832  ThrowAnimateInvalidArgumentException(option,argv[i]);
833  break;
834  }
835  if (LocaleCompare("geometry",option+1) == 0)
836  {
837  resource_info.image_geometry=(char *) NULL;
838  if (*option == '+')
839  break;
840  i++;
841  if (i == (ssize_t) argc)
842  ThrowAnimateException(OptionError,"MissingArgument",option);
843  if (IsGeometry(argv[i]) == MagickFalse)
844  ThrowAnimateInvalidArgumentException(option,argv[i]);
845  resource_info.image_geometry=ConstantString(argv[i]);
846  break;
847  }
848  if (LocaleCompare("gravity",option+1) == 0)
849  {
850  ssize_t
851  gravity;
852 
853  if (*option == '+')
854  break;
855  i++;
856  if (i == (ssize_t) argc)
857  ThrowAnimateException(OptionError,"MissingArgument",option);
858  gravity=ParseCommandOption(MagickGravityOptions,MagickFalse,
859  argv[i]);
860  if (gravity < 0)
861  ThrowAnimateException(OptionError,"UnrecognizedGravityType",
862  argv[i]);
863  break;
864  }
865  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
866  }
867  case 'h':
868  {
869  if ((LocaleCompare("help",option+1) == 0) ||
870  (LocaleCompare("-help",option+1) == 0))
871  break;
872  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
873  }
874  case 'i':
875  {
876  if (LocaleCompare("iconGeometry",option+1) == 0)
877  {
878  resource_info.icon_geometry=(char *) NULL;
879  if (*option == '+')
880  break;
881  i++;
882  if (i == (ssize_t) argc)
883  ThrowAnimateException(OptionError,"MissingArgument",option);
884  if (IsGeometry(argv[i]) == MagickFalse)
885  ThrowAnimateInvalidArgumentException(option,argv[i]);
886  resource_info.icon_geometry=argv[i];
887  break;
888  }
889  if (LocaleCompare("iconic",option+1) == 0)
890  {
891  resource_info.iconic=(*option == '-') ? MagickTrue : MagickFalse;
892  break;
893  }
894  if (LocaleCompare("identify",option+1) == 0)
895  break;
896  if (LocaleCompare("immutable",option+1) == 0)
897  {
898  resource_info.immutable=(*option == '-') ? MagickTrue : MagickFalse;
899  break;
900  }
901  if (LocaleCompare("interlace",option+1) == 0)
902  {
903  ssize_t
904  interlace;
905 
906  if (*option == '+')
907  break;
908  i++;
909  if (i == (ssize_t) argc)
910  ThrowAnimateException(OptionError,"MissingArgument",option);
911  interlace=ParseCommandOption(MagickInterlaceOptions,MagickFalse,
912  argv[i]);
913  if (interlace < 0)
914  ThrowAnimateException(OptionError,"UnrecognizedInterlaceType",
915  argv[i]);
916  break;
917  }
918  if (LocaleCompare("interpolate",option+1) == 0)
919  {
920  ssize_t
921  interpolate;
922 
923  if (*option == '+')
924  break;
925  i++;
926  if (i == (ssize_t) argc)
927  ThrowAnimateException(OptionError,"MissingArgument",option);
928  interpolate=ParseCommandOption(MagickInterpolateOptions,MagickFalse,
929  argv[i]);
930  if (interpolate < 0)
931  ThrowAnimateException(OptionError,"UnrecognizedInterpolateMethod",
932  argv[i]);
933  break;
934  }
935  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
936  }
937  case 'l':
938  {
939  if (LocaleCompare("label",option+1) == 0)
940  {
941  if (*option == '+')
942  break;
943  i++;
944  if (i == (ssize_t) argc)
945  ThrowAnimateException(OptionError,"MissingArgument",option);
946  break;
947  }
948  if (LocaleCompare("limit",option+1) == 0)
949  {
950  char
951  *p;
952 
953  double
954  value;
955 
956  ssize_t
957  resource;
958 
959  if (*option == '+')
960  break;
961  i++;
962  if (i == (ssize_t) argc)
963  ThrowAnimateException(OptionError,"MissingArgument",option);
964  resource=ParseCommandOption(MagickResourceOptions,MagickFalse,
965  argv[i]);
966  if (resource < 0)
967  ThrowAnimateException(OptionError,"UnrecognizedResourceType",
968  argv[i]);
969  i++;
970  if (i == (ssize_t) argc)
971  ThrowAnimateException(OptionError,"MissingArgument",option);
972  value=StringToDouble(argv[i],&p);
973  (void) value;
974  if ((p == argv[i]) && (LocaleCompare("unlimited",argv[i]) != 0))
975  ThrowAnimateInvalidArgumentException(option,argv[i]);
976  break;
977  }
978  if (LocaleCompare("list",option+1) == 0)
979  {
980  ssize_t
981  list;
982 
983  if (*option == '+')
984  break;
985  i++;
986  if (i == (ssize_t) argc)
987  ThrowAnimateException(OptionError,"MissingArgument",option);
988  list=ParseCommandOption(MagickListOptions,MagickFalse,argv[i]);
989  if (list < 0)
990  ThrowAnimateException(OptionError,"UnrecognizedListType",argv[i]);
991  status=MogrifyImageInfo(image_info,(int) (i-j+1),(const char **)
992  argv+j,exception);
993  DestroyAnimate();
994  return(status == 0 ? MagickFalse : MagickTrue);
995  }
996  if (LocaleCompare("log",option+1) == 0)
997  {
998  if (*option == '+')
999  break;
1000  i++;
1001  if ((i == (ssize_t) argc) ||
1002  (strchr(argv[i],'%') == (char *) NULL))
1003  ThrowAnimateException(OptionError,"MissingArgument",option);
1004  break;
1005  }
1006  if (LocaleCompare("loop",option+1) == 0)
1007  {
1008  if (*option == '+')
1009  break;
1010  i++;
1011  if (i == (ssize_t) argc)
1012  ThrowAnimateException(OptionError,"MissingArgument",option);
1013  if (IsGeometry(argv[i]) == MagickFalse)
1014  ThrowAnimateInvalidArgumentException(option,argv[i]);
1015  break;
1016  }
1017  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1018  }
1019  case 'm':
1020  {
1021  if (LocaleCompare("map",option+1) == 0)
1022  {
1023  resource_info.map_type=(char *) NULL;
1024  if (*option == '+')
1025  break;
1026  (void) CopyMagickString(argv[i]+1,"san",MagickPathExtent);
1027  i++;
1028  if (i == (ssize_t) argc)
1029  ThrowAnimateException(OptionError,"MissingArgument",option);
1030  resource_info.map_type=argv[i];
1031  break;
1032  }
1033  if (LocaleCompare("matte",option+1) == 0)
1034  break;
1035  if (LocaleCompare("mattecolor",option+1) == 0)
1036  {
1037  if (*option == '+')
1038  break;
1039  i++;
1040  if (i == (ssize_t) argc)
1041  ThrowAnimateException(OptionError,"MissingArgument",option);
1042  resource_info.matte_color=argv[i];
1043  break;
1044  }
1045  if (LocaleCompare("monitor",option+1) == 0)
1046  break;
1047  if (LocaleCompare("monochrome",option+1) == 0)
1048  {
1049  if (*option == '+')
1050  break;
1051  quantize_info->number_colors=2;
1052  quantize_info->colorspace=GRAYColorspace;
1053  break;
1054  }
1055  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1056  }
1057  case 'n':
1058  {
1059  if (LocaleCompare("name",option+1) == 0)
1060  {
1061  resource_info.name=(char *) NULL;
1062  if (*option == '+')
1063  break;
1064  i++;
1065  if (i == (ssize_t) argc)
1066  ThrowAnimateException(OptionError,"MissingArgument",option);
1067  resource_info.name=ConstantString(argv[i]);
1068  break;
1069  }
1070  if (LocaleCompare("noop",option+1) == 0)
1071  break;
1072  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1073  }
1074  case 'p':
1075  {
1076  if (LocaleCompare("pause",option+1) == 0)
1077  {
1078  resource_info.pause=0;
1079  if (*option == '+')
1080  break;
1081  i++;
1082  if (i == (ssize_t) argc)
1083  ThrowAnimateException(OptionError,"MissingArgument",option);
1084  if (IsGeometry(argv[i]) == MagickFalse)
1085  ThrowAnimateInvalidArgumentException(option,argv[i]);
1086  resource_info.pause=(unsigned int) StringToUnsignedLong(argv[i]);
1087  break;
1088  }
1089  if (LocaleCompare("page",option+1) == 0)
1090  {
1091  if (*option == '+')
1092  break;
1093  i++;
1094  if (i == (ssize_t) argc)
1095  ThrowAnimateException(OptionError,"MissingArgument",option);
1096  break;
1097  }
1098  if (LocaleCompare("profile",option+1) == 0)
1099  {
1100  i++;
1101  if (i == (ssize_t) argc)
1102  ThrowAnimateException(OptionError,"MissingArgument",option);
1103  break;
1104  }
1105  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1106  }
1107  case 'q':
1108  {
1109  if (LocaleCompare("quantize",option+1) == 0)
1110  {
1111  ssize_t
1112  colorspace;
1113 
1114  if (*option == '+')
1115  break;
1116  i++;
1117  if (i == (ssize_t) argc)
1118  ThrowAnimateException(OptionError,"MissingArgument",option);
1119  colorspace=ParseCommandOption(MagickColorspaceOptions,
1120  MagickFalse,argv[i]);
1121  if (colorspace < 0)
1122  ThrowAnimateException(OptionError,"UnrecognizedColorspace",
1123  argv[i]);
1124  break;
1125  }
1126  if (LocaleCompare("quiet",option+1) == 0)
1127  break;
1128  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1129  }
1130  case 'r':
1131  {
1132  if (LocaleCompare("regard-warnings",option+1) == 0)
1133  break;
1134  if (LocaleCompare("remote",option+1) == 0)
1135  {
1136  i++;
1137  if (i == (ssize_t) argc)
1138  ThrowAnimateException(OptionError,"MissingArgument",option);
1139  if (XRemoteCommand(display,resource_info.window_id,argv[i]) != 0)
1140  return(MagickFalse);
1141  i--;
1142  break;
1143  }
1144  if (LocaleCompare("repage",option+1) == 0)
1145  {
1146  if (*option == '+')
1147  break;
1148  i++;
1149  if (i == (ssize_t) argc)
1150  ThrowAnimateException(OptionError,"MissingArgument",option);
1151  if (IsGeometry(argv[i]) == MagickFalse)
1152  ThrowAnimateInvalidArgumentException(option,argv[i]);
1153  break;
1154  }
1155  if (LocaleCompare("resample",option+1) == 0)
1156  {
1157  if (*option == '+')
1158  break;
1159  i++;
1160  if (i == (ssize_t) argc)
1161  ThrowAnimateException(OptionError,"MissingArgument",option);
1162  if (IsGeometry(argv[i]) == MagickFalse)
1163  ThrowAnimateInvalidArgumentException(option,argv[i]);
1164  break;
1165  }
1166  if (LocaleCompare("resize",option+1) == 0)
1167  {
1168  if (*option == '+')
1169  break;
1170  i++;
1171  if (i == (ssize_t) argc)
1172  ThrowAnimateException(OptionError,"MissingArgument",option);
1173  if (IsGeometry(argv[i]) == MagickFalse)
1174  ThrowAnimateInvalidArgumentException(option,argv[i]);
1175  break;
1176  }
1177  if (LocaleNCompare("respect-parentheses",option+1,17) == 0)
1178  {
1179  respect_parenthesis=(*option == '-') ? MagickTrue : MagickFalse;
1180  break;
1181  }
1182  if (LocaleCompare("rotate",option+1) == 0)
1183  {
1184  i++;
1185  if (i == (ssize_t) argc)
1186  ThrowAnimateException(OptionError,"MissingArgument",option);
1187  if (IsGeometry(argv[i]) == MagickFalse)
1188  ThrowAnimateInvalidArgumentException(option,argv[i]);
1189  break;
1190  }
1191  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1192  }
1193  case 's':
1194  {
1195  if (LocaleCompare("sampling-factor",option+1) == 0)
1196  {
1197  if (*option == '+')
1198  break;
1199  i++;
1200  if (i == (ssize_t) argc)
1201  ThrowAnimateException(OptionError,"MissingArgument",option);
1202  if (IsGeometry(argv[i]) == MagickFalse)
1203  ThrowAnimateInvalidArgumentException(option,argv[i]);
1204  break;
1205  }
1206  if (LocaleCompare("seed",option+1) == 0)
1207  {
1208  if (*option == '+')
1209  break;
1210  i++;
1211  if (i == (ssize_t) argc)
1212  ThrowAnimateException(OptionError,"MissingArgument",option);
1213  if (IsGeometry(argv[i]) == MagickFalse)
1214  ThrowAnimateInvalidArgumentException(option,argv[i]);
1215  break;
1216  }
1217  if (LocaleCompare("scenes",option+1) == 0) /* deprecated */
1218  {
1219  if (*option == '+')
1220  break;
1221  i++;
1222  if (i == (ssize_t) argc)
1223  ThrowAnimateException(OptionError,"MissingArgument",option);
1224  if (IsSceneGeometry(argv[i],MagickFalse) == MagickFalse)
1225  ThrowAnimateInvalidArgumentException(option,argv[i]);
1226  break;
1227  }
1228  if (LocaleCompare("set",option+1) == 0)
1229  {
1230  i++;
1231  if (i == (ssize_t) argc)
1232  ThrowAnimateException(OptionError,"MissingArgument",option);
1233  if (*option == '+')
1234  break;
1235  i++;
1236  if (i == (ssize_t) argc)
1237  ThrowAnimateException(OptionError,"MissingArgument",option);
1238  break;
1239  }
1240  if (LocaleCompare("shared-memory",option+1) == 0)
1241  {
1242  resource_info.use_shared_memory=(*option == '-') ? MagickTrue :
1243  MagickFalse;
1244  break;
1245  }
1246  if (LocaleCompare("size",option+1) == 0)
1247  {
1248  if (*option == '+')
1249  break;
1250  i++;
1251  if (i == (ssize_t) argc)
1252  ThrowAnimateException(OptionError,"MissingArgument",option);
1253  if (IsGeometry(argv[i]) == MagickFalse)
1254  ThrowAnimateInvalidArgumentException(option,argv[i]);
1255  break;
1256  }
1257  if (LocaleCompare("strip",option+1) == 0)
1258  break;
1259  if (LocaleCompare("support",option+1) == 0)
1260  {
1261  i++; /* deprecated */
1262  break;
1263  }
1264  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1265  }
1266  case 't':
1267  {
1268  if (LocaleCompare("text-font",option+1) == 0)
1269  {
1270  resource_info.text_font=(char *) NULL;
1271  if (*option == '+')
1272  break;
1273  i++;
1274  if (i == (ssize_t) argc)
1275  ThrowAnimateException(OptionError,"MissingArgument",option);
1276  resource_info.text_font=XGetResourceClass(resource_database,
1277  GetClientName(),"font",argv[i]);
1278  break;
1279  }
1280  if (LocaleCompare("thumbnail",option+1) == 0)
1281  {
1282  if (*option == '+')
1283  break;
1284  i++;
1285  if (i == (ssize_t) argc)
1286  ThrowAnimateException(OptionError,"MissingArgument",option);
1287  if (IsGeometry(argv[i]) == MagickFalse)
1288  ThrowAnimateInvalidArgumentException(option,argv[i]);
1289  break;
1290  }
1291  if (LocaleCompare("title",option+1) == 0)
1292  {
1293  resource_info.title=(char *) NULL;
1294  if (*option == '+')
1295  break;
1296  i++;
1297  if (i == (ssize_t) argc)
1298  ThrowAnimateException(OptionError,"MissingArgument",option);
1299  resource_info.title=argv[i];
1300  break;
1301  }
1302  if (LocaleCompare("transparent-color",option+1) == 0)
1303  {
1304  if (*option == '+')
1305  break;
1306  i++;
1307  if (i == (ssize_t) argc)
1308  ThrowAnimateException(OptionError,"MissingArgument",option);
1309  break;
1310  }
1311  if (LocaleCompare("treedepth",option+1) == 0)
1312  {
1313  quantize_info->tree_depth=0;
1314  if (*option == '+')
1315  break;
1316  i++;
1317  if (i == (ssize_t) argc)
1318  ThrowAnimateException(OptionError,"MissingArgument",option);
1319  if (IsGeometry(argv[i]) == MagickFalse)
1320  ThrowAnimateInvalidArgumentException(option,argv[i]);
1321  quantize_info->tree_depth=StringToUnsignedLong(argv[i]);
1322  break;
1323  }
1324  if (LocaleCompare("trim",option+1) == 0)
1325  break;
1326  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1327  }
1328  case 'v':
1329  {
1330  if (LocaleCompare("verbose",option+1) == 0)
1331  break;
1332  if ((LocaleCompare("version",option+1) == 0) ||
1333  (LocaleCompare("-version",option+1) == 0))
1334  {
1335  ListMagickVersion(stdout);
1336  break;
1337  }
1338  if (LocaleCompare("virtual-pixel",option+1) == 0)
1339  {
1340  ssize_t
1341  method;
1342 
1343  if (*option == '+')
1344  break;
1345  i++;
1346  if (i == (ssize_t) argc)
1347  ThrowAnimateException(OptionError,"MissingArgument",option);
1348  method=ParseCommandOption(MagickVirtualPixelOptions,MagickFalse,
1349  argv[i]);
1350  if (method < 0)
1351  ThrowAnimateException(OptionError,
1352  "UnrecognizedVirtualPixelMethod",argv[i]);
1353  break;
1354  }
1355  if (LocaleCompare("visual",option+1) == 0)
1356  {
1357  resource_info.visual_type=(char *) NULL;
1358  if (*option == '+')
1359  break;
1360  i++;
1361  if (i == (ssize_t) argc)
1362  ThrowAnimateException(OptionError,"MissingArgument",option);
1363  resource_info.visual_type=argv[i];
1364  break;
1365  }
1366  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1367  }
1368  case 'w':
1369  {
1370  if (LocaleCompare("window",option+1) == 0)
1371  {
1372  resource_info.window_id=(char *) NULL;
1373  if (*option == '+')
1374  break;
1375  i++;
1376  if (i == (ssize_t) argc)
1377  ThrowAnimateException(OptionError,"MissingArgument",option);
1378  resource_info.window_id=argv[i];
1379  break;
1380  }
1381  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1382  }
1383  case '?':
1384  break;
1385  default:
1386  ThrowAnimateException(OptionError,"UnrecognizedOption",option);
1387  }
1388  fire=(GetCommandOptionFlags(MagickCommandOptions,MagickFalse,option) &
1389  FireOptionFlag) == 0 ? MagickFalse : MagickTrue;
1390  if (fire != MagickFalse)
1391  FireImageStack(MagickFalse,MagickTrue,MagickTrue);
1392  }
1393  i--;
1394  if (k != 0)
1395  ThrowAnimateException(OptionError,"UnbalancedParenthesis",argv[i]);
1396  if (image == (Image *) NULL)
1397  ThrowAnimateException(OptionError,"MissingAnImageFilename",argv[argc-1])
1398  FinalizeImageSettings(image_info,image,MagickTrue);
1399  if (image == (Image *) NULL)
1400  ThrowAnimateException(OptionError,"MissingAnImageFilename",argv[argc-1])
1401  if (resource_info.window_id != (char *) NULL)
1402  {
1403  XAnimateBackgroundImage(display,&resource_info,image,exception);
1404  status&=MagickTrue;
1405  }
1406  else
1407  {
1408  Image
1409  *animate_image;
1410 
1411  /*
1412  Animate image to X server.
1413  */
1414  animate_image=XAnimateImages(display,&resource_info,argv,argc,image,
1415  exception);
1416  while (animate_image != (Image *) NULL)
1417  {
1418  image=animate_image;
1419  animate_image=XAnimateImages(display,&resource_info,argv,argc,image,
1420  exception);
1421  if (animate_image != image)
1422  image=DestroyImageList(image);
1423  }
1424  }
1425  DestroyAnimate();
1426  return(status != 0 ? MagickTrue : MagickFalse);
1427 #else
1428  wand_unreferenced(argc);
1429  wand_unreferenced(argv);
1430  wand_unreferenced(metadata);
1431  (void) ThrowMagickException(exception,GetMagickModule(),MissingDelegateError,
1432  "DelegateLibrarySupportNotBuiltIn","'%s' (X11)",image_info->filename);
1433  return(AnimateUsage());
1434 #endif
1435 }
#define FinalizeImageSettings(image_info, image, advance)
static MagickBooleanType AnimateUsage(void)
Definition: animate.c:93
#define wand_unused(x)
#define STDIN_FILENO
Definition: studio.h:300
#define NewImageStack()
#define WandExport
#define SetNotifyHandlers
Definition: studio.h:261
#define AppendImageStack(images)
WandExport MagickBooleanType MogrifyImageInfo(ImageInfo *image_info, const int argc, const char **argv, ExceptionInfo *exception)
Definition: mogrify.c:6577
WandExport MagickBooleanType AnimateImageCommand(ImageInfo *image_info, int argc, char **argv, char **wand_unused(metadata), ExceptionInfo *exception)
Definition: animate.c:206
#define MagickPathExtent
#define ReadCommandlLine(argc, argv)
Definition: studio.h:260
#define PopImageStack()
#define wand_unreferenced(x)
#define PushImageStack()
#define FireImageStack(postfix, advance, fire)
#define MaxImageStackDepth