summaryrefslogtreecommitdiff
path: root/mkthumbs.sh
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2024-01-06 22:47:34 +0000
committerIan C <ianc@noddybox.co.uk>2024-01-06 22:47:34 +0000
commitbcb81858d5fb6a6b28c5c5e2b02ab5e4bbaed93d (patch)
tree3f4d45f7503bd3778b16e86dfed07753e0663445 /mkthumbs.sh
parent8c62cfcff0c0727491aaa54e5288bf315716e7e8 (diff)
Added --basename to mkthumbs.sh
Diffstat (limited to 'mkthumbs.sh')
-rwxr-xr-xmkthumbs.sh20
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