			TKAlbum

TKAlbum is a graphical user interface to a number of programs for
generating and maintaining albums of digital photos using HTML
files. The main ingredient is the "album" script written by David
Ljung Madison, which allows for the flexible generation of
hierarchically organized HTML photo albums.  In addition, TKAlbum
makes use of "jhead", "jpegtran", and the Image Magick tools.

TKAlbum provides a GUI to
- file handling, i.e., copying, moving, renaming, deleting,
  undeleting, image editing
- transforming images in a lossless way, i.e. rotating and flipping
- editing descriptive data for the album script, e.g., album and
  picture descriptions, orders of images, etc.	
- customizing the album script execution and starting it
- downloading from a digital camera - provided it supports the 
  USB mass storage protocol
- inspecting different properties of JPEG image files and viewing pictures


1. PREREQUISITES

TKAlbum has been implemented using Tcl/Tk (version 8.3), which you
probably already have on your computer or which you can easily install
if you have a recent Linux distribution. It is also possible to
install Tcl/Tk under Windows and the Mac, but I haven't tried to run
TKAlbum under these operating systems.

TKAlbum uses the following programs:

- album (version 2.36) by  David Ljung Madison, a Perl script for
  generating photo albums using HTML 
  (http://marginalhacks.com/Hacks/album/)

- jhead (version 1.8) by Matthias Wandel, a program that analyzes the
  EXIF data structure in JPEG files generated by digital cameras. Here
  a number of interesting information can be found, such as the date
  and time the picture was taken, the exposure time, focal length,
  aperture, dimension of picture, etc.
  (http://www.sentex.net/~mwandel/jhead/)

- jpegtran (version 6b) by Thomas G. Lane and the Independent JPEG
  Group. This program implements lossless transformations of JPEG
  files, which is important if you want to turn your images by 90
  degrees.
  (http://www.ijg.org) 

- rdjpgcom & wrjpgcom by the Independent JPEG group. These programs
  can be used to read and write the comment field in JPEG files.
  (http://www.ijg.org)

- Image Magick's tools convert, mogrify, and display (version
  5.4.2). These programs can be used to convert, to display, and to edit
  image files having a wide range of different image formats.
  (http://www.imagemagick.org)


2. INSTALLATION
    
The Image Magick tools and the tools by the Independent JPEG Group are
in wide spread use and you probably have them already or can install
them from the CD of your Linux distribution. I also assume that you
already have Tcl/Tk 8.3 installed.

The two remaining programs are part of the distribution of TKAlbum and
are very easy to install:

1) Untar/ungzip the respective files: 
    tar -xvzf album.targ.gz 
    tar -xvzf jhead.tar.gz

2) Copy the "album" script (in the directory album) to a place which
   is part of the path variable, .e.g., to /usr/local/bin or to your
   own binary directory ~/bin/. Type "album -h" in a shell to check
   whether album starts. If not, you probably have to change the first
   line of the album script to correctly point to the Perl
   interpreter. Or worse, you have to install Perl - which is not a big
   deal, though.

3) Change into directory jhead-1.8, type "make" and copy the resulting
   executable file "jhead" to a place where one can easily execute it,
   e.g., /usr/local/bin or ~/bin. Try it out by applying jhead to some
   JPEG file that has been produced by a digicam and be surprised!

4) Finally, copy tkalbum to a place where it can be easily
   executed. Note that the wish shell should be located at
   /usr/bin/wish for the script to work. Otherwise change the first
   line of the script. 


3. CUSTOMIZATION

3.1 Program Calls

If everything worked out so far, you can now start TKAlbum and customize
it by setting the appropriate options. The most important part is
probably to supply the correct path information for the programs that
are to be executed by TKAlbum. Under "General Option," one finds all
the programs and the ways they are called. Most probably everything is
ok here. However, if programs have been copied to strange places which
are not part of the path variable, one has to provide the full path
to the program. 

There are also a multitude of other options one can change. As you
will see, there are dynamic help texts that hopefully give enough
explanation.

3.2 Interface to the Camera

The next important part is the customization of the interface to your
digital camera, provided you have a camera that supports the USB mass
storage protocol and your Linux (as all more recent versions) support
it. If you do not have such a camera, you probably want to disable the
Camera download functionality completely, which can be done by
clicking on the appropriate check button in the "General Option" menu
entry. 

If you do not know the type of your camera, consult the various
sources that describe what camera supports which protocol, e.g.
http://www.qbik.ch/ (USB support in general) and
http://www.gphoto.org/. Another way to find out whether your camera
supports the USB mass storage protocol is to plug your camera into a
free USB port and watch /var/log/messages and /etc/fstab. If you have
a recent Linux and the camera is right, you will see messages telling
you how the camera can be mounted. If you do not have any SCSI hard
disks, chances are that your camera can be mounted as /dev/sda1.
Perhaps you have to add an entry to /etc/fstab and to provide a mount
point. In my case the hotplugging mechanism extended /etc/fstab and
provided a user mountable device under /media/sda1.

If your camera is such a camera, you now can customize the "Camera
options" and then you should be able to download pictures from your
camera. 


3.3 Setting up an Album

Albums are organized hierarchically. Check out David Ljung Madison's
web pages under http://marginalhacks.com/Hacks/album/, which contain a
lot of examples. In order to get a first idea, put a few photos in a
directory and use the "Set root album" menu entry in the "File" menu
to point to this directory. 

Now you should already be able to generate an album by pressing Meta-L
or selecting the appropriate entry in the "Album" menu. Watch the
result by loading the file index.html in your root album into a
browser. Note that there no annotations but the file names of the
pictures. Futhermore, the design of te HTML page follows the "default
theme". Other themes (e.g. the "Blue" theme that comes with the album
distribution) can be selected by setting the appropriate in the "Album
options".

The annotations are controlled by the various text fields in the
TKAlbum window. Just fill some text into the fields "Picture Name",
"Picture Captions", and "AltTag", regenerate the album, and see how it
affects the generated album. Additional header and footer lines can be
added by using the "Edit header & footer" command in the "Album" menu
(or Meta-F). Finally, the order of the pictures can be affected by the
two arrow buttons to the left of the directory listing.

An album cannot only contain pictures but also additional
sub-albums. So one can add directories to an existing album. I myself
tend to separate pictures and albums and store pictures only in the
leaves of the album. However, this is, of course, personal taste.

4. PROBLEMS AND SOLUTIONS

Since I just finished the implementation of TKAlbum only recently,
there are probably still a number of bugs. Use the program with
caution. If you find bugs, please tell me.

5. CONTACT

You can reach me at bernhard.nebel@gmx.de




