Create a .cap file
with one line for each image (.jpg, .gif, .png) in a selected directory.
The line for an image is
[imagename.ext] caption
where the caption is extracted from the image. (This causes the script to
take much longer than you might expect.)
[-d srcdir] The directory to scan. Default is the current
directory. This directory should be a subdirectory of PICTURESROOT as given
in /Pictools.properties
. Its relative name is stored
in the output file as the value portion of a "picturesdir: " line.
[-p prefix] When -p is given, all picture file names
must start with prefix. The prefix is stripped, the stripped names
are sorted with the -n
option, and the prefix is restored to
the result. Thus, if the names are Slide9.JPG
, Slide10.JPG
, and Slide11.JPG
,
that will be their order. (Without -p
, sorting would place the first of these
after the other two.)
[filename | -] File where the output
will be stored. The default is segname.cap
, where segname is
the simple name of the source directory. A single dash sends the output to stdout
.
If filename is given, that will be made the segment name following "file:" on
the first line of the file.
In the completed file, the captions lines will be preceded by two header
lines:
file: segname Pictures for segname
picturesdir: relative-path-from-PICTURESROOT-to-pictures-srcdir
where segname is the output file name if given or else the simple name of
the pictures directory.
If emvironment variable PICTOOLSDEBUG
has a value, a
pair of lines is written to /tmp/pictoolsdebug.log
.