aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2006-05-25 20:03:42 +0000
committerjimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003>2006-05-25 20:03:42 +0000
commit7d5e38fe18f4f935030848abe4b5296a065b6982 (patch)
tree47636c107283f30e6715941ca7e2fde1ec46b251
parent554ab758855bc94f6181931ee96642528de81a72 (diff)
downloadoriginal-7d5e38fe18f4f935030848abe4b5296a065b6982.tar.gz
original-7d5e38fe18f4f935030848abe4b5296a065b6982.tar.bz2
patch from Sebastien Person <seb@nmi.ath.cx>
git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@15 4fa712ea-3c06-0410-9261-c11b4c06c003
-rw-r--r--convert/contrib/web-gallery29
1 files changed, 15 insertions, 14 deletions
diff --git a/convert/contrib/web-gallery b/convert/contrib/web-gallery
index 952f8fe..f2b90f4 100644
--- a/convert/contrib/web-gallery
+++ b/convert/contrib/web-gallery
@@ -20,21 +20,17 @@ dir=./web-gallery
files=$(echo $@ | sed 's/ /\n/g' | sort)
numfiles=$#
+
if [ -z $convertor ]; then
- zenity --title $name --error --error-text "convert not found !"
+ zenity --title $name --error --text "convert not found !"
exit 1
fi
if [ $numfiles == 0 ]; then
- zenity --title $name --error --error-text "No input files !"
+ zenity --title $name --error --text "No input files !"
exit 1
fi
-#progressbar stuff
-steps=5
-increment=`expr 100 / \( $numfiles \* $steps \) `
-progress=0
-
mkdir -p $dir/thumbs
mkdir -p $dir/lq
@@ -48,6 +44,9 @@ echo "<Files info.txt>" > $dir/.htaccess
echo " deny from all" >> $dir/.htaccess
echo "</Files>" >> $dir/.htaccess
+# stuf for the progressbar
+step=5
+max=`expr $step \* $numfiles + $step`
i=1
@@ -59,34 +58,35 @@ for imagefile in $files
echo "#$process : thumbnail"
$convertor -geometry 120x120 -modulate 100,140,100 -unsharp 1x20 \
-quality 60 $extra_opts $imagefile $dir/thumbs/img-$i.jpg
- progress=`expr $progress + $increment`
+ progress=`expr \( $i \* $step + 1 \) \* 100 / $max`
+
echo $progress
# LQ
echo "#$process : lq"
$convertor -geometry 640x480 -modulate 100,130,100 -unsharp 1x5 \
-quality 90 $imagefile $dir/lq/img-$i.jpg
- progress=`expr $progress + $increment`
+ progress=`expr \( $i \* $step + 2 \) \* 100 / $max`
echo $progress
# MQ
echo "#$process : mq"
$convertor -geometry 1024x768 -modulate 100,130,100 -unsharp 1x5 \
-quality 80 $imagefile $dir/mq/img-$i.jpg
- progress=`expr $progress + $increment`
+ progress=`expr \( $i \* $step + 3 \) \* 100 / $max`
echo $progress
# HQ
echo "#$process : hq"
cp $imagefile $dir/hq/img-$i.jpg
- progress=`expr $progress + $increment`
+ progress=`expr \( $i \* $step + 4 \) \* 100 / $max`
echo $progress
# Comments
echo "#$process : comments"
# template for comment
- echo "<span>Photo $i</span> " > $dir/comments/$i.txt
- progress=`expr $progress + $increment`
+ echo "<span>Photo $i</span>" > $dir/comments/$i.txt
+ progress=`expr \( $i \* $step + 5 \) \* 100 / $max`
echo $progress
i=`expr $i + 1`
@@ -98,8 +98,9 @@ done | zenity --progress --title="Scaling images, please wait..." --auto-close
echo "1"
echo "#Making archives"
zip -R $dir/zip/mq.zip web-gallery/mq/*.jpg
+ echo "50"
zip -R $dir/zip/hq.zip web-gallery/hq/*.jpg
echo "100"
) | zenity --progress --pulsate --auto-close --title="Zipping images"
-zenity --title $name --info --info-text "Your <b>O.R.I.G.I.N.A.L</b> gallery is ready."
+zenity --title $name --info --text "Your <b>O.R.I.G.I.N.A.L</b> gallery is ready."