3 #include <wand/MagickWand.h>
5 int main(int argc,char **argv)
7 #define ThrowWandException(wand) \
15 description=MagickGetException(wand,&severity); \
16 (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \
17 description=(char *) MagickRelinquishMemory(description); \
29 (void) fprintf(stdout,"Usage: %s image thumbnail\n",argv[0]);
36 magick_wand=NewMagickWand();
37 status=MagickReadImage(magick_wand,argv[1]);
38 if (status == MagickFalse)
39 ThrowWandException(magick_wand);
41 Turn the images into a thumbnail sequence.
43 MagickResetIterator(magick_wand);
44 while (MagickNextImage(magick_wand) != MagickFalse)
45 MagickResizeImage(magick_wand,106,80,LanczosFilter,1.0);
47 Write the image then destroy it.
49 status=MagickWriteImages(magick_wand,argv[2],MagickTrue);
50 if (status == MagickFalse)
51 ThrowWandException(magick_wand);
52 magick_wand=DestroyMagickWand(magick_wand);