From bcb81858d5fb6a6b28c5c5e2b02ab5e4bbaed93d Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 6 Jan 2024 22:47:34 +0000 Subject: Added --basename to mkthumbs.sh --- mkthumbs.sh | 20 ++++++++++++++++++-- 1 file 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 -- cgit v1.2.3