nsbin/bilder_groesse_anpassen
Nico Schottelius d3c6e29902 Initial commit
2006-07-20 09:54:37 +02:00

13 lines
304 B
Bash
Executable file

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