#!/bin/sh
umask 022
set -e
mkdir -p .thumb
for a in "$@"
do
	case "$a" in
	*.jpg)
		djpeg "$a" |
		pnmscale -xysize 200 200|
		cjpeg > .thumb/"$a"
	;;
	*.png)
		pngtopnm "$a" |
		pnmscale -xysize 200 200|
		cjpeg > .thumb/"$a"
	;;
	esac
done
