aelvan/Imager-Craft

Imagick + webp issues on DigitalOcean/ServerPilot

darylknight opened this issue · 4 comments

I've been trying without success to get Imager serving webp images using Imagick on DigitalOcean/ServerPilot. I've installed webp and cwebp is correctly installed in user/bin/cwebp

GD seems to work fine, but when I try and use Imagick, I get this error message:

image

shell_exec(): Unable to execute '/usr/bin/cwebp -q 80 "/srv/users/beyond-stage/apps/beyond-stage/storage/runtime/imager/temp/7321c9d3e512ac16a99d2b4f54bde5b7.jpg" -o "/srv/users/beyond-stage/apps/beyond-stage/public/imager/images/5587/work-nuffield-health-tube_20eb4bea08289a4390600e547b8810e7.webp"'

Almost certainly not your fault, but if anyone could help me troubleshoot what that means and how to fix it I'd be grateful! I've cleared Craft's caches and removed Imager transforms.

Contents of imager.php:


return array(
	'*' => array(
		'useCwebp' => true,
		'cwebpPath' => '/usr/bin/cwebp',
	),
);```

GD seems to work fine, but when I try and use Imagick, I get this error message

Could you clarify this; if you have GD as your image driver, and useCwebp set to true, it works? But if you just switch to Imagick, it stops working? That'd be weird, since the image driver shouldn't matter if you're using cwebp.

Also, check if the temp file, in this case /srv/users/beyond-stage/apps/beyond-stage/storage/runtime/imager/temp/7321c9d3e512ac16a99d2b4f54bde5b7.jpg exists when you get this error.

Ok - weirdly, today I can't replicate that issue again. However, Imagick still doesn't generate a webp image at all. If I flick between adding and removing this in general.php:

'imageDriver' => 'gd',

When using GD, it will correctly generate webp images because craft.imager.serverSupportsWebp() returns true. If I remove the line (so it defaults to Imagick), that returns false and it serves a jpg instead.

What happens if you remove the craft.imager.serverSupportsWebp() conditional, and have imagick as image driver?

I get this error:

image