Page MenuHomePhabricator

SVG attachments are not displayed
Open, LowestPublic

Description

Reported upstream: https://secure.phabricator.com/T6445

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 https://secure.phabricator.com/T4412 ? 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? https://secure.phabricator.com/M1410
<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 https://phab-01.wmflabs.org/config/group/files/ 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 https://github.com/wikimedia/mediawiki/blob/master/includes/DefaultSettings.php#L934-L957. 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 https://secure.phabricator.com/T6445

The upstream instance now renders full size SVGs in the files pages. Thumbnailing is still missing. Example: https://secure.phabricator.com/M1410

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: https://phabricator.wikimedia.org/F3633565 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 https://secure.phabricator.com/T6445#157697

RHo subscribed.

Removing design tags as this sounds like a security concerns issue not showing svgs in Phabricator.