diff options
-rwxr-xr-x | mkthumbs.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mkthumbs.sh b/mkthumbs.sh index 37bd959..9d4153e 100755 --- a/mkthumbs.sh +++ b/mkthumbs.sh @@ -1,20 +1,36 @@ #!/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 - convert $i.jpg -resize 300x300 $i.gif + + 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 - convert $i -resize 300x300 $i.gif + if [ $BASENAME -eq 1 ] ; then + convert $i -resize 300x300 $(basename $i).gif + else + convert $i -resize 300x300 $i.gif + fi done fi |