// Last updated 2013/01/30 16:26

// MagickCore equivalent of
// convert logo: logo.jpg
#include <windows.h>
#include <magick/MagickCore.h>
void test_wand(void)
{
	Image *image,*imagew;
	ImageInfo *read_info;
	ImageInfo *write_info;
	ExceptionInfo *exception;
	MagickBooleanType status;

	MagickCoreGenesis((char *) NULL,MagickFalse);

	// Get and Initialize an exception info
	exception = AcquireExceptionInfo();
	GetExceptionInfo(exception);

	// Get and initialize a read_info
	read_info=CloneImageInfo(NULL);
	
	CopyMagickString(read_info->filename,"logo:",MaxTextExtent);

	// Read the image
	image = ReadImage(read_info,exception);
	imagew = CloneImage(image,0,0,MagickTrue,exception);
	// Set up the output info
	write_info=CloneImageInfo(read_info);
	CopyMagickString(write_info->filename,"logo.jpg",MaxTextExtent);
	// MagickWriteImage does this so I do it too.
	write_info->adjoin=MagickTrue;
	// write the image
	WriteImage(write_info,imagew);

	DestroyImage(image);
	DestroyImageInfo(read_info);
	DestroyImageInfo(write_info);
	DestroyExceptionInfo(exception);
	MagickCoreTerminus();
}