return to first page linux journal archive
keywordscontents

#include <stdio.h>
#include <string.h>
#include <magick.h>
int main(int argc,char *argv[])
{
  Image *image, *scaled_image;
  ImageInfo image_info;
  /* Initialize the image info structure and 
	read an image. */
  GetImageInfo(&image_info);
  (void) strcpy(image_info.filename,"image.jpg");
  image=ReadImage(&image_info);
  if (image == (Image *) NULL)
    exit(1);
  /*
    Turn the image into a thumbnail. */
  scaled_image=ZoomImage(image,106,80,MitchellFilter);
  if (scaled_image != (Image *) NULL)
    {
      DestroyImage(image);
      image=scaled_image;
    }
  /*
    Write the image as GIF and destroy it. */
  (void) strcpy(image->filename,"image.gif");
  WriteImage(&image_info,image);
  DestroyImage(image);
  return 0;
}