Mercurial > mamba
comparison scripts/make_pngs.sh @ 151:a40c94b57602
renamed x; create png directory if doesn't exist
author | Adrianna Pińska <adrianna.pinska@gmail.com> |
---|---|
date | Tue, 13 Sep 2011 19:00:57 +0200 |
parents | 4eb3aed07065 |
children | acfcd3db4bca |
comparison
equal
deleted
inserted
replaced
150:4eb3aed07065 | 151:a40c94b57602 |
---|---|
6 tilesize=20 | 6 tilesize=20 |
7 | 7 |
8 svgroot=source/svg | 8 svgroot=source/svg |
9 pngroot=data | 9 pngroot=data |
10 | 10 |
11 for x in `find $svgroot -name "*.svg"` | 11 for sourcepath in `find $svgroot -name "*.svg"` |
12 do | 12 do |
13 sourcefile=`basename $x` | 13 sourcefile=`basename $sourcepath` |
14 sourcedir=`dirname $x` | 14 sourcedir=`dirname $sourcepath` |
15 destpath=${sourcedir/#$svgroot/$pngroot}/${sourcefile/%svg/png} | 15 destdir=${sourcedir/#$svgroot/$pngroot} |
16 rsvg-convert $x -w $tilesize -h $tilesize -o $destpath | 16 mkdir -p $destdir |
17 destpath=$destdir/${sourcefile/%svg/png} | |
18 rsvg-convert $sourcepath -w $tilesize -h $tilesize -o $destpath | |
17 pngcrush -q $destpath tmp && mv tmp $destpath | 19 pngcrush -q $destpath tmp && mv tmp $destpath |
18 done | 20 done |