1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-05 13:29:20 +02:00
openwrt-packages/supertux/files/img-resize.sh

29 lines
409 B
Bash
Raw Normal View History

#!/bin/sh
conv() {
if [ ! -d org ]; then
mkdir org
mv *.jpg *.png org/
fi
for i in org/*; do
b=`basename $i`
ext=`expr "x$b" : 'x.*\.\(.*\)'`
if [ "$ext" = "png" ]; then
if [ $b = "tux-life.png" ]; then
cp $i _.png
else
convert $i -resize 50% _.png
fi
pngcrush -q _.png $b
elif [ "$ext" = "jpg" ]; then
convert $i -resize 50% -quality 60 $b
fi
done
rm _.png
}
conv