#!/bin/bash JPEG=0 if [ x-$1 = x---jpeg ] ; then JPEG=1 shift fi if [ $JPEG -eq 1 ] ; then for i in $* ; do convert $i -auto-orient -strip $i.jpg convert $i.jpg -resize 300x300 $i.gif rm $i.jpg done else for i in $* ; do convert $i -resize 300x300 $i.gif done fi