This is a specification for a script that will create a navigation
system (index file plus page scripts) for a directory full of
different-size versions of a set of photos. This spec was written by
email@example.com on October 8, 2004.
The photos will be named
foobar.jpg (camera original or sometimes a full-size JPEG version of a
foobar.1.jpg (thumbnail, about 128-150 pixels in its smallest dimension)
foobar.2.jpg (in-line display size for a document where the photo is
primary content, e.g., a sign, about 256 pixels in its smallest
foobar.3.jpg (photo to show a person surfing on a laptop after he or she
clicks on a thumbnail, about 512 pixels in its smallest dimension)
foobar.4.jpg (photo to show a person surfing on a big screen after he or
she clicks on a thumbnail, about 1024 pixels in its smallest dimension)
foobar.5.jpg (photo for reproduction on a home printer, about 2048
pixels in its smallest dimension)
foobar.6.jpg (photo for reproduction in a magazine, about 4096 pixels in
its smallest dimension)
Note that these sizes and numbers correspond to the early 1990s Kodak
PhotoCD Base1, Base2, Base3, ... sizes.
Given a directory of JPEGs, which are named as above,
1) rename all the .JPG or .JPEG to ".jpg" extensions
2) create an index.html file that shows all of the thumbnails (.1.jpg)
as IMGs with WIDTH and HEIGHT tags; the SRCs and HREFs should be full
relative URLs and each IMG with its wrapping A HREF= tag should be on
a separate line so that it is easy to cut and paste into a document
elsewhere on the same server
3) for each thumbnail, create an AOLserver .tcl script with the same
name as the file, e.g., foobar.tcl, that contains the following
a) comment at the top saying "this is the target of the thumbnail
(full URL, minus the host name)"
b) call to a procedure "philg_thumbnail_target" with the following
arguments (i) Tcl list of width and height of the ".3.jpg", (ii)
Tcl list of width and height of the ".4.jpg", (iii) copyright
statement, e.g., "copyright 2004 Philip Greenspun"
Note: philg_thumbnail_target will use the Web server API to figure
out the URL path and also the filename.
The script is designed to be run on the server and in the directory
where the images are being served. It therefore does not need to take a
directory as an argument. The script's only argument will be the
copyright text. If that argument is not supplied it should default to
"copyright [current year as determined by a Perl system call] Philip
------------ **** notes to Jin
I tried out your script in
and found the following issues...
a) the index.html file contains relative rather than absolute URLs
so that the entire line can be cut and pasted into another document on
the server and it will still function
[this presumably will require a config param in the Perl script
containing the server pageroot, "/web/philip/www/"]
b) there shouldn't be any extra spaces in front of the "