#!/bin/sh
# this example shows how to use xjobs for resizing all .jpg pictures in
# a directory hierarchy using ImageMagic's convert tool

DIR=$1
SIZE=$2

if [ "$DIR" = "" ]; then
	DIR=.
fi

if [ "$SIZE" = "" ]; then
	SIZE=50%
fi

find $DIR -name '*.jpg' | sed "s/\(.*\)\.jpg/\1.jpg \1_$SIZE.jpg/" | xjobs convert -resize $SIZE
