1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-16 23:21:53 +02:00
openwrt-packages/supertux/files/img-resize.sh
kyak 8be517484d supertux: initial port
Credits go to OE recipy!
2011-02-13 22:08:08 +03:00

29 lines
409 B
Bash

#!/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