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