Review 13.4 Merged

87625[BUGFIX] Ensure AVIF files are only written when format is supported

Garvin Hicking CR +2 V +2 Normal +95 −5 updated 01/02/25, 16:36

Commit message

The implementation with #105704 contained a bug that did not properly
check if 'avif' writing support was enabled, and did not trigger
the proper fallback chain.

This is moved now so that an 'avif' target file format is checked
in both cases:

a) For generic 'web' format, keeping an existing AVIF file and
   resizing it. Note this fallback is currently only used in
   legacy cases.

b) For the specific 'avif' output format.

Tests are added to ensure this works.

A coupled bug #105847 is fixed to ensure that when the
conversion of a format fails, the actually used file extension
will be persisted to the processed file. This scenario only really
happens with the current AVIF implementation, which is why
this bugfix is not made independently.

Without this bugfix, when a file like "test.jpg" should
be converted to "test.avif", but no AVIF processing is
available (GraphicsMagick), the resulting file would be
stored as "csm_test_4815162342.avif" - containing
JPEG contents though. With this fix, the file will be
persisted as "csm_test_4815162342.avif.jpg" to also
indicate a processing fallback chain took place.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 3

Files 5

Review log 34

  1. Garvin Hicking commented on patch set 1 01/02/25, 16:26

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 01/02/25, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71833

  3. Garvin Hicking voted on patch set 1 CR +2 V +2 01/02/25, 16:36

  4. Garvin Hicking merged patch set 2 01/02/25, 16:36