Thumb() not outputting anything

Having huge trouble getting images generated succesfully, my site seems to be falling back to the images in the content folders rather then the media folder.

I have confirmed that Imagemagic is installed correctly on the server. If i do the following in the plainkit, i succesfully get WebP and Avif files…

$i =  $page->image('echo-ridge-hero.jpg')->realpath();

$imagick = new \Imagick();
$imagick->readImage($i);
$imagick->setImageFormat('avif');
$imagick->writeImage('im_echo-ridge-hero.avif');

$imagick->setImageFormat('webp');
$imagick->writeImage('im_echo-ridge-hero.webp');

However, none of these result in files in the media folder:

<?= $page->image('echo-ridge-hero.jpg')->thumb(['width' => 505, 'height' => null, 'format' => 'avif'])->url() ?>

<?= $page->image('echo-ridge-hero.jpg')->thumb(['width' => 505, 'height' => null, 'format' => 'webp'])->url() ?>

<?= $page->image('echo-ridge-hero.jpg')->thumb(['width' => 505, 'height' => null, 'format' => 'jpg'])->url() ?>

I do get the path echoed on the page, but all thats in the media folder is the job json files.

There isnt anything in the error logs. I am a bit stumped here. Any idea what is going on? Everything works great locally.

If you don’t get any thumbs on the server, maybe the exec() PHP method is blocked.

Kirby doesn’t use the PHP Imagick extension because that’s often not available, but executes the ImageMagick binary on the command line via the exec() method.

ImageMagick.php #141:

exec($command, $output, $return);

Having said that: Have you set the path to the convert binary in your config?

Hrmm… ok so exec()wasl in the list of disallowed functions, and ive now removed it from the list which looks like:

system,system_exec,shell,shell_exec,symlink,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,show_source,proc_get_status,proc_nice,proc_terminate,highlight_file,define_syslog_variables,posix_uname,posix_getpwuid,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,ini_restore,inject_code,define_syslog_variables,apache_setenv,eval,phpAds_XmlRpc,phpAds_remoteInfo,phpAds_xmlrpcEncode,phpAds_xmlrpcDecode,xmlrpc_entity_decode

I have also explicitly set the bin path in the config.

Trouble im still not getting any images :frowning:

This needs to be enabled as well.

Make sure to restart the server after applying these changes (if it’s not shared hosting).

Have removed escapeshellarg as well now…Still nothing :frowning:

I guess i need to talk to the host now to see if anything is stopping exec() from working?

Guess so, maybe it’s not even possible to enable it.

In the hosting control panel, there is a list of diabled functions for security reasons, and it says remove them from the list if you need one.

Will have to file a support ticket. My hosts online support chat is closed until Tuesday due to the Easter holiday :frowning:

Ah ha! Seems to have suddenly kicked in. I am now getting Avifs generated. Thanks alot @texnixe :slight_smile: