From: <hb...@us...> - 2009-08-31 11:18:02
|
Revision: 2483 http://gpsdrive.svn.sourceforge.net/gpsdrive/?rev=2483&view=rev Author: hbowman Date: 2009-08-31 11:17:55 +0000 (Mon, 31 Aug 2009) Log Message: ----------- cosmetics Modified Paths: -------------- trunk/scripts/gpstile_crush.sh Modified: trunk/scripts/gpstile_crush.sh =================================================================== --- trunk/scripts/gpstile_crush.sh 2009-08-31 11:04:40 UTC (rev 2482) +++ trunk/scripts/gpstile_crush.sh 2009-08-31 11:17:55 UTC (rev 2483) @@ -81,17 +81,27 @@ continue fi echo "Processing $OSMER ..." - echo "Before: `du -sh $OSMER`" + echo " Before: `du -sh $OSMER`" cd "$OSMER" + + TOTALTILES=`find . | grep '\.png$' | wc -l` + i=0 for MAP in `find . | grep '\.png$'` ; do + i=`expr $i + 1` if [ -e "$MAP.crushed" ] ; then continue fi - echo "Crushing [$MAP] ..." + echo "Crushing --|$MAP|-- ($i/$TOTALTILES) ..." + pngcrush -brute -reduce -c 2 -q "$MAP" "$MAP.crush" + if [ $? -eq 0 ] && [ -s "$MAP.crush" ] ; then + BEFORE=`wc --bytes < "$MAP"` + AFTER=`wc --bytes < "$MAP.crush"` \mv "$MAP.crush" "$MAP" touch "$MAP.crushed" # so we don't repeat + echo "$BEFORE $AFTER" | \ + awk '{printf(" reduced %.1f%%\n", ($1-$2)*100.0/$1)}' # for JPEG we'll need to update map_koord.txt too else echo "Error crushing [$MAP]." @@ -99,11 +109,11 @@ fi done cd .. - echo "After: `du -sh $OSMER`" + echo " After: `du -sh $OSMER`" done -if [ $TODO_flag = "-c" ] ; then +if [ "$TODO_flag" = "-c" ] ; then for OSMER in $PROCDIRS ; do if [ ! -d "$OSMER" ] ; then continue This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |