-
-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
Description
Is there an existing issue for this topic?
- I have searched the existing issues
Description
SVG files are currently handled as a black box and neither cropping nor dimension informations are available.
This has the following drawbacks:
- no dimension informations can be rendered for svg images leading to layout shifts once they are finally loaded (this os also reported in FEATURE: set SVG image sizes by crawling width, height, viewbox attributes from resource stream #3959 )
- while we can specify a required aspect for images this is not enforced for svgs which can break the layout
- cropping of svg is not possible which is sad since svg allows that without quality loss
Possible Solution
The composer package contao/imagine-svg allows to crop and resize svg images but uses a slightly different interface than imagine/imagine.
In https://github.com/sitegeist/Sitegeist.Kaleidoscope.Svg contao/imagine-svg is connected via an aspect. However since this clearly is a hacky solution the solution for the neos core should be somehow cleaner.
Challenges
The api for image adjustments is tightly coupled to the imagine interface which is not able to handle svg images. The interfaces have to be adjusted or another interface has to be added to handle the adjustments of svgs.