2 Customization Files
The files that one can use to customize the order in which mt2 displays
images, and the comments or headings that it writes among them, are the crux
of generating interesting albums. In this part, I discuss the comment
file, group file, date file, hide file, list file, and
include file. For all the examples, I assume that we are dealing with an
album that contains five images, IMG-1.JPG...IMG-5.JPG; additionally,
we assume that they were created in reverse-alphabetical order, that is,
IMG-5.JPG was created before IMG-4.JPG, and so on.
2.1 Comment File
Mt2 has the ability to write comments underneath the name of a picture in
an album. Using a comment file is the easiest way to tell the program
what comment goes with which picture. To give a picture a comment, you write
it's name at the beginning of a line, put a colon after it, and then on
subsequent lines you write whatever HTML comment you wish, closing it with
a period on a line by itself. For example, if we want to comment two of our
pictures, we could create a file named comments.txt, given below, and then
pass it to mt2 with either the -C option, or using the comment-file
resource directive.
sample comments.txt
IMG-4.JPG:
This is Martha and I as we were hunting for pickles in the farm
outside Edinburg in 1998. What <b>big</b> pickles!
.
IMG-3.JPG:
How did that Rottweiler get onto the field! Run Martha, run!
.
2.2 Group File
Let us say that in our album, we want IMG-3.JPG to be shown directly
underneath IMG-5.JPG, and for both of the pictures to be grouped with a
heading explaining them. None of the sort orders we have available (name,
date) will result in those two pictures being adjacent---so we use a group
file, and pass it to mt2 using the -g option, or the group-file
resource. To construct a group, write the word "group" at the beginning of a
line in the file; if you want a comment, put a color after it, and write the
comment as you would in the comment file. Then, list the pictures to be placed
in that group, in the order in which you want them to appear in the album,
closing the list with the word "endgroup". Note that you can have more than
one group per group-file; just list them one after another. Here is an
example:
sample groupfile.txt
group:
Martha being chased by a huge dog!
.
IMG-5.JPG
IMG-3.JPG
endgroup
After all of your pictures are sorted by whatever criterion you selected, mt2
will read the group file and rearrange the photos to make sure the pictures
you indicated are adjacent. In addition, if the group has a comment (as
above), it will write before the first picture a heading with the comment, and
put a line under the last picture; however, if you don't want a bottom
delimiter for your commented group, put the phrase --no delimit--
somewhere in your comment---it will be removed before the comment is written
to the HTML file, so it can appear anywhere. Also, if the phrase
--trailer-- appears in the comment, it too will be removed, and the
comment will appear at the end of the group of pictures. You can use a
commented, undelimited group to put a title over or under a specific picture
without resorting to a list file.
2.3 Date File
Normally, when mt2 attaches dates to the thumbnailed images, it uses the time
the picture was last modified to calculate the displayed date; however, there
are times when you want the date shown to be different from the modification
time---for instance, if you scan a picture of your trip to Las Vegas from
thirty years ago, you probably want the date next to the picture to say
3/6/1972, rather than the date you scanned it. For this purpose you can use a
date file, specified by the -D flag or date-file directive, and the
format of which is like a comment file, except that the "picture names" in
this case are dates as you want them displayed, and the "comments" are lists
of file names, one per line, for which that date should be displayed. Here is
a brief example.
sample datefile.txt
3/6/1972:
IMG-2.JPG
IMG-4.JPG
.
12/03/2002:
IMG-3.JPG
.
There are two notes of which you should be aware: a special date named
none, and a special filename called default. If you mark a file
using the above mechanism as having a date of "none", no date will be
displayed with that file, even if dates are turned on; also, if you include
the filename "default" within the list for a certain date, that date will
be displayed for all files that don't appear in any other date list. Here is
how those two items could be used.
datefile-special.txt
none:
IMG-3.JPG
IMG-5.JPG
.
March 23, 2002:
default
.
2.4 Hide File
There may be certain pictures or directories ("folders" in the album) that
you do not want shown, for instance that one your friend took of you and the
sheep with the beautiful eyes, so to make sure they are not shown, create a
hide file: this is simply a file with a list of the photos and
directories you want to leave out of the album, one per line. Pass this file
to mt2 using the -hi flag or the hide-file directive in the
resources.
2.5 List File
The list file is somewhat of a relic, a holdout from the elder days before
comment, group, and hide files existed, when we were all happy using only
list files, and grateful even for that. Basically, you can use a list file to
completely control which pictures are shown, the order in which they are
shown, and any comments you want to include (though the comment file is still
heeded, if you have one). The downside is that if you add any new pictures to
the directory, you must also add them to the list file, which gets to be a
pain in the ass after you have a lot of pictures, and don't remember which
ones are already in there. Mt2 will generate an album for only those pictures
in your list file. Additionally, you can use the special picture name
"none", to leave a blank space in the album, with a comment if you'd like.
So, for instance, if our list file is
sample listfile.txt
none:
These are all the pictures from my European vacation.<br>
All three of them.
.
IMG-2.JPG
IMG-4.JPG:
The funkiest picture ever.
.
IMG-1.JPG
mt2 will generate an album containing only IMG-2.JPG, IMG-4.JPG, and IMG-1.JPG, will
comment the appropriate ones, and will write the comment associated with "none" at
the place it appears in the file, here at the top.
2.6 Include File
Sometimes you want an album to contain only a subset of the pictures in a
directory, and if those pictures have diverse names, creating a glob to match
all of them would be cumbersome---in this case you can use an include
file, which is simple a list of filenames, one per line, to be processed.
Unlike a list file, an include file does not affect the way the pictures are
sorted, nor does it allow you to attach comments to pictures. When you use an
include file, pruning is turned off, since we assume that there are many other
pictures in the directory.
|