MagickWand for PHP; anything wrong with my code?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ridera

MagickWand for PHP; anything wrong with my code?

Post by ridera »

Ii can't figure out if MagickWand for PHP is broken or if there is something wrong with my code.
IM version 6.3.5; MW 1.0.4 PHP 5.2.3

Code: Select all

$resource = NewMagickWand();
	$dwand = NewDrawingWand();
	$pwand = NewPixelWand();
	$org_image= 'flower_original.jpg';

	header('Content-Type: image/jpeg');

// convert flower_original.jpg -resize 640×480 flower.jpg
	MagickReadImage( $resource, $org_image );

	MagickEchoImageBlob( $resource );

	MagickResizeImage( $resource, 100, 100, MW_QuadraticFilter, 1.0 );

	MagickEchoImageBlob( $resource );
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: MagickWand for PHP; anything wrong with my code?

Post by anthony »

I suggest you add some error return checks. More than likely it can not find or read the image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply