imagick raises error

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
cuongvt

imagick raises error

Post by cuongvt »

Hi,
Currently I'm reading below page:
http://www.imagemagick.org/Usage/api/#php
When I tried imagick example of it, php raised error about function : Imagick::readimage() .
Fatal error: Non-static method Imagick::readimage() cannot be called statically in /usr/local/www/apache22/data/php/im/imagick_hello.php on line 2

I don't know what is the cause. How can I solve this?
I'm running latest IM 6.4.7 with imagick 2.2.1, php 5.2.8 all built from ports.
Thanks and regards,
below is whole example of above site:

<?php
$handle = imagick_readimage( getcwd() . "image.jpg" );
if ( imagick_iserror( $handle ) ) {
$reason = imagick_failedreason( $handle ) ;
$description = imagick_faileddescription( $handle ) ;

print "Handle Read failed!<BR>\n";
print "Reason: $reason<BR>\n";
print "Description: $description<BR>\n";
exit ;
}
header( "Content-type: " . imagick_getmimetype( $handle ) );
print imagick_image2blob( $handle );
?>
vuthecuong

Re: imagick raises error

Post by vuthecuong »

bump
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: imagick raises error

Post by mkoppanen »

Hello,

those examples are outdated and valid for Imagick 0.9.x
Mikko Koppanen
My blog: http://valokuva.org
vuthecuong

Re: imagick raises error

Post by vuthecuong »

Thanks, I understood thats. Current IM if more OOP way.
But it's better if those imagick examples up to date.
regards
Post Reply