Imagick class / method problems

images php coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
guycarnegie
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Aug 31, 2018 4:30 pm

Fri Aug 31, 2018 4:39 pm

New to PHP and wordpress, but trying to create a contact form where I can upload an image then use IMagick to resize before its sent to recipient.

Problems so far were:
1. WP_Image_Editor_Imagick class wasn't found, so I added a

Code: Select all

require_once('wp-includes/class-wp-image-editor-imagick.php')
; to the calling function
2. WP_Image_Editor class from which Imagick class was extended also wasn't found, so added a require once just before the imagick class to bring that in too.
3. Now I have "Call to undefined method WP_Image_Editor_Imagick::resizeImage()" where resizeImage method can't be seen anywhere in the imagick class - so I switch to "resize" which is there...
4. then I find that "writeImage" is also not there, so I'm go with "save" instead which is there, but getting internal errors like this:
PHP Fatal error: Uncaught Error: Call to a member function getImageFormat() on null in /home/gariochc/public_html/wp-includes/class-wp-image-editor-imagick.php:626
do I have a REALLY old Imagick install on my hosting company's server?

thanks
Guy

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 745
Joined: Mon Feb 22, 2016 5:52 pm

Sun Sep 02, 2018 7:09 am

do I have a REALLY old Imagick install on my hosting company's server?
Try phpinfo or or try looking here then look at Imagicks website to see what the latest version is and then maybe also check out WPs version information.

If all else fails: try here; it didn't work for me though.

Post Reply