|
2011-11-23
, 15:25
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#2
|
find / -name *.png | xargs optipng -some -magic -flags
The Following User Says Thank You to vi_ For This Useful Post: | ||
|
2011-11-23
, 15:50
|
|
Posts: 412 |
Thanked: 480 times |
Joined on Feb 2011
@ Bronx, NY
|
#3
|
|
2011-11-23
, 16:35
|
|
Posts: 762 |
Thanked: 395 times |
Joined on Jan 2010
@ Helsinki
|
#4
|
|
2011-11-23
, 16:41
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#5
|
|
2011-11-23
, 16:44
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#6
|
find . -iname .png -print0 | xargs -0 optipng -o7 -simulate
The Following User Says Thank You to vi_ For This Useful Post: | ||
|
2011-11-23
, 16:56
|
|
Posts: 412 |
Thanked: 480 times |
Joined on Feb 2011
@ Bronx, NY
|
#7
|
|
2011-11-23
, 17:05
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#8
|
find /opt -type f -iname "*.png" -exec ls -l {} \; | awk '{s+=$5}END{print "total: "s" bytes"}'
The Following User Says Thank You to vi_ For This Useful Post: | ||
|
2011-11-23
, 20:44
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#9
|
find ./opt -type f -iname "*.png" -exec ls -l {} \; | awk '{s+=$5}END{print "total: "s" bytes"}'
find . -iname "*.png" -print0 | xargs -0 optipng -force -preserve -o7
|
2011-11-23
, 20:55
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#10
|
To be fair the majority of my PNGs are map tiles and these cannot be optimised.
Well, being an intermediate-level N900 user, the idea of doing something similar to the .png files in /opt/usr/share/icons/hicolor arrived in my head. I'm not really expecting anything, though, and I'm not one of those zany hardcore Maemo modders.
I haven't found a good deal of information searching this forum for how Maemo treats .png files it uses - does it load them off the flash when needed? Keep them unpacked or packed in memory after boot? Would dropping the .png file sizes be useful in anything at all?
Since Maemo stores them in /opt/ they are optified by design and wouldn't give you a rootfs space increase (that some crave), but I'm wondering about other advantages. Personally, I imagine this is something the designers would've thought of, though!
Off I went and copied all the .png files from my N900's /opt/usr/share/icons/hicolor on my desktop PC and started running batches of pngout operations to see if the contents therein drop in size. They did, somewhat.
4 323 074 bytes -> 3 751 309 bytes
So, that's ONE desperate way for you to get some space shaved off your two gigs of opt! Still, I'd be interested to hear about how Maemo loads and stores those .png files.
Potential caveats: Whether replacing the files in the phone's directory might mess up some programs that take md5 hashes to determine potential need to update the image files. Pushing the crunched .png files in the ~/.local/ override would avoid that problem, but others might emerge: if a developer changes the program's icons, the ~/.local/ override would keep using the old, crunched versions.