When using the ImageSelector input, I would love to be able to upload SVGs as well. This is currently not supported, and I’m assuming it’s because you’re support all these scaling, filtering and focal point operations on “regular” images, which are pixel based.
Either way, I would love some way to insert SVGs into my pages without creating a custom part or field for just that use. Do you think there’s a way you could implement support for this?
You could create a contentselector and filter that to only list images and the types that are svg files. Then in controller: scale if image (raster) but output as binary if svg. Something like that.
We will introduce better support in the near future ofc. @tsi knows more, perhaps also @tlo that is our inhouse svg master =)
I agree that a common input for raster and vector images would be nice. We should discuss this in the next feature request review.
Note that on the Enonic Market site we use the “AttachmentUploader” input for icon images (since this will be uploaded by a form on Market in the future), and this input works with both vector images and raster images (and of course any other file type).
Create a new media type “SVG” and migrate existing svg files to it
Change the image selector so it is configurable (raster images only, svg only or both)
Raster only would have to be default in order not to break anything - developers would have to handle fields where both types of images are inserted.
Limited SVG support was introduced in 6.7. It works to insert svgs into the htmlarea, but there are still some issues. Like cropping effect not working and more. We will polish this further.