Closed
Bug 1133402
Opened 10 years ago
Closed 10 years ago
Add a script to optimise SVG images
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gmarty, Assigned: gmarty)
Details
Attachments
(2 files)
We compress PNG images, but not SVG.
Though not many apps use SVG files (notable exceptions are the privacy controls and the clock), we need a way to ship lighter assets with no visual difference.
Using svgo[1], we can save 15% on privacy controls images and 30% on the clock ones.
[1] https://github.com/svg/svgo
| Assignee | ||
Updated•10 years ago
|
Component: Gaia::Settings → Gaia::System
Comment 1•10 years ago
|
||
| Assignee | ||
Comment 2•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
This patch contains a tool to optimise SVG images and SVG files optimised using this script.
Hopefully we're going to use it more and more as SVG images become more frequent in Gaia.
Kevin, what do you think of that?
Attachment #8564859 -
Flags: review?(kgrandon)
Comment 3•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
I think this does make sense to me. I did think that we were moving away from SVG though as I thought it caused performance problems, though maybe that's been resolved? I also wonder if this should be part of some build step in case we ever want to keep the "source" of the svg files intact.
In any case, I think the tool looks fine, but I would like to check with mcav to make sure he is fine with the clock svg updates, and I also think Gabriele should review the tool - as he did quite a bit of work for the png compression tool. Thanks for the work here!
Attachment #8564859 -
Flags: review?(m)
Attachment #8564859 -
Flags: review?(kgrandon)
Attachment #8564859 -
Flags: review?(gsvelto)
Attachment #8564859 -
Flags: feedback+
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → gmarty
Comment 4•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
This is generally good but there's an issue that prevents specifying multiple paths from working correctly which is why I'm -'ing it. Also it would probably make sense to split this in two patches, one that adds the script and another that re-compresses the SVG assets.
Attachment #8564859 -
Flags: review?(gsvelto) → review-
Comment 5•10 years ago
|
||
On this topic, we should probably add something similar to this for JPEG optimization. We now have JPEG assets so it's worth doing that. I'll open another bug and possibly another one to add a build target which would recompress our assets irrespective of type and place.
Comment 6•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
r=mcav for the clock compression; deferring the implementation details.
Attachment #8564859 -
Flags: review?(m) → review+
Comment 7•10 years ago
|
||
| Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
As Gabriele suggested, I broke this patch into 2. This one is for optimising the SVG images.
Already got r+ from Marcus, asking r+ for the Privacy controls images now.
Attachment #8564859 -
Flags: review?(kgrandon)
Attachment #8564859 -
Flags: review-
Attachment #8564859 -
Flags: review+
| Assignee | ||
Comment 9•10 years ago
|
||
Comment on attachment 8566356 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images-tool > mozilla-b2g:master
This bit is for the bash script. Thanks to Gabriele's feedback it now accepts several path. How does it look now?
Regarding the JPG compression, we have mainly wallpapers. We should probably use mozjpeg[1], but I'm not sure if we have builds for that.
[1] https://github.com/mozilla/mozjpeg
Attachment #8566356 -
Flags: review?(gsvelto)
Comment 10•10 years ago
|
||
Comment on attachment 8566356 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images-tool > mozilla-b2g:master
Looks good to me!
Attachment #8566356 -
Flags: review?(gsvelto) → review+
Comment 11•10 years ago
|
||
Comment on attachment 8564859 [details] [review]
[gaia] gmarty:Bug-1133402-Add-a-script-to-optimise-SVG-images > mozilla-b2g:master
Seems fine to me, thanks for taking this on!
Attachment #8564859 -
Flags: review?(kgrandon) → review+
| Assignee | ||
Comment 12•10 years ago
|
||
Thanks to all reviewers. The patches landed respectively in master in:
https://github.com/mozilla-b2g/gaia/commit/931b1bebdc53880f3a53407257e209781907c3a1
https://github.com/mozilla-b2g/gaia/commit/e6f7ad2ed32f882d9db41a9066ac6ff6af39960f
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•