- Merge request !936Issue #3202016: Let GDToolkit support AVIF image format โ (Open) created by mondrake
The Needs Review Queue Bot โ tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
almost 2 years ago 8:48pm 14 March 2023 - ๐ซ๐ทFrance andypost
it's RTBC IMO but needs summary update and CR, probably release note as well
- ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Added a simple CR and RN snippet https://www.drupal.org/node/3348348 โ
- Status changed to Needs work
almost 2 years ago 10:17pm 18 March 2023 The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
almost 2 years ago 12:23am 19 March 2023 - ๐ซ๐ทFrance andypost
Rebased and applied suggestion for strict comparison
- ๐ณ๐ฟNew Zealand quietone
FYI, it seem there are problems with the diff.
$ git ac https://git.drupalcode.org/project/drupal/-/merge_requests/936.diff % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7846 0 7846 0 0 20701 0 --:--:-- --:--:-- --:--:-- 20701 error: missing binary patch data for 'core/tests/fixtures/files/img-test.avif' error: binary patch does not apply to 'core/tests/fixtures/files/img-test.avif' error: core/tests/fixtures/files/img-test.avif: patch does not apply
- ๐ฆ๐บAustralia mstrelan
@quietone that seems like a gitlab issue. The .patch URL (instead of .diff) shows the binary content of the avif file.
- ๐ณ๐ฟNew Zealand quietone
@mstrelan, thanks. I forgot about the .patch version
- ๐ฌ๐งUnited Kingdom catch
I think we can add support independently, but both this and the existing webp support make โจ Add fallback format support to responsive images Needs work more important so that sites can actually use it. Adding as a related issue.
Does the GD toolkit already handle whether the webserver has support for AVIF - i.e. does it only show in the list of options if it's actually going to work?
- ๐ซ๐ทFrance andypost
The check was added in #3116611: Add a requirements check for GD support of allowed image types โ
but not every place in core using the filtered list of formats, probably there was an issue about add general requirements check
- Status changed to Needs work
over 1 year ago 10:02pm 21 March 2023 The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
over 1 year ago 12:00am 22 March 2023 - ๐ซ๐ทFrance andypost
There's binary file in patch, so to apply patch it needs to download it and apply using
git apply 936.patch
or usepatch -p1 -i 936.diff
(it should be downloaded https://git.drupalcode.org/project/drupal/-/merge_requests/936.diff using .diff instead of .patch) - Status changed to Needs work
over 1 year ago 12:53am 22 March 2023 The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
over 1 year ago 12:58am 22 March 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
@catch re #116 - yes the toolkit will tell if AVIF is available, but that check is unfortunately not enough. In order to have FULL support, PHP needs to be compiled with an AVIF codec, and thatโs non-trivial, see #100 and #103; besides, thereโs no way to detect automatically if the codec is installed, see #104.
- ๐ฌ๐งUnited Kingdom catch
Thanks @mondrake I had read that earlier in the issue but had forgotten about it by now - I've added both of those to the issue summary. Also thanks to @andypost for opening them and working on them!
I wonder a bit if we should do some kind of kludgy support detection by catching the error in the meantime until those issues are fixed (or at least until AVIF is more widely available?), not sure where to put that though and if it's expensive we might have to cache the results or something.
- ๐ซ๐ทFrance andypost
Meantime animated AVIS added to latest Firefox https://www.mozilla.org/en-US/firefox/113.0/releasenotes/
- ๐ช๐จEcuador jwilson3
Given the bleeding edge support (php 8.2) for AVIF, and complexity in it being compiled into PHP, it occurred to me that there should be an option to work around those limitations in contrib space. Alas, there is no conversion image style effect feature that I could find, so I opened up a feature request in what seemed like the most logical place to put it.
โจ Add an AVIF conversion image styles effect Active
Sadly that module doesn't seem like it has been getting a lot of love, use, or maintenance for a few years now.
- Status changed to Needs work
over 1 year ago 10:26pm 31 May 2023 - ๐บ๐ธUnited States smustgrave
Can MR be updated for 11.x
Also open thread mentions needing a follow up if that could be created also before the new branch is made.
- ๐บ๐ธUnited States smustgrave
Reading wrong commit forget the follow-up part.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
@andypost done, I guess this needs a rebase now
- last update
over 1 year ago 29,426 pass - Status changed to Needs review
over 1 year ago 11:30am 1 June 2023 - Status changed to RTBC
over 1 year ago 1:34pm 1 June 2023 - Status changed to Needs work
over 1 year ago 2:49pm 1 June 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
Unfortunately thereโs no solution for #124 yet, and IMHO getting this in as it is now would be very fragile.
NW for #124.
NOTE: the Imagemagick toolkit is a working alternative (as long as the Imagemagick binary can support AVIF itself).
- last update
over 1 year ago 29,461 pass - ๐ซ๐ทFrance andypost
Rebased and sqashed commits into 2 for 11.x branch
- ๐ซ๐ทFrance andypost
Filed upgrade of PHP 8.3 CI image to latest Debian stable, AVIF is shipped now with
libaom
dependency fixedhttps://git.drupalcode.org/project/drupalci_environments/-/merge_request...
- ๐ซ๐ทFrance andypost
Updated is with https://jakearchibald.com/2020/avif-has-landed/ which perfectly explains benefits
- ๐ซ๐ทFrance andypost
I think we can add to reports if no AVIF support available so people can read logs to get why imagecreatefromavif() or imageavif() are not found to solve #124
- last update
over 1 year ago 29,908 pass - last update
about 1 year ago Custom Commands Failed - ๐ฆ๐บAustralia mstrelan
I think we can add to reports if no AVIF support available so people can read logs to get why imagecreatefromavif() or imageavif() are not found to solve #124
Unfortunately these functions still exist, even if avif is not supported. I did find the following code (found in https://bugs.php.net/bug.php?id=81217) would trigger a warning:
$ php -r 'var_dump(imageavif(imagecreatetruecolor(8, 8), "/tmp/test"));' PHP Warning: imageavif(): AVIF image support has been disabled in Command line code on line 1
I've tried to test for this in the status report using a pattern I found in \Drupal\Core\Render\ElementInfoManager::buildInfo. This works in my very limited test of two environments, one supporting AVIF, one not.
- last update
about 1 year ago 30,192 pass - ๐จ๐ญSwitzerland Lukas von Blarer
I needed that for AVIF to work with imagemagick, but probably that is needed for GD as well: ๐ ExtensionMimeTypeGuesser doesn't support .avif Active
- Status changed to Needs review
about 1 year ago 8:11pm 2 December 2023 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
I put some caching around @mstrelan solution + added some info in status report if AVIF write support is broken.
This fits #124 I think so back to NR.
IMHO the CR should be expanded with some hints on how to fix the lack of the codec or of the binding of libavif. Thatโs above me though, help appreciated.
- Status changed to Needs work
12 months ago 7:00pm 21 December 2023 - ๐บ๐ธUnited States smustgrave
Not sure correct status, but #141 mentions change record updates. Which is technically apart of the review process.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
php/php-src just committed Image format detection false positives with external GD #12019. This will likely only hit PHP 8.4.
- ๐ซ๐ทFrance andypost
Core's CI images are not yet using external GD https://git.drupalcode.org/project/drupalci_environments/-/blob/producti...
--with-external-gd Use external libgd
- Status changed to Needs review
11 months ago 6:11am 30 January 2024 - ๐ซ๐ทFrance andypost
Not sure CR should elaborate how specific distros can install codec if it missing, it's unrelated to core
- ๐บ๐ธUnited States smustgrave
Brought up in #needs-review-queue-initative in slack. Was mentioned by @catch that
detection logic is still in progress
and that parts will need the release manager review.
- ๐บ๐ธUnited States smustgrave
Wonder if anyone has any update for the previous comment?
- ๐ช๐จEcuador jwilson3
IMHO the CR should be expanded with some hints on how to fix the lack of the codec or of the binding of libavif.
The avif contrib module leverages the lib_avif dependency, maybe the CR could point people to the issue I linked above if they're not able to affect how PHP is compiled with avif support enabled on their hosting environment. โจ Add an AVIF conversion image styles effect Active
- Status changed to Needs work
7 months ago 11:19pm 28 May 2024 - ๐ฆ๐บAustralia larowlan ๐ฆ๐บ๐.au GMT+10
The code here looks good to me.
The needs release manager review tag was added in 9.x era when we were discussing min PHP requirements.
I don't think we need it anymore - especially as we're into 11.x territory where 8.2+ will be available.
I think the remaining tasks here are to update the CR with instructions for folks on how to add avif support to their version of PHP
Tagging as NW for that.
Great work here folks
- Status changed to Needs review
4 months ago 4:28pm 8 August 2024 - heddn Nicaragua
We are in Drupal 11.1-land now. Which will require PHP 8.3. I've updated the related CR to include libavif installation instructions. Back to NR.
- ๐ซ๐ทFrance andypost
Merged 11.x and removed PHP 8.2 related workaround
I simplified check to prevent checking avif writes if no readonly support
- Status changed to Needs work
3 months ago 4:01pm 13 September 2024