When you subsequently want to use a MediaPicker to select that image in one of your content items, you cannot select the SVG, because only Images are allowed, not Files.
It's perfectly possible to click Create > Image, then drop the SVG on the Upload image pane, but as a developer, I pride myself on my laziness. I will not upload 28 images one by one, if I can solve this once and for all.
"Hidden" setting
The list of file extensions that is recognized as an Image (everything else is a File) is defined in settings/content/imaging/imageFileTypes.For some reason, however, this setting is not present in config/umbracoSettings.config by default.
When not present, the code falls back to jpeg, jpg, gif, bmp, png, tiff, tif. We just want to add svg to the list.
So, all you need to do, is go to config/umbracoSettings.config and add the following :
<?xml version="1.0" encoding="utf-8" ?>
<settings>
<content>
<imaging>
<!-- what file extension that should cause umbraco to create thumbnails -->
<imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif,svg</imageFileTypes>
</imaging>
......
</content>
</settings>
Now, when you drop one or more SVG's on a folder, it will be recognized as an Image.
Awesome, thanks.
ReplyDeleteLife saver!
ReplyDelete