1.. include:: ../../Includes.txt
2
3=============================================================================
4Feature: #90416 - Specific target file extension in image-related ViewHelpers
5=============================================================================
6
7See :issue:`90416`
8
9Description
10===========
11
12TYPO3 core's shipped Fluid ViewHelpers now allow to optionally
13specify a target file extension via the new attribute `fileExtension`.
14
15This affects the following ViewHelpers:
16
17- :html:`<f:image>`
18- :html:`<f:media>`
19- :html:`<f:uri.image>`
20
21This is rather important for specific scenarios where a :html:`<picture>` tag with multiple images are requested, allowing
22to e.g. customize rendering for `webp` support, if the servers' ImageMagick version supports `webp` conversion.
23
24In other regard, this might become useful to specify the output
25for preview images of `pdf` files which can be converted via `GhostScript` if installed.
26
27
28Impact
29======
30
31TYPO3 Integrators can now use the additional attribute
32in their custom Fluid Templates for specific use cases.
33
34Example:
35
36.. code-block:: html
37
38   <picture>
39     <source srcset="{f:uri.image(image: fileObject, treatIdAsReference: true, fileExtension: 'webp')}" type="image/webp">
40     <source srcset="{f:uri.image(image: fileObject, treatIdAsReference: true, fileExtension: 'jpg')}" type="image/jpeg">
41     <f:image image="{fileObject}" treatIdAsReference="true" alt="{fileObject.alternative}" />
42   </picture>
43
44.. index:: Fluid, ext:fluid
45