#!/bin/sh -x
for i in img*.jpg; do
  j=$(echo $i | sed -e 's/^img/thumb/') #  -e 's/.jpg$/.png/')
# -sample is ugly
  if [ ! -r ../thumbs/$j ] ; then
     convert -geometry 320x240 $i ../thumbs/$j
  fi
done
