Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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!
Comment | File | Size | Author |
---|---|---|---|
#7 | 2020-07-30_16-17-00.png | 285.34 KB | blainelang |
#2 | webp-detect_webp_support-3008111-2.patch | 995 bytes | szeidler |
Comments
Comment #2
szeidler CreditAttribution: szeidler at Ramsalt Lab commentedI 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.
Comment #3
alexmoreno CreditAttribution: alexmoreno at Acquia commentedthis 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
Comment #5
alexmoreno CreditAttribution: alexmoreno at Acquia commentedComment #7
blainelang CreditAttribution: blainelang commentedI 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:
The image below is the relevant phpinfo for GD and ImageMagik
Should I open a new issue on this?
Comment #8
rajneesh.kumar CreditAttribution: rajneesh.kumar commentedHi ,
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