U4-10556 - Fix 0x0 svg

Created by Stephan 17 Oct 2017, 13:53:11 Updated by Justin Ruffell-Ward 08 Feb 2018, 16:48:39

Subtask of: U4-9609

Some SVG when uploaded as images show as 0x0 Example: https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/bozo.svg


Stephan 17 Oct 2017, 13:55:28

PR https://github.com/umbraco/Umbraco-CMS/pull/2251

review: upload the example SVG as a file into a newly created media of type Image (if you just drop the SVG it will create a media of type File) and ensure that the image cropper does display the image correctly

Sebastiaan Janssen 18 Oct 2017, 17:24:02

I like this simple change but unfortunately it is now pretty misleading. :)

Have a look at the following issue: http://issues.umbraco.org/issue/U4-6008

2 problems:

  1. If I add an imageFileTypes node to umbracoSettings.config then we'll be able to upload svgs directly and they will be created as a file of mediatype Image, which then leads to the error in U4-6008
  2. Worse, though, when I now add an actual crop (of name "test", width 100 and height 200) I can crop this svg beautifully in the media section.. but there's no way I'm getting that crop out using the GetCropUrl method. So it's misleading: you think you've made an awesome crop, go look at your page and the image just fills up the available space it has with the full image, uncropped.

Stephan 19 Oct 2017, 06:28:30

ah dang, the original PR that I reviewed is supposed to fix #1, so I could have another look at it, but then of course cropping an SVG does not make much sense. So maybe it's better SVG remains 'File' and not 'Image' as it cannot really be treated as a true image.

Now the main concern in U4-6008 seems to be thumbnails... but right now when I upload an SVG as a file, I ''do'' see it in the media picker, so maybe the thumbnails problem is actually not a problem anymore, in which case I'd happily close these 2 issues?

Justin Ruffell-Ward 08 Feb 2018, 16:48:39

This is still an issue. I'm on Umbraco 7.7.8 and I get an error uploading SVG files if svg is added to the Image file types like so: jpeg,jpg,gif,bmp,png,tiff,tif,svg. Without adding this config setting then SVG files can't be selected in the RTE editor or the grid so I can't currently use SVG images in these editors which is very frustrating. This issue was also reported some time ago here: http://issues.umbraco.org/issue/U4-6008 and here: http://issues.umbraco.org/issue/U4-9349

Priority: Normal

Type: Task

State: Reopened


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:

Sprint: Sprint 74

Story Points: 1