2008年10月6日 星期一

Batch image resize script on Ubuntu

- be able to specify resolution of image
- create a folder to put resized images in


#!/bin/bash

printf "Batch Image Resize..\n"
read -p "width: " width
read -p "height:" height

[ -d resize/ ] || mkdir resize

ls -1 *.[jJ][pP][gG] | while read file
do
convert -scale ${width}x${height} "$file" resize/"$file"
[ -f "$file" ] && printf "$file\tOK\n"
done

沒有留言: