#!/bin/sh

RESOLUTIONS="160x120 640x480 1024x768 1600x1200"

orig=`pwd`
while [ ! "x$1" = "x" ]; do
  db=
  path="$1"

  cd "$path"
  for res in $RESOLUTIONS; do
    mkdir -p $res
  done

  for i in ""*""; do
    if [ ! -d $i ]; then 
      for res in $RESOLUTIONS; do
        echo "$i: $res"
        convert -sample $res -antialias $i $res/$i &
      done
    fi

    wait
  done

  cd "$orig"
  shift
done

