#!/bin/bash # Thumbify script by Eric Auer http://www.coli.uni-saarland.de/~eric/ May 2002 # I know I could have done this in Perl, but Bash is also pretty nifty, hu? chmod u+w . echo "Saving old index.html, if any - please ignore errors" cp -f index.html index.html-$RANDOM echo "Creating new index.html" echo '' >index.html chmod 644 index.html cat <>index.html Homepage von Eric Auer: Fotoseite

Homepage von Eric Auer: Fotoseite

zurück

EOF echo "Removing old thumbnails" rm -fv Thumb-*.jpg let COUNT=0 echo "Creating new thumbnails and HTML" for x in *.{jpg,png,gif} do if test -r $x then convert -verbose -geometry 240x240 -quality 67 $x Thumb-$x.jpg chmod go+r $x Thumb-$x.jpg let MODULO="COUNT%3" let COUNT="COUNT+1" if let "MODULO == 0" then echo "Starting a new table row" echo "" >>index.html fi echo "" >>index.html else echo "Cannot find or use any $x, skipping those" fi done cat <>index.html
" >>index.html echo ">index.html echo "src=\"Thumb-$x.jpg\" alt=\"$x\">" >>index.html echo "
$x (" >>index.html du -Lh $x |sed -e 's/[^0-9kmKM].*$//g' >>index.html echo ")" >>index.html echo "

zurück

This thumbnails page is created using free Unix tools such as Bash and Image Magick. The source code of this script can be found here, but of course you need to adjust it to your needs before you can use it!

EOF echo "Done"