Jay's home page ·
Tools
thumb
Jeff Poskanzer wrote a great script called
thumbnail_index for indexing image directories for the Web. Here's
a sample of its output.
I modified it to add optional HTML text to the front of the index,
to produce links that work whether you're viewing via the web
or directly from the filesystem, to extract comments from JPEG
files and create links to them (the
jpgcomment script can be used to add these comments), and to use filenames
that are more portable across OSes.
To distinguish it from Jef's original script, I call it `thumb', which isn't a very good name. (A command named
thumb ought to cause one to be picked up by passing spacecraft, of
course.)
Most of these changes were inspired by wanting to use the script
to make indexed CDs of digital photographs - a sort of personal
photo gallery on a CD. I also use it to create web indices.
You can see some samples in
my photo gallery.
Here's the script:
-
thumb (Bourne-shell script)
It takes zillions of options now. Particularly useful are `-cd', which sets up defaults appropriate for browsing the resulting
index on a CD or other filesystem (not via the web) and `-web', which sets up defaults appropriate for browsing the resulting
index via the web.
It uses a couple of special files if they exist. Neither is
required. They are:
-
.head.html is prepended to the index if it exists. It should have the
following format:
- Opening <HTML> tag
- <HEAD>...</HEAD> tags and their contents, most
notably the document title (<TITLE>...</TITLE>)
- Opening <BODY> tag
- Any initial text, typically starting with a <H1>Heading</H1>
for the page (often the same as the document title)
Anywhere within the
.head.html file, the string
@@UP@@ will be replaced with a link to the parent directory (e.g.
either
../ or
../index.htm). (@@INDEX@@ is also handled specially.)
-
.title.txt is used with the
-r flag to display something other than the directory name when
this directory is listed in the index of a parent directory.
I.e., if you create an index of a directory with a subdirectory,
and the subdirectory contains a
.title.txt file, the contents of the subdirectory's
.title.txt file is used to label the folder icon that links to the subdirectory.
For more details, type `thumb -h', which will produce a help message.
Jay Sekora
<js@aq.org>
last modified 1999.12.18