Page MenuHomePhabricator

Create minified SVG output in thumbnail space to serve for <img>s
Open, LowPublic

Description

Source SVGs may contain extra white space and comments which are unnecessary data transfer for thumbnail usage. Consider minifying and serving those.

Event Timeline

brion created this task.May 5 2016, 2:26 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptMay 5 2016, 2:26 PM
brion renamed this task from Create minimized to Create minified SVG output in thumbnail space to serve for <img>s.May 5 2016, 2:28 PM
brion updated the task description. (Show Details)
Restricted Application added a project: Commons. · View Herald TranscriptMay 5 2016, 2:28 PM
Restricted Application added subscribers: Steinsplitter, Matanya. · View Herald Transcript
Danny_B added a subscriber: Danny_B.May 5 2016, 6:30 PM

Does that involve only text minification or also converting to .svgz?

Restricted Application added a subscriber: Poyekhali. · View Herald TranscriptMay 5 2016, 6:30 PM
brion added a comment.May 6 2016, 7:29 AM

It is probably simplest to let the web server / proxy layer deal with gzipping, unless handling of .svgz has gotten a lot more consistent than I remember.

Rillke added a subscriber: Rillke.EditedMay 10 2016, 10:00 AM

While doing this minification, it might be necessary remove languages different from the content language of the article the SVG is used in (i.e. the content language) from [[ https://commons.wikimedia.org/wiki/Help:Translation_tutorial#Using_the_same_file | SVGs containing translations in <switch> elements ]]. Otherwise the browser might decide about which language is best suited resulting in undesired behaviour for visitors of e.g. public libraries? [Not extensively tested yet ... but the lang attribute on the HTML element appears to be ignored in Firefox]

TheDJ added a subscriber: TheDJ.Jun 26 2016, 9:42 AM

minification engine for SVG: https://github.com/svg/svgo

TheDJ added a comment.Jun 26 2016, 9:55 AM

Also SVGCompress which includes complexity reduction using Ramer–Douglas–Peucker algorithm

MarkTraceur triaged this task as Low priority.Dec 2 2016, 11:10 PM
MarkTraceur moved this task from Untriaged to Tracking on the Multimedia board.
Tgr added a subscriber: Tgr.Dec 5 2016, 7:19 PM

See also T36812: Implement minification for SVG files in ResourceLoader, and gerrit 106506 for the various problems which came up when using svgo for T61744.