The code in createWebpCopy doesn't check for extension so this leads to error.
Error: Class 'Imagick' not found в Drupal\webp\Webp->createWebpCopy() (line 89 from /web/modules/contrib/webp/src/Webp.php)
In webp_requirements we have this condition:
if (extension_loaded('imagick')) {
$supported_formats = array_map('strtoupper', Imagick::queryFormats());
}
This prevents from errors during requirements check, but not protect when webp is creating.
I don't provide the patch because it's not clear what way to fix this properly:
1. If everything works without Imagick, we need to improve condition in webp creation method.
2. If it's required, add it to composer dependencies and doesn't allow enable module without it.
Comments
Comment #2
renguer0 commentedConfirmed, last update of Webp breaks my convertion.
Comment #3
useernamee commentedHey, I've come across this issue as well. My solution would be to fallback to `gd` toolkit if `imagick` is not loaded.
Comment #4
useernamee commentedI was able to introduce syntax error in my previous patch. I removed it in #4.
Comment #5
useernamee commentedComment #6
huzookaI never understood why WebP does not use the ImageToolkit manager...
Comment #7
renguer0 commentedLast patch is working!
Comment #8
mlzrConfirm the patch is working
Comment #10
bart vanhoutte commentedThanks everybody!