# By Lars Johannesson (lars@gruk.net)
# version 1.2  copyright 2002 Lars Johannesson

# A somewhat messy script.  Blame it on feature creep..

# This program takes a set of image files in a directory and makes a set of
# container html files to display those images, for ease of viewing. An index
# (index.html) is created, as well as an html file for each image, with
# "previous, next, # index" links to string them all together. From the
# command line, run the script while in the directory containing the images
# or run the script with the directory pathname as argument.

# WARNING!!! This program will delete any existing .html files in that
# directory, as well as any files whose name begins with "th_" before going
# to work. This is so that you can add images to the directory and run the
# program again to update the files.  The images will need to have the proper
# suffix for the program to recognize them.  It currently sees files
# with the .gif .GIF .jpg .JPG .jpeg .JPEG suffix.

# The program takes arguments for background color (currently just -b for black
# - it defaults to white), -nt for 'notext mode', and -th to make thumbnails
# using imagemagick.  Thus one can invoke the script as
# "images.pl -b -th /home/lars/pictures/mypics", to give it a black
# background and to include thumbnails in the index file.

# If you would like to include some text to the side of the picture, make a
# textfile named .txt, put it in the same directory as the
# pictures and it will be included.  The name _has_ to be exactly the same as
# the picture (except for the suffix -- .txt instead of .jpg) to be found, so
# the image foopic.jpg would have a textfile named foopic.txt.

# DISCLAIMER: This script is provided AS-IS, and comes with no guarantees
# whatsoever.  If you mangle your filesystem with it you only have yourself
# to blame for not reading the source before trying it.  There are definitely
# ways to run this script that would cause damage to parts of your computer.
# You have been warned.