5 #include <magick/MagickCore.h>
7 int main(int argc,char **argv)
23 (void) fprintf(stdout,"Usage: %s image thumbnail\n",argv[0]);
27 Initialize the image info structure and read an image.
29 MagickCoreGenesis(*argv,MagickTrue);
30 exception=AcquireExceptionInfo();
31 image_info=CloneImageInfo((ImageInfo *) NULL);
32 (void) strcpy(image_info->filename,argv[1]);
33 images=ReadImage(image_info,exception);
34 if (exception->severity != UndefinedException)
35 CatchException(exception);
36 if (images == (Image *) NULL)
39 Convert the image to a thumbnail.
41 thumbnails=NewImageList();
42 while ((image=RemoveFirstImageFromList(&images)) != (Image *) NULL)
44 resize_image=ResizeImage(image,106,80,LanczosFilter,1.0,exception);
45 if (resize_image == (Image *) NULL)
46 MagickError(exception->severity,exception->reason,exception->description);
47 (void) AppendImageToList(&thumbnails,resize_image);
51 Write the image thumbnail.
53 (void) strcpy(thumbnails->filename,argv[2]);
54 WriteImage(image_info,thumbnails);
56 Destroy the image thumbnail and exit.
58 thumbnails=DestroyImageList(thumbnails);
59 image_info=DestroyImageInfo(image_info);
60 exception=DestroyExceptionInfo(exception);