diff options
author | jimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003> | 2005-11-25 22:45:21 +0000 |
---|---|---|
committer | jimmacfx <jimmacfx@4fa712ea-3c06-0410-9261-c11b4c06c003> | 2005-11-25 22:45:21 +0000 |
commit | 20407702b92cb93970eaa4a71e659f383d2f92a5 (patch) | |
tree | 063e1fc818a47e1b74e285a7b5e80ac7cb90a306 /convert/contrib/web-gallery | |
parent | 6429a6080db982bcb37421d9735e25cfec25acec (diff) | |
download | original-20407702b92cb93970eaa4a71e659f383d2f92a5.tar.gz original-20407702b92cb93970eaa4a71e659f383d2f92a5.tar.bz2 |
0.11
git-svn-id: https://forgesvn1.novell.com/svn/original/trunk@8 4fa712ea-3c06-0410-9261-c11b4c06c003
Diffstat (limited to 'convert/contrib/web-gallery')
-rw-r--r-- | convert/contrib/web-gallery | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/convert/contrib/web-gallery b/convert/contrib/web-gallery new file mode 100644 index 0000000..952f8fe --- /dev/null +++ b/convert/contrib/web-gallery @@ -0,0 +1,105 @@ +#!/bin/bash + +# Nautilus script to generate image galleries for use with original +# uses Gnome's zenity for user dialogs +# uses ImageMagick's convert +# (c) 2005 boris de laage <bdelaage@free.fr> +# based on imgconv bu Jakub Steiner + +set -e + +name=`basename $0` + +# convert options +convertor=`which convert` +extra_ops="-strip" + +#default options +dir=./web-gallery + +files=$(echo $@ | sed 's/ /\n/g' | sort) +numfiles=$# + +if [ -z $convertor ]; then + zenity --title $name --error --error-text "convert not found !" + exit 1 +fi + +if [ $numfiles == 0 ]; then + zenity --title $name --error --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 +mkdir -p $dir/mq +mkdir -p $dir/hq +mkdir -p $dir/zip +mkdir -p $dir/comments +chmod o+w $dir/comments + +echo "<Files info.txt>" > $dir/.htaccess +echo " deny from all" >> $dir/.htaccess +echo "</Files>" >> $dir/.htaccess + + +i=1 + +for imagefile in $files + do + process="converting $imagefile" + + # Thumbnail + 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` + 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` + 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` + echo $progress + + # HQ + echo "#$process : hq" + cp $imagefile $dir/hq/img-$i.jpg + progress=`expr $progress + $increment` + echo $progress + + # Comments + echo "#$process : comments" + # template for comment + echo "<span>Photo $i</span>
" > $dir/comments/$i.txt + progress=`expr $progress + $increment` + echo $progress + + i=`expr $i + 1` + +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 + 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." |