Cut and paste below here
#!/bin/bash
############################################################################################
#
# resizedirectoryfoririver.sh - Resize a directory of images to fit iRiver H3xx series displays
#
# Written by Ben Williams September 24th 2004
# Web: http://sabaisabai.org/iRiver/
# Email: webben@saabaisaabai.org
#
# NOTE:
#
# 1. This script requires the resizefoririver.sh script!
#
# 2. By default this will backup the original image as imagename.jpg.original.
# Override this with the '-nobackup' parameter, or permanently change the backup/nobackup
# lines in the resizefoririver.sh script file
#
# 3. By default this script only operates in the current directory. Alter images in any
# subdirectories by supplying the '-r' parameter
#
############################################################################################
USAGE="Usage: resizedirectoryfoririver.sh [-r] [-nobackup] [-upright] [-showonly] [--help]"
if [ "${1}" = "--help" ]
then
echo Script for resizing a directory of images to fit iRiver H3xx series displays
echo
echo ${USAGE}
echo " r : recurse through subdirectories"
#echo " backup : keep a copy of the original image as imagename.jpg.original"
echo " nobackup : replace original image with resized image"
echo " upright : keep vertical images upright"
echo " showonly : show the names of files to be resized without performing any action"
echo " --help : show this message"
exit 0
fi
for param in $*
do
if [ "${param}" = "-r" ]
then
recurse="y"
fi
done
if [ "${recurse}" = "y" ]
then
for filename in `find -iname "*\.jpg"`
do
resizefoririver.sh $* ${filename}
done
else
for filename in `ls | grep -i ".jpg"`
do
resizefoririver.sh $* ${filename}
done
fi