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

Niklan created an issue. See original summary.

renguer0’s picture

Confirmed, last update of Webp breaks my convertion.

useernamee’s picture

StatusFileSize
new567 bytes

Hey, I've come across this issue as well. My solution would be to fallback to `gd` toolkit if `imagick` is not loaded.

useernamee’s picture

StatusFileSize
new568 bytes

I was able to introduce syntax error in my previous patch. I removed it in #4.

useernamee’s picture

Status: Needs work » Needs review
huzooka’s picture

I never understood why WebP does not use the ImageToolkit manager...

renguer0’s picture

Last patch is working!

mlzr’s picture

Confirm the patch is working

bart vanhoutte’s picture

Status: Needs review » Fixed

Thanks everybody!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.