#!/bin/bash # # batchresize # script by david buchmann, budda@budda.ch # call convert repeatedly to resize lots of files at a time # Warning: This script overwrites your existing files with the scaled ones! # # version: 0.1, 21.1.2004 # this program is provided as is. no warranty at all. # 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