Last modified: 2014-09-17 21:29:47 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 T61744, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59744 - Consider safely optimizing embedded SVG icons in MediaWiki core
Consider safely optimizing embedded SVG icons in MediaWiki core
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.23.0
All All
: Normal enhancement (vote)
: 1.23.0 release
Assigned To: Bartosz Dziewoński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-07 00:07 UTC by MZMcBride
Modified: 2014-09-17 21:29 UTC (History)
7 users (show)

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


Attachments

Description MZMcBride 2014-01-07 00:07:02 UTC
We may want to consider safely optimizing embedded SVG icons.

https://gerrit.wikimedia.org/r/96372
https://gerrit.wikimedia.org/r/103894

Full background is available at bug 59234.


(Copied from bug 59234 comment 27)

This seems to have been fixed in file 5.04; however, PHP uses a bundled,
patched copy of the library that was only updated from 5.03 to 5.11 in
12cf930a403d.

Running "git tag --contains 12cf930a403d" in php-src tells me that
affected versions of PHP were 5.3.10 and older, as well as 5.4.0.
Wikimedia runs 5.3.10 in production.

Here's a snippet of the diff:

--- file-5.03/magic/Magdir/sgml    2008-07-26 11:03:55.000000000 -0400
+++ file-5.04/magic/Magdir/sgml    2009-09-19 13:31:35.000000000 -0400
@@ -1,36 +1,59 @@

#------------------------------------------------------------------------------
+# $File: sgml,v 1.24 2009/09/19 17:31:35 christos Exp $
 # Type:    SVG Vectorial Graphics
 # From:    Noel Torres <tecnico@ejerciciosresueltos.com>
 0    string        \<?xml\ version="
 >15    string        >\0
->>23    search/400    \<svg            SVG Scalable Vector Graphics image
+>>19    search/4096    \<svg            SVG Scalable Vector Graphics image
 !:mime    image/svg+xml

Note that the start offset of the search for "<svg" was dropped from 23 to 19,
and the newer, shorter XML declaration was the following 22-character string:

<?xml version="1.0" ?>

So this problem could have been avoided by either adding a DOCTYPE or leaving
one more whitespace character in the right place.
Comment 1 Gerrit Notification Bot 2014-01-09 12:24:10 UTC
Change 106506 had a related patch set uploaded by Bartosz Dziewoński:
Optimize all SVGs (attempt 2)

https://gerrit.wikimedia.org/r/106506
Comment 2 Gerrit Notification Bot 2014-02-08 12:57:17 UTC
Change 111982 had a related patch set uploaded by Bartosz Dziewoński:
Drop dead code from all SVG source files

https://gerrit.wikimedia.org/r/111982
Comment 3 Gerrit Notification Bot 2014-02-08 13:04:16 UTC
Change 111982 merged by jenkins-bot:
Drop dead code from all SVG source files

https://gerrit.wikimedia.org/r/111982
Comment 4 Bartosz Dziewoński 2014-02-08 13:05:55 UTC
(That patch was actually done by Thiemo Mättig, I just linked it to this bug. My own more aggressive optimisation patch submitted earlier needs some more work.)
Comment 5 Gerrit Notification Bot 2014-02-08 13:41:16 UTC
Change 112234 had a related patch set uploaded by Bartosz Dziewoński:
Vector: Simplify text paths in tiny icons

https://gerrit.wikimedia.org/r/112234
Comment 6 Gerrit Notification Bot 2014-02-17 04:01:18 UTC
Change 112234 merged by jenkins-bot:
Vector: Simplify text paths in tiny icons

https://gerrit.wikimedia.org/r/112234
Comment 7 Gerrit Notification Bot 2014-04-06 02:43:42 UTC
Change 106506 merged by jenkins-bot:
Optimize all SVGs

https://gerrit.wikimedia.org/r/106506
Comment 8 Bartosz Dziewoński 2014-04-06 11:02:50 UTC
Okay, the SVG files in core should be all fixed up.

Bug 63491 tracks magically optimizing them on-the-fly in ResourceLoader.

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


Navigation
Links