Closed (fixed)
Project:
Drupal core
Version:
11.2.x-dev
Component:
image system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 May 2025 at 04:51 UTC
Updated:
27 Jun 2025 at 13:16 UTC
Jump to comment: Most recent
Comments
Comment #2
xmacinfoIt also affects user creation.
Comment #3
xmacinfoPHPStorm finds the GD file with the proper function:
/Applications/PhpStorm.app/Contents/plugins/php-impl/lib/php.jar!/stubs/gd/gd.phpI tried clearing the cache a few times to no luck.
Using PHP Version 8.4.6 or PHP 8.3.16, Drupal Status Report PHP info has:
GD Support enabled
GD Version bundled (2.1.0 compatible)
Comment #4
ishani patel commentedHello,
I've followed the steps and checked with D11.1.6, and using PHP Version 8.3.19
But not reproduce the issue.
Thank you!
Comment #5
mstrelan commentedYou somehow have a php build that is missing the global imageavif function. What happens if you modify that line 565 to
$supported = function_exists('imageavif') && imageavif(imagecreatetruecolor(1, 1), $tempFile, 0, 10) && fstat($tempFile)['size'] > 0;Comment #6
cilefen commentedI linked to this issue from #3202016: Let GDToolkit support AVIF image format. Yes it seems like Drupal should check whether the function exists before calling it.
Comment #7
andypostNot clear how it possible to by-pass guard
function_exists('imageavif')maybe this function exists but disabled somehowComment #8
cilefen commentedI may be misunderstanding your comment but in Drupal there is not a
function_existscheck forimageavif.Comment #9
xmacinfo@ishani patel The bug affect only Drupal 11.2.x, not Drupal 11.1.x.
Comment #10
cilefen commentedComment #12
grimreaperHi,
I am encountering the same fatal error on an env without AVIF support.
On status report page, there is a warning about the missing AVIF support but this does not prevent the fatal error.
Comment #13
mondrakeGiven that #3524206: Use avif with webp fallback for all core image styles has practically made AVIF the default for 11.2, I think this will be Critical in case PHP is not binding the avif functions.
Comment #14
mondrakeComment #15
xmacinfo@grimreaper
Indeed, now I see the status message error message:
Not sure why I was not seeing this yesterday.
Comment #16
xmacinfoMy development stack will not support AVIF for the foreseeable future. Fortunately, my production stack supports AVIF.
AVIF Support enabledSo, we need to make sure the fallback to WEBP works on all user create/edit paths:
admin/people/create/user/editor
/user/1/editComment #17
andypostThis guard is required
Comment #18
xmacinfoYes, but I do not see a fallback to WEBP.
Are we returning FALSE instead of falling back to WEBP?
Comment #19
andypostComment #20
andypost@xmacinfo this method is for detection, see the commit from #3524206: Use avif with webp fallback for all core image styles
Comment #21
mstrelan commented@xmacinfo this function is just a check to see if avif is supported. It is called by GDToolkit::supportedTypes and if it returns FALSE then we don't include avif as a supported type. The
image_convert_avifplugin checks if avif is supported and creates an avif if it is, and a webp (or whatever else you configure) if not. Agree with the RTBC but would be good for @xmacinfo or @grimreaper to confirm it works with this patch.Comment #22
grimreaperHi,
I confirm the fix and RTBC on an environment without AVIF support, no more fatal error when displaying a form with an image field like /media/add/image
Thanks!
Comment #25
catchCommitted/pushed to 11.x and cherry-picked to 11.2.x, thanks!
Comment #28
damien laguerre commentedI get a warning message after installing the 11.2:
Debian 11 / PHP8.3.
GD library Version => 2.3.3
Comment #29
damien laguerre commentedI suggest adding an "@"
Comment #30
mondrake@damien laguerre would you kindly open a new issue for that, and link it here? This issue is closed and unlikely to be reopened.
Comment #31
greg.harveyI made a new issue here. #3532792: avif error - Could not encode image: No codec available