Review main Merged

81712[FEATURE] Add support for AVIF files in GIFBuilder

Benni Mack CR +2 V +2 Normal +148 −5 updated 04/21/26, 15:04

Commit message

The Image AVIF format is supported by "libgd" since
PHP 8.1 which can now be used to create images by
GIFBUILDER.

See https://en.wikipedia.org/wiki/AVIF

Example:
    page.10 = IMAGE
    page.10 {
      file = GIFBUILDER
      file {
        backColor = yellow
        XY = 1024,199
        format = avif
        speed = 8
        quality = 44

        10 = IMAGE
        10.offset = 10,10
        10.file = 1:/my-image.jpg
      }
    }

Review

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

Issues 1

Files 10

Review log 5266

Show 3141 earlier messages
  1. Benni Mack uploaded patch set 1 11/08/23, 22:08

  2. core-ci voted on patch set 1 V -1 11/08/23, 22:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48732

  3. Benni Mack uploaded patch set 2 V -1 11/09/23, 09:25

  4. core-ci voted on patch set 2 V +1 11/09/23, 09:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48743

  5. Benni Mack uploaded patch set 3 V +1 11/09/23, 09:57

  6. core-ci voted on patch set 3 V +1 11/09/23, 10:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48744

  7. Oliver Klee commented on patch set 3 11/09/23, 10:17

    Looks very good! I've commented on two smaller things.

    GifBuilder.php:493

    Why is the lower value for quality here 10 while it is 0 in the property? (My best guess is that is should be 0 here, too.)

    GifBuilder.php:2607

    Should we provide the allowed ranges here? ```php * @param int<10, 100> $quality The image quality (for JPEG, WebP and AVIF files) * @param int<0, 10>|null $speed The image speed (for AVIFs), null to use the default ```
  8. Andreas Kienast commented on patch set 3 11/10/23, 08:03

    GifBuilder.php:187

    Should we allow `-1`, which falls back to gdlib's default quality of 30?
  9. Benni Mack commented on patch set 3 11/10/23, 15:28

    GifBuilder.php:187 Reply

    I would not set this to -1, as this is a GDlib specific thing, and I'd like to keep the options technology-free as much as possible.

    GifBuilder.php:493 Reply

    Done

    GifBuilder.php:2607 Reply

    Done
  10. Benni Mack uploaded patch set 4 V +1 11/10/23, 15:28

  11. Oliver Klee voted on patch set 4 CR +1 11/10/23, 15:37

  12. core-ci voted on patch set 4 V -1 11/10/23, 15:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48792

  13. Benni Mack uploaded patch set 5 CR +1 V -1 11/10/23, 15:44

  14. core-ci voted on patch set 5 V +1 11/10/23, 15:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48793

  15. Benni Mack commented on patch set 5 11/10/23, 16:10

    GifBuilder.php:2607 Reply

    I reverted this change for the time being as phpstan failed
  16. Oliver Klee voted on patch set 5 CR +1 11/10/23, 16:43

  17. Oli Bartsch commented on patch set 5 V -1 11/15/23, 15:13

    Feature-102353-AVIFSupportForImagesGeneratedByGIFBUILDER.rst:47

    Should this also be added to tsref.xml?

    GifBuilder.php:493

    Shouldn't this default to 0 like for jpg and webp?

    GifBuilder.php:2632

    This currently fails for me with: PHP Warning: imageavif(): avif error - Could not encode image: No codec available in /var/www/html/typo3/sysext/frontend/Classes/Imaging/GifBuilder.php line 2632
  18. Benni Mack commented on patch set 5 11/16/23, 08:48

    GifBuilder.php:2632 Reply

  19. Benni Mack commented on patch set 5 06/13/24, 15:57

    GifBuilder.php:2632 Reply

    Only works in debian v12+ versions and also fixed in latest ddev versions. Can be documented in the RST. However, I can't write a test for this, as it works for me. How should we proceed @bo@cedev.de ?
  20. Benni Mack uploaded patch set 6 CR +1 V +1 06/21/24, 10:16

  21. core-ci voted on patch set 6 V +1 06/21/24, 10:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59989

  22. Simon Schaufelberger uploaded patch set 7 V +1 09/10/24, 20:01

  23. core-ci voted on patch set 7 V +1 09/10/24, 20:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65336

  24. Oliver Klee wrote 09/11/24, 10:53

    Removed reviewer Oliver Klee.
  25. Andreas Kienast commented on patch set 7 09/11/24, 11:32

    GifBuilder.php:187

    Avif allows `-1` as argument for `quality`, falling back to the default value (currently 30). IMO we should allow this, what do you think?

    GifBuilder.php:482

    Avif allows `-1` as argument for speed, falling back to the default value (currently 6). IMO we should allow this, what do you think?
  26. Andreas Kienast uploaded patch set 8 V +1 09/12/24, 08:53

  27. core-ci voted on patch set 8 V +1 09/12/24, 09:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65546

  28. Oliver Hader voted on patch set 8 CR +1 09/12/24, 10:20

  29. Oliver Hader uploaded patch set 9 CR +1 V +1 09/12/24, 10:40

  30. core-ci voted on patch set 9 V +1 09/12/24, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65555

  31. Guido Schmechel voted on patch set 9 V +1 09/14/24, 05:55

  32. Guido Schmechel voted on patch set 9 CR +1 09/15/24, 11:00

  33. Andreas Kienast voted on patch set 9 CR +1 V +1 09/16/24, 09:00

  34. Markus Klein commented on patch set 9 CR +1 09/16/24, 10:24

    GifBuilder.php:2632 Reply

    Add a note to the rst about this potential issue, but nothing more.
  35. Andreas Kienast uploaded patch set 10 CR +1 V +1 09/16/24, 10:50

  36. Andreas Kienast commented on patch set 10 09/16/24, 10:51

    GifBuilder.php:2632 Reply

    I've added a note. Please check whether it's fine.
  37. core-ci voted on patch set 10 V +1 09/16/24, 10:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65879

  38. Markus Klein commented on patch set 10 CR +1 09/16/24, 11:44

    Perfect, thanks!

    GifBuilder.php:2632 Reply

    Acknowledged
  39. Andreas Kienast voted on patch set 10 CR +1 V +1 09/16/24, 13:01

  40. Simon Schaufelberger commented on patch set 10 CR +1 V +1 09/16/24, 14:12

    GifBuilder.php:187 Reply

    Done
  41. Simon Schaufelberger commented on patch set 10 09/16/24, 14:12

    GifBuilder.php:482 Reply

    Done

    GifBuilder.php:493 Reply

    Done
  1. Markus Klein commented on patch set 10 V -1 09/16/24, 14:28

    install tool image testing fails if avif support is not present. PHP Warning: file_get_contents(/var/www/html/typo3temp/assets/images/installTool-gdBox66e8407cdfe07941584967.avif): Failed to open stream: No such file or directory in /var/www/html/typo3/sysext/install/Classes/Controller/EnvironmentController.php line 1158
  2. Markus Klein commented on patch set 10 09/16/24, 14:33

    EnvironmentController.php:823

    If avif support is not available in PHP this returns false
  3. Markus Klein voted on patch set 10 CR -1 09/16/24, 14:33

  4. Simon Schaufelberger commented on patch set 10 CR 0 V 0 09/16/24, 15:11

    Reply

    would you like to fix it so it could make it for tomorrow hopefully?
  5. Markus Klein commented on patch set 10 09/16/24, 19:17

    Reply

    Will try to give my best to help here!
  6. Markus Klein uploaded patch set 11 CR +1 V +1 09/16/24, 20:30

  7. Markus Klein commented on patch set 11 09/16/24, 20:30

    EnvironmentController.php:823 Reply

    Done
  8. Markus Klein uploaded patch set 12 09/16/24, 20:38

  9. Markus Klein commented on patch set 11 09/16/24, 20:38

    Reply

    Done

    Feature-102353-AVIFSupportForImagesGeneratedByGIFBUILDER.rst:47 Reply

    Done
  10. Stefan Bürk uploaded patch set 13 09/16/24, 20:40

  11. Garvin Hicking commented on patch set 14 09/16/24, 20:41

    Published edit on patch set 13.
  12. Garvin Hicking commented on patch set 14 09/16/24, 20:43

    EnvironmentController.php:834

    The other tests here use a custom "get" method for the error message. maybe for consistency do that here too? Sadly only on mobile so I can't easily do that myself.
  13. Stefan Bürk commented on patch set 14 CR -1 09/16/24, 20:45

    on it now
  14. core-ci voted on patch set 11 V +1 09/16/24, 20:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65924

  15. Stefan Bürk uploaded patch set 15 CR -1 09/16/24, 20:53

  16. core-ci voted on patch set 12 V -1 09/16/24, 20:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65925

  17. Stefan Bürk commented on patch set 15 09/16/24, 20:56

    EnvironmentController.php:834 Reply

    done
  18. core-ci voted on patch set 15 V +1 09/16/24, 21:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65929

  19. Garvin Hicking voted on patch set 15 CR +1 V +1 09/16/24, 21:11

  20. core-ci voted on patch set 12 V +1 09/16/24, 21:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65925

  21. Stefan Bürk voted on patch set 15 CR +2 V +2 09/16/24, 21:30

  22. Stefan Bürk merged patch set 16 09/16/24, 21:30

  23. Andreas Kienast commented on patch set 16 09/17/24, 06:19

    tsref.xml:1380

    -1?
  24. Markus Klein commented on patch set 16 09/17/24, 06:45

    tsref.xml:1380 Reply

    then we need "int (-1-10)" here?
  25. Andreas Kienast commented on patch set 16 09/17/24, 07:14

    tsref.xml:1380 Reply Unresolved

    I think so, yes.