Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I would like to know what's the best way to handle svg files in Umbraco. It seems that when you try to upload svg as an Image Media Type you'll get an error: http://issues.umbraco.org/issue/U4-6008.
You could handle svg as the File media type, but than you don't get a thumbnail preview. I prefer to have svg as the Image Media Type because it's for a project which is already quite far and we're using the Image Media Type everywhere.
I can upload svgs to the media library and access the file in my document type via a media picker; however, this is not what you want as this a File Media Type, not an Image Media Type as you are already facing.
I'd be interested in following up on this if you do find anything out though?
James South might have some input based on his work with the ImageProcessor possibly?
Sorry I couldn't be more help at this time.
For future reference, I was able to add SVG to the Media Library by manually creating an SVG media type with the following properties exposed:
In my web.config I've verified the svg mime type is present:
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
This was based on the forum post: Selecting an SVG
Looks like the image cropper does support SVGs so you could replace your umbracoFile alias on the image media type with a cropper. That will give you thumbnails in the backoffice. Is this what you are trying to accomplish?
I dont see it working when adding to document type. What you see is a small broken image with blue dot inside.
and image is not showing. i am styling my svg through css so its no go to use img tag.
any other good ideas?
Bump on this.
In my case we want to use Image Cropper everywhere instead of the media picker.
But when i upload the SVG image, initially it shows in preview, and it saves without errors.
However if i reload the node, the preview is gone and no data has been saved to my Image Cropper property.
If you want thumbnail in Media section for SVG file, just add below code in umbracoSettings.config > Content tag:
<!-- what file extension that should cause umbraco to create thumbnails -->
My case was that i am unable to choose the svg file in content and your answer solved the issue, Many Thanks.
Not sure if this is still relevant, but I managed to enable this recently in an Umbraco 7.6.1 project by removing the SVG from umbracoSettings.config line
Hope it helps.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted