| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| SVG=tpl |
| |
| |
| |
| IMG=img |
| |
| |
| WIDTHS="16 20 22 24 32 36 40 48 64 96 128 148 164 196 200" |
| |
| if [ "$1" ];then |
| WIDTHS="$1" |
| fi |
| |
| |
| if [ "$2" ]; then |
| CATEGORIES=`ls $SVG | egrep "$2"` |
| else |
| CATEGORIES=`ls $SVG` |
| fi |
| |
| for CATEGORY in $CATEGORIES; do |
| |
| for WIDTH in $WIDTHS; do |
| |
| |
| if [ ! -d $IMG/$WIDTH/$CATEGORY ];then |
| mkdir -p $IMG/$WIDTH/$CATEGORY |
| fi |
| |
| |
| if [ "$3" ]; then |
| TEMPLATES=`ls $SVG/$CATEGORY | egrep $3` |
| else |
| TEMPLATES=`ls $SVG/$CATEGORY` |
| fi |
| |
| for FILE in $TEMPLATES; do |
| |
| |
| TEMPLATE=$SVG/$CATEGORY/$FILE |
| |
| |
| IMAGE=$IMG/$WIDTH/$CATEGORY/`echo $FILE | sed -e "s!\.tpl!.png!"` |
| |
| |
| inkscape $TEMPLATE --export-width=$WIDTH --export-png=$IMAGE |
| done |
| done |
| done |