I like the idea too, but maybe a better synthax (shorter) should be:
<typo3.media:image preset="typo3.media:small" .../>
Better because:
- Shorter (imagine preset with maximumWith, allowCropping, …)
- When you are not in the Media package your don’t have access to the settings, so with the preset name, people can add new preset in the
Settings.yaml
and use them anywhere - When used for a complete project, it’s pretty easy to have an overview of the available presets
- Use a name space to avoid collision, with “small” that can exist for multiple purpose (Media package & Site package by ex.)
TYPO3:
Media:
autoGeneratedThumbnails:
'TYPO3.Media:small':
width: 50
height: 50
'TYPO3.Media:large':
width: 200
height: 200
'TYPO3.Media:small-square':
width: 80
height: 80
allowCropping: TRUE
Generated thumbnail can be “tagged” with the preset identifier, and the CLI to clear thumbnail can be updated to support preset based cleaning.
About the performance impact, the thumbnail generation can be async based on job queue, it’s not that hard to provide a Interface that can be replace by something else, we can even provide a Flowpack package to support beanstalk by example.
We even have a nice DTO for those Presets TYPO3\Media\Domain\Model\ThumbnailConfiguration