Saturday, November 15, 2008

Convert pictures to 640x480 with bash

Just put this into your /usr/local/bin

sudo touch /usr/local/bin/cv640.sh
gedit /usr/local/bin/cv640.sh

#!/bin/bash

for img in `ls *.jpg`
#the img r-$img makes the filename have a r- at the front of the name
do convert -resize 640x480 $img r-$img
# do convert -sample 50%x50% $img resized-$img
#converts your file from whatever it is to 640x480
done

echo done converting
cv640.sh (END)

No comments: