Currently if webp is not supported by the GD library, the creation of the webp variant will silently fail. It outputs

Error: Call to undefined function Drupal\webp\imagewebp() in Drupal\webp\Webp->createWebpCopy() ...

as a PHP error and will show up in the Drupal dblog.

It would be a fantastic UX improvement to detect non-support (http://php.net/manual/en/function.gd-info.php) and if it's not available, display a message on the status page, with a link to appropriate documentation.

Thanks for the great module!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mherchel created an issue. See original summary.

szeidler’s picture

Status: Active » Needs review
FileSize
995 bytes

I ran into the "trap" myself in my local environment. As it can cause an error on all image derivatives, it should prevent the module from being installed and state it on the status page, if the module was already installed.

alexmoreno’s picture

this is a great addition, as it should prevent some other errors that I've seen in the queue issue (and suffered myself as well) thank you @szeidler and @mherchel

  • alexmoreno committed f6f62a6 on 8.x-1.x authored by szeidler
    Issue #3008111 by szeidler, mherchel, alexmoreno: Detect webp non-...
alexmoreno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

blainelang’s picture

FileSize
285.34 KB

I am using version 8.x-1.0-beta4 on my Drupal 8.9.2 site and have it working locally with GD but Pantheon hosting does not yet support the GD option to enable webp.

I am seeing this error in the logs:

Error: Call to undefined function Drupal\webp\imagewebp() in Drupal\webp\Webp->createWebpCopy() (line 124 of /srv/bindings/a705961d281843be9eeecf010149fc0b/code/web/modules/contrib/webp/src/Webp.php)

The image below is the relevant phpinfo for GD and ImageMagik

PHP Info

Should I open a new issue on this?

rajneesh.kumar’s picture

Hi ,
I am using the same version of webp module i.e. 8.x-1.0-beta4 with drupal 8.9.1 on pantheon
and getting the same error. Though it was working fine with earlier version of webp. Any leads?

Thanks