diff scripts/make_pngs.sh @ 154:acfcd3db4bca

Correct Lock color and size
author Stefano Rivera <stefano@rivera.za.net>
date Tue, 13 Sep 2011 22:37:41 +0200
parents a40c94b57602
children
line wrap: on
line diff
--- a/scripts/make_pngs.sh	Tue Sep 13 22:39:37 2011 +0200
+++ b/scripts/make_pngs.sh	Tue Sep 13 22:37:41 2011 +0200
@@ -8,13 +8,15 @@
 svgroot=source/svg
 pngroot=data
 
-for sourcepath in `find $svgroot -name "*.svg"`
+for sourcepath in `find "$svgroot" -name "*.svg"`
 do
-    sourcefile=`basename $sourcepath`
-    sourcedir=`dirname $sourcepath`
-    destdir=${sourcedir/#$svgroot/$pngroot}
-    mkdir -p $destdir
-    destpath=$destdir/${sourcefile/%svg/png}
-    rsvg-convert $sourcepath -w $tilesize -h $tilesize -o $destpath
-    pngcrush -q $destpath tmp && mv tmp $destpath
+    sourcefile="`basename $sourcepath`"
+    sourcedir="`dirname $sourcepath`"
+    destdir="${sourcedir/#$svgroot/$pngroot}"
+    mkdir -p "$destdir"
+    destpath="$destdir/${sourcefile/%svg/png}"
+    opts=""
+    echo "$sourcepath" | grep -Fq /tiles/ && opts="-w $tilesize -h $tilesize"
+    rsvg-convert "$sourcepath" $opts -o "$destpath"
+    pngcrush -q "$destpath" tmp && mv tmp "$destpath"
 done