Mercurial > mamba
changeset 150:4eb3aed07065
nicer make_pngs
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Tue, 13 Sep 2011 18:58:01 +0200 |
parents | e26280d809d3 |
children | a40c94b57602 |
files | scripts/make_pngs.sh |
diffstat | 1 files changed, 9 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/make_pngs.sh Tue Sep 13 18:47:38 2011 +0200 +++ b/scripts/make_pngs.sh Tue Sep 13 18:58:01 2011 +0200 @@ -4,16 +4,15 @@ set -u tilesize=20 -svgdir=source/svg -pngdir=data -for subdir in tiles/common tiles/common/snake tiles/lab menus +svgroot=source/svg +pngroot=data + +for x in `find $svgroot -name "*.svg"` do - for x in $svgdir/$subdir/*.svg - do - filename=`basename $x` - filepath=$pngdir/$subdir/${filename/svg/png} - rsvg-convert $x -w $tilesize -h $tilesize -o $filepath - pngcrush -q $filepath tmp && mv tmp $filepath - done + sourcefile=`basename $x` + sourcedir=`dirname $x` + destpath=${sourcedir/#$svgroot/$pngroot}/${sourcefile/%svg/png} + rsvg-convert $x -w $tilesize -h $tilesize -o $destpath + pngcrush -q $destpath tmp && mv tmp $destpath done