vanilla/generate-pngs.sh
Christopher Eby 1eac934283 Document generate-pngs.sh, remove generate-authors.sh
The author list is easy enough to create with git shortlog -s -n
2012-02-19 06:10:24 -06:00

24 lines
647 B
Bash
Executable File

#!/bin/sh
# This script can be used to generate PNGs from the SVGs stored in orig/.
# For each SVG in orig/, PNGs will be created in the drawable directories
# for each DPI with the same name as the SVG. If the PNGs already exist
# and are newer than the SVG, they will not be recreated.
gen() {
name=`basename "$1" .svgz`
png="res/drawable-$2/$name.png"
if [ "$1" -nt "$png" -o ! -e "$png" ]; then
inkscape --without-gui --export-area-page --export-dpi=$3 --export-png="$png" $1
convert -strip "$png" "$png"
optipng -quiet -o7 "$png"
echo
fi
}
for i in orig/*.svgz; do
gen "$i" mdpi 90
gen "$i" hdpi 135
gen "$i" xhdpi 180
done