Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagick + webp issues on DigitalOcean/ServerPilot #288

Open
darylknight opened this issue Dec 9, 2019 · 4 comments
Open

Imagick + webp issues on DigitalOcean/ServerPilot #288

darylknight opened this issue Dec 9, 2019 · 4 comments

Comments

@darylknight
Copy link

darylknight commented Dec 9, 2019

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',
	),
);```
@aelvan
Copy link
Owner

aelvan commented Dec 9, 2019

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.

@darylknight
Copy link
Author

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.

@aelvan
Copy link
Owner

aelvan commented Dec 10, 2019

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

@darylknight
Copy link
Author

I get this error:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants