Last modified: 2014-09-17 21:57:28 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 T36812, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34812 - Allow minification of SVG files
Allow minification of SVG files
Status: NEW
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.19
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 63491 (view as bug list)
Depends on: 59086
Blocks: 57777 34810
  Show dependency treegraph
 
Reported: 2012-02-29 20:24 UTC by Sam Reed (reedy)
Modified: 2014-09-17 21:57 UTC (History)
8 users (show)

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


Attachments

Description Sam Reed (reedy) 2012-02-29 20:24:54 UTC
This comes from bug 34810... Which could use this feature to dynamically do it (or the simpler older method of creating .min files)

SVG are used as non page content files, they contain a lot of whitespace. Minify and serve!
Comment 1 Brion Vibber 2012-02-29 23:14:25 UTC
There's several possible things to do here:

* transparent HTTP gzip compression (can be enabled at webserver-level)
* stripping comments and whitespace (traditional 'minification', could be done as a pre-processing step)
* intelligent collapsing of redundant attributes and styles (harder!)
* rounding coordinates to fewer digits
* decimating points in overly-detailed polygons/curves

Depending on just what you're trying to do, you could do some or all of those...

For SVG fonts I'd recommend that they be relatively sane to begin with (if they're full of whitespace and comments as output assets, that's kinda lame -- they should be small/clean to begin with), and use transparent gzip compression on the web server configuration.
Comment 2 Krinkle 2013-03-06 06:29:37 UTC
I think we can apply the same as PNG files.

I don't know of any SVG files we have in our repository that we manually edit to the level that can't aren't already be minified (they might have some indentation, but that's about it, and we could actually minify those in the repository, like we optimise PNG files).

I know SVG is text where PNG is not, but unless we actually edit them, it should be fine.

As for solving this bug, if we want to minify SVGs in separate requests (e.g. fonts), that would get quite tricky. They'd need a url to be served from.

As for SVGs we embed in CSS (SVGs for icons like we do in VisualEditor), those could be easily minified before being base64 encoded (that is, once we have an xml minifier).
Comment 3 Bartosz Dziewoński 2014-09-17 21:29:31 UTC
*** Bug 63491 has been marked as a duplicate of this bug. ***

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


Navigation
Links