Batchresize.sh

Created Mittwoch 29 Juli 2009

#!/bin/sh
if [ "$1" != "" ] ; then
size=$1 ; shift
for i in $*
do
convert -resize $size $i $i
done

#exit with success
exit 0
fi

echo "Usage: batchresize WidthxHeight files"
echo "Example: batchconvert 800x600 *.jpg"
echo "Use any format string you can pass to convert as -resize parameter (see man convert)"
echo "Tip: if some of your files are more wide than high and some the contrary, you can pass 800x800 to get them all the same size"
echo ""
echo "Warning: This script will overwrite your existing files with the scaled files!"
exit 1