Very bloated SVG in notification icons

Bug #361667 reported by Krzysztof Kosinski
8
Affects Status Importance Assigned to Milestone
human-icon-theme (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: human-icon-theme

Icons like notification-network-wireless-high in the Human theme are very large (100 KB). The problem stems from the fact that Adobe Illustrator injects a definition of its Polka Dot pattern into the file, but it's not used anywhere, and moreover it's not inside <svg:defs>, which means it is not valid SVG at all. This can be fixed by opening the file in Inkscape and deleting the offending <svg:pattern> element in the XML editor. The size of most icons drops by c.a. 90% as a result of this.

Revision history for this message
Erik Dahlström (ed-opera) wrote :

Note that It's perfectly valid to have <pattern> outside of <defs>, see the svg spec(s).

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

Yes, I checked the specification more thoroughly and it doesn't prohibit doing this. Still, the icons could be much smaller if the unused pattern definition was removed.

Revision history for this message
codedread (codedread) wrote :

Do you have a link to one of these icons? I have been working on a project that cleans up SVG files: http://launchpad.net/scour and I'd be curious to see if I handle this scenario yet.

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

This patch reduces the size of scalable icons when unpacked by c.a. 6 MB

Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

codedread:
bzr co -r 90 http://bazaar.launchpad.net/%7Eubuntu-art-pkg/human-icon-theme/ubuntu/ human-icon-theme-bzr

Example icon with this problem: scalable/status/notification-audio-next.svg

By the way, the patch is against current BZR (revision 90)

codedread (codedread)
summary: - Very bloated and invalid SVG in notification icons
+ Very bloated SVG in notification icons
Revision history for this message
codedread (codedread) wrote :

Ok, I've updated scour to remove unreferenced patterns and gradients outside of a <defs> element. Please give it a try on your icons and let me know the results. For notification-audio-next.svg I get a visually identical file with:

Original file size: 102987 kb; new file size: 3624 kb (0.035x)

You can download scour at http://codedread.com/scour/ or from the bzr trunk on lp

Revision history for this message
codedread (codedread) wrote :

FYI, latest trunk version of scour (0.11) now produces:

 File: fulltests/notification-audio-next.svg
 Time taken: 0.3s
 Number of unreferenced id attributes removed: 0
 Number of elements removed: 4
 Number of attributes removed: 6
 Number of style properties fixed: 0
 Number of raster images embedded inline: 0
 Number of path segments reduced/removed: 23
 Number of bytes saved in path data: 430
 Original file size: 102987 bytes; new file size: 3424 bytes (0.033x)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers