nsbin/bilder_groesse_anpassen

14 lines
304 B
Text
Raw Normal View History

2006-07-20 07:54:37 +00:00
#!/bin/sh
if [ $# -gt 2 -o $# -lt 1 ]; then echo "Usage: size onefile";exit 1;fi
LIMIT=100
width=`file $1 | awk ' { print $5 } ' | sed 's/,$//'`
height=`file $1 | awk ' { print $7 } ' | sed 's/,$//'`
while [ $height -gt $LIMIT ]; do
height=$[$height/2]
width=$[$width/2]
done
echo $height $width