#!/bin/csh -f

set width = $1
shift
set file  = "$*"

foreach f ($file)
    echo $f
    djpeg $f | pnmscale -width $width | cjpeg > $f:r.small.jpg
end

exit 0
