#!/bin/sh # Image Directory Viewer by Dave Taylor for LinuxJournal # More scripting goodness at http://www.intuitive.com/wicked/ # or contact me directly at taylor at intuitive dot com # Drop this in an image directory, name it "index.cgi" and # go into your httpd.conf file to ensure that you can run CGI # scripts in that folder. Then enjoy! :-) maxsize=150 # max thumbnail size, in pixels maxperline=3 # max images per table row imgcount=0 # keep track of images displayed totcount=0 # and total number of entries listed linecount=0 # images displayed on current line figuresize() { width="$(identify $1|cut -d\ -f3|cut -dx -f1)" height="$(identify $1|cut -d\ -f3|cut -dx -f2)" } echo "Content-type: text/html" echo "" echo "
" echo "| "
echo " " echo "$name ($height x $width) | "
linecount=$(( $linecount + 1 ))
imgcount=$(( $imgcount + 1 ))
else
# not an image file, don't display anything
# echo "$name"
fi
totcount=$(( $totcount + 1 ))
done
echo "