Skip to content

Commit

Permalink
[FEATURE] Add support for AVIF files in GIFBuilder
Browse files Browse the repository at this point in the history
Resolves: TYPO3-Documentation/Changelog-To-Doc#1050
Releases: main, 13.4
  • Loading branch information
linawolf committed Nov 20, 2024
1 parent 90788ac commit 6fb363d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
19 changes: 19 additions & 0 deletions Documentation/Gifbuilder/Examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ Examples
.. contents::
:local:

.. _gifbuilder-examples-avif:

Using the AVIF format
=====================

.. versionadded:: 13.3

AVIF is an image format, that is supported by most modern browsers, and usually
has a better compression (= smaller file size) than jpg files.

.. important::

Before using this feature, please check whether the used operating system
actually supports de/encoding AVIF files. Especially Debian 11 (Bullseye)
and older or systems forked from that may lack AVIF support.

.. literalinclude:: _snippets/_avif.typoscript
:caption: EXT:config/sites/my_site/setup.typoscript


Masking semi-transparent images (Logos) onto other images
=========================================================
Expand Down
27 changes: 20 additions & 7 deletions Documentation/Gifbuilder/Properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,9 @@ charRangeMap
format
======

.. versionchanged:: 13.0
The default format is now "png". Before TYPO3 v13.0 this was "gif".

.. versionadded:: 13.0
Support for WebP has been added.

.. confval:: format
:name: gifbuilder-properties-format
:type: "gif" / "jpg" / "jpeg" / "png" / "webp"
:type: "gif" / "jpg" / "jpeg" / "png" / "webp" / "avif"
:Default: png

File type of the output image.
Expand All @@ -170,9 +164,16 @@ format

* :ref:`$TYPO3_CONF_VARS['GFX']['jpg_quality'] <t3coreapi:typo3ConfVars_gfx_jpg_quality>` for a JPG image
* :ref:`$TYPO3_CONF_VARS['GFX']['webp_quality'] <t3coreapi:typo3ConfVars_gfx_webp_quality>` for a WebP image
* :ref:`$TYPO3_CONF_VARS['GFX']['avif_quality'] <t3coreapi:typo3ConfVars_gfx_webp_quality>` for a AVIF image

or via the :ref:`gifbuilder-properties-quality` property on a per-image basis.

.. versionchanged:: 13.0
The default format is now "png". Before TYPO3 v13.0 this was "gif".

.. versionadded:: 13.0
Support for WebP and AVIF have been added.


.. _gifbuilder-properties-maxHeight:

Expand Down Expand Up @@ -231,6 +232,18 @@ quality

.. _"lossless" compression: https://developers.google.com/speed/webp/docs/compression#lossless_webp

.. _gifbuilder-properties-speed:

speed
=====

.. confval:: speed
:name: gifbuilder-properties-speed
:type: integer

Set the "speed" for files in format AVIF (See
https://www.php.net/manual/en/function.imageavif.php for more details).


.. _gifbuilder-properties-transparentBackground:

Expand Down
15 changes: 15 additions & 0 deletions Documentation/Gifbuilder/_snippets/_avif.typoscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
page.10 = IMAGE
page.10 {
file = GIFBUILDER
file {
backColor = yellow
XY = 1024,199
format = avif
quality = 44
speed = 1

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

0 comments on commit 6fb363d

Please sign in to comment.