Thanks to all of you who have responded. I should have enough information
now to be able to dig into the issue of adding comments to images in the
form of EXIF tags.
Perhaps I should explain what I'm doing. I have a Java program, run
overnight as a cron job, that can walk a directory tree and decorate it
with a thumbnail of every new or modified image it finds. As I run an in-
house webserver, this is enough to let a PHP script generate on-the-fly
menus from directories in the tree which contain clickable links to all
files in the directory. Links to images display the thumbnail as part of
that menu entry. However, this doesn't work if you simply point a browser
at a local copy of the directory structure, so the Java program can also
generate a linked set of static menus that work in the same way for
people who don't run a web server.
This is working reliably and well. It has met my design target of
automatically indexing sets of images as they are dropped on a hard drive
so they can be scrolled through using smaller images that those can be
selected so the full resolution image can be seen.
Now I'd like to display descriptions, when they are available, under the
thumbnails.
Thanks to all of you I now know that I can write a program to add the
descriptions to the images as EXIF 'Comment' tags and in parallel I've
checked that PHP can extract the content of those tags in order to add
them to the on-the-fly menus and that Java can do the same for the static
menus.
The only issue is speed: the PHP library routines to check that the image
is the right type to have EXIF tags and to extract the tags require each
image to be read several times: (1) to display the thumbnail, (2) to see
if it is the right type to hold tags [this can probably be skipped] and
(3) to extract the Comment tag's content. Currently only (1) happens, so
I need to benchmark things to see if the PHP script is fast enough to
support extracting captions from EXIF tags: this is not a consideration
for the Java menu builder since this is never run when a user wants to
see an list of images *right now*.
If the PHP menu generator is unacceptably slow when dealing with EXIF
tags, I'll use the aesthetically ugly trick of keeping the captions as a
separate CSV list (filename,caption) which will probably be faster since
at the start of the run it can be loaded into a Hashtable (Java) or
associative array (PHP) once and will stay in memory while the menu
builder is running.
Thanks again for your help.