Last modified: 2014-05-29 19:48:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40010, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38010 - Re-evaluate librsvg as SVG renderer on Wikimedia wikis
Re-evaluate librsvg as SVG renderer on Wikimedia wikis
Status: NEW
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 54030 ubuntu-trusty
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 22:00 UTC by MZMcBride
Modified: 2014-05-29 19:48 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description MZMcBride 2012-06-27 22:00:22 UTC
I don't know the exact history, but at some point Wikimedia wikis added the ability to support inline SVGs by passing them through librsvg, which takes the SVG code and generates PNGs, as I vaguely understand it.

There are some notes here: <https://meta.wikimedia.org/wiki/SVG_image_support>.

I can't find any information about which version of librsvg Wikimedia is currently using, but the choice of using librsvg should be re-evaluated, given its rendering issues (cf. other bugs in this bug tracker) and the existence of perhaps better alternatives.
Comment 1 Amgine 2012-06-27 22:19:13 UTC
As pointed out at http://www.mediawiki.org/wiki/Manual:Image_Administration#SVG there are multiple methods of rendering svg. 

The justification for rsvg at times in the past was primarily speed, with other renderers being found more accurate, stable. This has been extensively looked at in the past, but *perhaps* it is time to review the options, especially considering some of the sources used date from 2008. (Currently I use Inkscape due to inkscape-specific extensions to svg.)
Comment 2 Sam Reed (reedy) 2012-06-27 22:56:32 UTC
reedy@fenari:~$ rsvg --version
rsvg version 2.26.3 (Wikimedia)


There are a couple of svg/rsvg related bugs tagged against bug 36623
Comment 3 Jarry1250 2012-07-26 09:04:29 UTC
One also needs to consider the number of files that have rsvg hacks in them, or at the very least only look pixel perfect in rsvg.

Having tried a few of these, I think Inkscape is probably the only viable alternative, but it would need performance testing.
Comment 4 Derk-Jan Hartman 2012-07-29 23:13:54 UTC
https://mail.gnome.org/archives/gnome-announce-list/2010-May/msg00000.html

> Date: Sat, 01 May 2010 21:17:19 +0900
> librsvg-2.26.3 is available now.

Perhaps we should try upgrading ? I know we filed a lot of bugs upstream at rsvg in 2010, but if we don't upgrade, we won't get the fixes of course.
Comment 5 Sam Reed (reedy) 2012-07-29 23:32:59 UTC
Lucid (Ubuntu 10.04) is on 2.26.3

Precise (Ubuntu 12.04) is 2.36.1

Waiting on the upgrades to 12.04 (bug 36623) is probably worthwhile, and we can rebuild our rsvg against that version, or just use that as stock.

Changelog:
https://svn.wikimedia.org/viewvc/mediawiki/trunk/debs/librsvg/debian/changelog?view=markup

Patch:
https://svn.wikimedia.org/viewvc/mediawiki/trunk/debs/librsvg/debian/patches/wikimedia-brand.patch?revision=109758&view=markup

^ will need applying if we've changes like below (simple)

https://svn.wikimedia.org/viewvc/mediawiki/trunk/debs/librsvg/debian/patches/no-external-files.patch?view=markup&pathrev=109758

^ Doesn't seem like it was upstreamed, so would need re-applying against a newer version. It also (unsurprisingly?) doesn't apply cleanly to 2.36.1 from their git repo
Comment 6 Isarra 2012-08-18 20:59:10 UTC
Upgrading librsvg won't fix it, at least not yet.

librsvg 2.36.1-1 still seems to have most of the relevant rendering bugs we run into on these projects; at very least it's been what I've been using for debugging messed up ones and to test if svgs will render properly before uploading them and it hasn't been wrong yet. 

The problems rsvg picks up, however, are often with the svgs themselves - strange node positioning, weird objects, and things like that which can be enough to confuse it. But while these issues are fairly easily fixed in the files, rendering problems stemming from just how much librsvg rounds things down cannot; anything using blurs or precise positioning is apt to render poorly, especially at lower resolutions, because the relevant information can wind up either truncated or chucked entirely. See https://commons.wikimedia.org/wiki/File:MediaWiki_logo_1.svg for an example.

Inkscape, on the other hand, while usually quite lovely, sometimes gets confused and puts random holes in things, though this can be also worked around by breaking apart affected objects.
Comment 7 Faidon Liambotis 2012-10-27 10:26:25 UTC
For what it's worth, we upgraded image scalers to precise last week, so we run 2.36.1 now.
Comment 8 Andre Klapper 2013-07-18 08:53:30 UTC
What are the exact criteria to evaluate against, in order to get this ticket fixed? Currently this sounds unfixable due to vagueness.
Comment 9 Amgine 2013-07-19 19:05:22 UTC
Available options are ImageMagick, ImagickExt, sodipodi, inkscape, batik, rsvg, and imgserv.

My understanding is: rsvg was the worst image quality, most difficult to install/maintain, but the best performance, and for this reason was selected and is currently used by WMF.

So, the criteria would be: what is the ordered priorities to use in judging svg conversion (presumably 1. conversion performance, 2. maintenance cost, and 3. image quality); what are the ranked performances of the available options; if, after summing the performances of each option (weighted by ordered priority), rsvg is no longer the best choice, does WMF migrate to the better solution?
Comment 10 Quim Gil 2013-07-20 11:50:15 UTC
fwiw http://www.mediawiki.org/wiki/SVG_benchmarks
Comment 11 Brion Vibber 2013-09-11 21:37:24 UTC
Note bug 54030 -- we could put together a local daemon that runs PhantomJS and have it render SVGs with WebKit. :P
Comment 12 C. Scott Ananian 2014-05-29 19:48:39 UTC
Security is also a consideration.  The solution must be able to be sandboxed and have its http fetch neutered.  rsvg is designed for embedded solutions and has good controls for this.  It would be much harder to sanitize/sandbox some of the other solutions.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links