Jump to content

imagick raises error


cuongvt

Recommended Posts

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 in Freebsd 7.0, 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 );

?>

Link to comment
https://forums.phpfreaks.com/topic/137670-imagick-raises-error/
Share on other sites

Thats because imagick is meant to be an object oriented extension.

 

http://us3.php.net/manual/en/function.imagick-readimage.php

 

and if you want the best examples of working with imagick I have found check out this blog, the guy who writes it, is one of the lead developers for the extension:

 

http://valokuva.org/?cat=1.

 

 

Link to comment
https://forums.phpfreaks.com/topic/137670-imagick-raises-error/#findComment-719613
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.