I recently moved host, and I'm having some trouble running Imagick as it's installed differently from my previous host. I have attached the PHP code that worked on my old host;
From the file functions.php
Code: Select all
function thumb_create($file, $width , $height, $output) {
try {
$thumb_dir = "thumb/";
$image = $file;
$im = new Imagick();
$im->pingImage($image);
$im->readImage( $image );
$im->thumbnailImage( $width, $height );
$im->writeImage( 'THUMB_'.$output );
rename ('THUMB_'.$output, $thumb_dir . $output);
$im->destroy();
return 'THUMB_'.$output;
}
catch(Exception $e)
{
print $e->getMessage();
return $file;
}};
Someone from their support team told me the default imagick extension is not enabled and doesn't work on their shared servers, but I could use this alternative binary;Fatal error: Class 'Imagick' not found in /home/sitename/public_html/php/includes/functions.php on line 204
https://www.siteground.com/kb/what_is_t ... agemagick/
Does anyone have any suggestions as to how I could get this code working with possibly keeping the same syntax as before in the thumb_create PHP function? I'm sure the fix is quite simple, but I can't seem to get it working, and I have little experience with server folders and binaries. Any help would be highly appriciated!
Best regards,
Joakim