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)

x86_64
Linux
defect
Not set
normal

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
Component: Gaia::Settings → Gaia::System
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 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: nobody → gmarty
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-
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 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 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+
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 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 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+
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.

Attachment

General

Created:
Updated:
Size: