Review main Merged

87240[TASK] Enable AVIF support for ImageMagick

Garvin Hicking CR +2 V +2 Hard +213 −45 updated 12/19/24, 09:09

Commit message

Since GIFBUILDER already supports AVIF through the GDlib functions,
it would be expected to have ImageMagick support for transforming
regular images as well.

This task adds this functionality, exposes the checks for it
through the "reports" module and the environment check for image
generation.

The output of "convert -list format" is parsed (like for webp
support) to detect avif support. GraphicsMagick does not offer
writing AVIF formats yet. A messsage is emitted to hint
at possible missing support for writing this format.

Since MIME-Type detection wrongfully returns
"image/heif" for .avif file types, the proper MIME-Type
(image/avif) is added to `$GLOBALS['TYPO3_CONF_VARS']['SYS']`
`['FileInfo']['fileExtensionToMimeType']`.

The image testing module also is streamlined for some
spelling fixes and proper GraphicsMagick mentions.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Chris Müller +1
    • Simon Schaufelberger +1
    • Benni Mack +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Chris Müller +1
    • Simon Schaufelberger +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 3447

Show 1322 earlier messages
  1. Garvin Hicking uploaded patch set 1 11/26/24, 16:43

  2. core-ci voted on patch set 1 V -1 11/26/24, 16:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70215

  3. Garvin Hicking uploaded patch set 2 V -1 11/26/24, 17:00

    CGL
  4. core-ci voted on patch set 2 V -1 11/26/24, 17:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70216

  5. Garvin Hicking uploaded patch set 3 V -1 11/27/24, 10:03

    Fix mime type detection
  6. core-ci voted on patch set 3 V +1 11/27/24, 10:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70244

  7. Garvin Hicking uploaded patch set 4 V +1 11/27/24, 10:32

    Disable whole test until updated
  8. core-ci voted on patch set 4 V +1 11/27/24, 10:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70247

  9. Benni Mack commented on patch set 4 11/28/24, 10:57

    please have a call about this
  10. Garvin Hicking uploaded patch set 5 V +1 12/05/24, 09:16

  11. Garvin Hicking rebased onto patch set 6 12/05/24, 09:18

  12. core-ci voted on patch set 6 V +1 12/05/24, 09:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70635

  13. core-ci voted on patch set 5 V -1 12/05/24, 09:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70632

  14. Garvin Hicking updated the commit message in patch set 7 V +1 12/05/24, 10:31

  15. core-ci voted on patch set 7 V +1 12/05/24, 10:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70638

  16. Garvin Hicking updated the commit message in patch set 8 V +1 12/11/24, 11:13

  17. core-ci voted on patch set 8 V +1 12/11/24, 11:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70914

  18. Garvin Hicking updated the commit message in patch set 9 V +1 12/11/24, 11:28

  19. core-ci voted on patch set 9 V +1 12/11/24, 11:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70921

  20. Benni Mack voted on patch set 9 CR +1 V +1 12/11/24, 11:47

  21. Simon Schaufelberger commented on patch set 9 CR -1 12/12/24, 12:29

    on it
  22. Simon Schaufelberger uploaded patch set 10 CR +1 V +1 12/12/24, 13:06

  1. Simon Schaufelberger voted on patch set 10 CR +1 V +1 12/12/24, 13:07

  2. core-ci voted on patch set 10 V +1 12/12/24, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71029

  3. Benni Mack voted on patch set 10 CR +1 V +1 12/13/24, 17:02

  4. Guido Schmechel voted on patch set 10 CR +1 V +1 12/13/24, 20:30

  5. Chris Müller commented on patch set 10 V -1 12/17/24, 12:15

    The reference image for "Read avif" is broken in my installation. It is a data: URL without a value: <img class="reference" src="data:image/jpg;base64,">
  6. Chris Müller commented on patch set 10 12/17/24, 12:16

    Reply

    Same for "Write avif" and "jpg to avif"
  7. Chris Müller commented on patch set 10 V 0 12/17/24, 12:32

    Reply

    Okay, resolved. Applied the patch with Gilbertsoft's patch package, seems that binaries are not correctly processed.
  8. Garvin Hicking uploaded patch set 11 CR +1 V +1 12/17/24, 13:11

    Make sure to skip test when unvavailable
  9. Garvin Hicking commented on patch set 11 12/17/24, 13:13

    Reply

    Thank you for testing this, and finding out that the error messages when AVIF writing did not work were misleading, and not showing the 'soft fail' message. The other more generic message has also been updated to reflect the need for specific codes.
  10. core-ci voted on patch set 11 V +1 12/17/24, 13:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71270

  11. Chris Müller voted on patch set 11 CR +1 V +1 12/17/24, 13:47

  12. Garvin Hicking uploaded patch set 12 CR +1 V +1 12/17/24, 14:08

  13. core-ci voted on patch set 12 V +1 12/17/24, 14:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71278

  14. Chris Müller voted on patch set 12 CR +1 V +1 12/17/24, 14:18

  15. Simon Schaufelberger voted on patch set 12 CR +1 V +1 12/17/24, 15:04

  16. Garvin Hicking commented on patch set 13 CR +1 V +1 12/17/24, 15:17

    Published edit on patch set 12.
  17. core-ci voted on patch set 13 V +1 12/17/24, 15:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/71288

  18. Benni Mack voted on patch set 13 CR +1 V +1 12/17/24, 15:28

  19. Simon Schaufelberger voted on patch set 13 CR +1 V +1 12/17/24, 15:29

  20. Chris Müller voted on patch set 13 CR +1 V +1 12/18/24, 17:31

  21. Garvin Hicking voted on patch set 13 CR +2 V +2 12/18/24, 17:47

  22. Garvin Hicking merged patch set 14 12/18/24, 17:47

  23. Sebastian Iffland commented on patch set 14 12/18/24, 18:06

    GraphicalFunctions.php:333

    Feeling a bit lost… maybe too late, maybe someone could clarify. If I read right, this `elseif` construct can never be reached since 'avif' is listed in `$this->webImageExt` (L98), which then means it is in_array and the starting if is being processed.
  24. Simon Schaufelberger commented on patch set 14 12/18/24, 18:16

    GraphicalFunctions.php:333 Reply

    indeed, it seams like this can be dropped.
  25. Garvin Hicking commented on patch set 14 12/19/24, 09:09

    GraphicalFunctions.php:333 Reply

    Good point. The isAvailable check however should be performed, so this logic needs to be massaged a bit. I'll address this in a follow-up. Please see https://review.typo3.org/c/Packages/TYPO3.CMS/+/87567