#93981 Google webp and Apple heic/heif support for TYPO3 - Make default targetfileextensions for processed images configurable
Description
Actually the core defines hardcoded which target file-extensions are mapped, if nothing is defined via configuration-array.
In the function “determineTargetFileExtension” in file “sysext/core/Classes/Resource/Processing/AbstractGraphicalTask.php” it is defined that:
1) jpg, jpeg, png and gif will stay the same
2) uncropped svg will stay svg
3) unprocessable files with disabled option $GLOBALS[‘TYPO3_CONF_VARS’][‘GFX’][‘thumbnails_png’] will be gif
4) all other files will be converted to png
This disables the possibility to render all or specific image types to a default type. This is usally needed, if the use of the new file types heic/heif or webp is needed (suggested for better performance, Google!)
The usage of heic/heif files (Default on Apple Devices) oder webp is still configurable, but must be implemented by an integrator to every element. This could be a fluid template with the image viewhelper and the attribute fileExtension.
New configuration options in $GLOBALS[‘TYPO3_CONF_VARS’][‘GFX’] would make it possible to set the target file type. Optimum would be the possibility to add a mapping for each configured type.
A default example list could be something like that:
jpg -> webp
jpeg -> webp
webp -> webp
heic -> webp
png -> png
gif -> gif
svg -> svg
Maybe a default file extension option if no mapping exists.
There are a couple of other configurations we should have an eye on.
The options
$GLOBALS[‘TYPO3_CONF_VARS’][GFX][gif_compress]
$GLOBALS[‘TYPO3_CONF_VARS’][GFX][jpg_quality]
for example should maybe extended by new features for webp optimiazation
Either the “Image Processing” module in the backend could be extended with heic/heif and webp file format.
Last point. We could rethink to get better performance using the modern image formats in the backend.
Reviews 8
- main 78260[FEATURE] Add configuration for convertable image extensions
- main 91108[WIP][TASK] Extract GraphicalFunctions configuration
- main 94250[!!!][TASK] Remove deprecated GraphicalFunctions->gif_or_jpg()
- main 87582[FEATURE] Configure default image conversion/preview formats
- main 89040[TASK] Add GUI-managed map (keys+values) and list for Configuration
- 13.4 89332[TASK] Add GUI-managed map (keys+values) and list for Configuration
- main 87581[TASK] Add GraphicsMagick / ImageMagick f:image conversion tests
- 13.4 87629[TASK] Add GraphicsMagick / ImageMagick f:image conversion tests
Related issues 5
- Feature #88537WebP image format support
- Bug #93961Images not converting to webp in image viewhelpers
- Task #105858Add tests to verify f:image behavior with ImageMagick / GraphicsMagick
- Task #107822Split off a GraphicalSystemConfiguration service from GraphicalFunctions
- Task #109950Remove deprecated GraphicalFunctions->gif_or_jpg()