Thumbnail as generated for subalbums
Sample thumbnail

Introduction

When I bought my first digital camera (a Nikon 4500), I thought it would be nice to have an online (and offline) photo album, so I could show others my photos. There are huge numbers of album generators available, but none of them did quite what I wanted. One generator (album by David Madison) was based on the idea to have all thumbnails the same size, both landscape and portrait photos, which looked rather good. His album generator though could only be used to "pre-generate" all album files.

So, building from there, my own digitAlbum was born. It grew a bit more than I anticipated, and has now two methods of displaying thumbnails on a page, a slideshow mode, and a companion management interface to quickly add photos straight from the camera into one or more albums.

How does it work?

Regular vs irregular
Regular vs irregular grid

No fuss

The scripts are based on the idea that you can put some images in a directory, and not bother any further if you want. (Usually you want to bother, in order to have nice captions, etc). Therefore the scripts will generate thumbnails (and medium size images) on the fly. These generated images are stored on the webserver, so when another user comes along, no files have to be created. If you change an image, the thumbnails will also be generated again.

Sub albums

A directory with images is considered to be an 'album'. An album can contain sub-albums (i.e. subdirectories). In the overview pages with thumbnails, sub-lbums get their own special thumbnail, showing tiny versions of the first four images in the sub-album.

Info files

For each directory encountered an album.info file is created, containing the names of the image files in the directory, and a default caption (name of the image without its extension). In this file, rating can be added (see below), and the order in which the images should be displayed can be changed by moving the image section around.

Regular vs irregular

You have a choice to display the thumbnails in a regular grid (where all thumbnails are the same size), or in a irregular grid (where the size of the thumbnail depends on the rating given to the image). The images are processed in the order they appear in the album.info file (which initially is the order they appear in the directory). For a regular grid, thumbnails are placed row after row. For an irregular grid, the scripts will try to find the first "free" position for the thumbnail depending to the size of thumbnail. The example to the right shows what happens when you have nine images and a grid of five cells wide.

Ratings

Images can be rated with a number from 1 through 4. The higher the rating, the nicer the image is assumed, to when using an irregular grid, images with rating 4 get the biggest thumbnails.
Rating selector
Rating selector
You can also decide to let the viewer have the option to select what images he or she gets to see depending on their rating. (See the ratingAction option below). In that case, at the bottom right hand corner of the album pages there will be a selector where the viewer can choose to see all images, or only the images with a rating of 2 and up, 3 and up or 4 and up.

Slideshow

You can also set a slideshow timer. When set, on the top-right corner of each page there will be a checkbox with which the user can enable the slideshow. On regular intervals the scripts will load the next image. The user can disable the slideshow at any time to take a longer look at an image.

Set-up

Installation

  1. The software consists of a number of PHP-scripts, so your webserver should have PHP available. A recent (>= 4.x) should work ok.
  2. Next, the scripts depend on a number of external programs to do the thumbnail creation. These are: Make sure these are on the webserver - if not, install them.
  3. When this is all in place, put the digitAlbum scripts in a directory accessible by (and reachable through) the webserver.
  4. Change the album.config.php file as required. These are the global settings, and most can be changed on a per-album basis. See the next section for all options.
  5. Make sure the paths to external programs in the album.config.php file are defined correctly for your system.
  6. Create a directory where you want to store your album(s), and either use the management interface (see below) to put some pictures in this directory, or copy them by hand.
  7. If you have enabled aliases, you should now be able to browse the album using an URL like:

    http://hostname/path/to/album.php?album=alias

    If you are not using aliases, the URL will look like:

    http://hostname/path/to/album.php?album=/path/to/album/directory

  8. The first time you access an album, all thumbnails have to be generated, so it might take some time. If nothing happens, check either your PHP log (errors here are related to insufficient access rights for creating files and directories), or your webserver log (where the errors from the external programs are usually logged).

Configuration

The following options can be set in the configuration file:

Configuration overrides

Some of these options can be overriden a per-album basis, by adding entries to the album.info file for that album. For example, to change the numCols or a specific album, add the line in bold to the album.info file (and add the [Album] section if it does not exist yet):
[Album]
...
numCols=8
...

Aliases

You have the choice to use aliases for album locations, or to use absolute file paths. If the aliasFile option is set, the scripts will try to expand the first element in the album parameter using the aliases file. An aliases file looks like:
[aliases]
alias1=/some/directory
alias2=/another/directory
When the user now requests

http://hostname/path/to/album.php?album=alias1/subalbum

the scripts will expand the album parameter into /some/directory/subalbum. When the aliasesOnly option is set, the uses has to use an alias. If it is not set, the user could also have requested

http://hostname/path/to/album.php?album=/some/directory/subalbum

directly.

Look and feel

The scripts generate table with CSS-class indicators on the table, its rows, the cells and the labels. Customize the look-and-feel by changing the example album.css file.

Panoramas

To make the software create appropriate space in the thumbnail pages for panorama photos, add the line in bold to the section for that image:
[pano-harbour.jpg]
caption=View on the harbour
panorama=yes
rating=3

Management interface

The mimgs.php script can be used to easily transfer images from your camera to an online album.
Selection of directories
Selection of directories

On the first page you have to enter the directory where the 'original' images are stored, and the directory where the albums are stored (or to be created). For both you have to choice to enter the (full) path by hand, or to select one of the subdirectories of the srcBase and dstBase configuration options.

If you have large directories with many images, and you are in the 'middle' of organizing that directory, you can optionally enter the filename of the image where you want to start in the source directory.

Main interface
Main interface

If the directories have been entered, press 'continue' to go the main management interface.

Note: the original images are always shown in their original size here, so if you have a high resolution camera, you might need a large desktop...

At the center of the screen the current image is shown, and to the left and to the right are shown (if any) the previous five and next five images as thumbnails (Note: to keep things as smooth as possible, for these thumbnails the EXIF-thumbnail from the original image is used; no thumbnails are created).

Beneath the image, there a number of entry fields:

Cropping images

If you click with mouse on the image, and drag the mouse, a rectangle will be drawn on top of the image. This rectangle is then used to crop the image before it is copied to the destination directory. Once drawn, the rectangle cannot be modified. Go to another image and back to remove the rectangle and try again.

EXIF data

If you hove the mouse over the image, a summary of the EXIF data from the image is shown (if present). This also works for the thumbnails, and can be used to compare images.

Maneuvering between images

There are five ways to go to another image:

Static albums

The staticalbum script can be used to generate a 'static' album, i.e. one that does not require PHP anymore, and can for example be put on a CD. First, make sure that the first line of the script points to your PHP executable.

staticalbum recognizes the following arguments:

An example for creating a static version of an album would then look like:

$ staticalbum --nocss --srcdir /home/herman/album --dstdir /tmp/staticalbum

The script will output the progress as it works its way through all images.

FAQ

Known issues

The following are known issues, bugs, etc:

Download

The latest version of digitAlbum is available as a ZIP-file. The ZIP-file contains all scripts and this documentation.

Version history

1.00
1.01
1.02
1.03
1.04
1.05

License and credits

digitAlbum is released as e-mail-ware: please send me an e-mail if you use the program. If you are really ecstatic about digitAlbum, I have a wish list at Amazon.

All of this is inspired by the album script written by David Ljung Madison (see his album website).

The idea for the irregular grid came from Jeroen van Dalen.