Page MenuHomePhabricator

SVG attachments are not displayed
Open, LowestPublic


Reported upstream:

In T1005#17606 the 2 attached svg files are not (easily/at all?) accessible in my browser. The only way I can find to view those files, is to download them first.

(possibly related to ? I do understand that svg is more complicated than png/gif/jpg... :/ )

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity added a project: Phabricator.
Quiddity changed Security from none to None.
Quiddity subscribed.
Qgil subscribed.

<qgil> SVGs not rendering in Phabricator, this is a surprise. Is there a task already reported?
<epriestley> qgil: add the applicable MIME types to files.image-mime-types
<epriestley> We can probably bring that upstream if you want to figure out what they are and confirm they work.

Qgil triaged this task as Medium priority.Oct 31 2014, 11:10 PM

Normal priority only because we have so much in our plate right now. I agree this is important.

If someone wants to investigate and try out a solution in phab-01...

<epriestley> We also probably can't thumbnail them because GD doesn't support that.
<epriestley> I'm not sure how to thumbnail an SVG, there may be some easy approach.
<epriestley> Or some easy-but-inconvenient approach, like "use width/height on the same file".

I added image/svg to but SVGs are still not rendered.

How does MediaWiki render SVG + thumbnails? Being Phabricator and MediaWiki PHP, is there a possibility to share some code or method?

MediaWiki thumbnails SVGs using these external applications The default ImageMagick version seems to be what is used on the WMF production cluster today.

We also have a lot of code in UploadBase that scans svg content when it is submitted to exclude some of the nastier things that are possible to embed in an svg image.

Some progress at

The upstream instance now renders full size SVGs in the files pages. Thumbnailing is still missing. Example:

This means that we have saved some clicks to users but there is still some work to do. Not bad for a few hours in a Halloween's Friday night. :)

Thank you @bd808, I have posted your comments upstream.

Qgil lowered the priority of this task from Medium to Low.Nov 7 2014, 10:49 AM

@Qgil Same issue still around at file upload view pages on SVGs. See for example: cc: @Nirzar

Aklapper lowered the priority of this task from Low to Lowest.Sep 23 2016, 4:38 PM
Aklapper moved this task from Backlog to Reported Upstream on the Upstream board.

Unlikely to happen in upstream.
See security concerns in