de | en

AlbumGen

This project started to make all the private photos available for other members of my family. It then evolved into a management software for photos, with the main focus on a photo overview and a simplified search for photos.

The basic principle of the user interface is to sort the photo according to the exact date and time when it was shot. This then starts with a calendar based overview

in which the dates, when photos are available are marked and hence, are directly visible.

Each date has an overview of all available photos:

Finally, each photo is displayed at a single page:

Dates and photos kann have a description, which is also shown.

The photo album uses HTML for displaying things, enabling a simplified usage with each internet browser. This also allows to put the album at some internet storage, such that others can view the photos too (as was the initial intention).

Tags

Each date and each photo may have associated tags. Date related tags also apply to all photos collected at this date.

In the HTML site, a list of all tags is presented. There, the font size is dependend on the number of photos per tag. Furthermore, for each tag a list of dates and photos is shown.

Tags may be used with boolean expressions (“and”, “or”, “not”) to look for specific photos (currently only from the command line).

Foto DB

All data for the photos, e.g., ordering, description or tags, are stored in the file PHOTOS.xml in each date directory. These directories are stored in the corresponding year directory (format: YYYY) using the format MM-DD with month and day of month.

The format of the file PHOTOS.xml is:

<album>
  <title> Title </title>
  <tags> date tags </tags>
  <date> date </date>
  <prev> next date </prev>
  <next> previous date </next>
  <photo>
    <file> original photo file </file>
    <desc> photo description </desc>
    <orientation> portrait or landscape </orientation>
    <format>3x2 or 4x3 or 16x9 </format>
    <tags> tag1, tag2, ... </tags>
  </photo>

  <photo>
   ...
  </photo>
  
</album>

Normally, manual changes to this file are not needed but possible.

Usage

HTML-Oberfläche

Beside the actual display of photos, each page also contains usage elements (upper left), which are reduced to a minimum. Within the year overview, one can switch the the next or previous year. For each date, these switches allow navigation to the next or previous date. Finally, for each photo, the next or previous photo is shown.

With the Home symbol, one can switch to the next higher level, e.g. from the date to the year overview.

Importing Photos

To import new photos the command import is provided. The following options are available:

  • -c, –copy

    copy original photo into album.

  • -f, –force [html|lores|thumb|overwrite|all]

    force to overwrite existing files (HTML, photos, thumbnails, …).

  • -i, –ignore

    ignore EXIF data in files.

  • -t, –title <title>

    set title of page.

  • -v, -verbosity <n>

    Set verbosity.

Photos may be provided as a list of files, e.g.,

> import photo1.jpg, photo2.jpg ...

or using a path:

> import my_photos1/ my_photos2/ ...

The the latter case, all photos in the directory are imported.

First Import

When using albumgen for the first time, a new directory for the album should be created and the complete source tree should be copied into this directory. Afterwards, the first photos may be imported:

> mkdir photoalbum
> cd photoalbum
> cp -a <path to albumgen> .
> albumgen/bin/import <path to photos>/

Videos

Videos are also supported. They are converted into Ogg/Theora (webvideo) and an animated Gif is shown in the overview page. However, the support for videos is limited (don’t expect too much).

GAlbum

For further changes of the album a GUI program is available:

> galbum

Title, descriptions and tags may be edited using it.

Tags

To search for photos via tags one may use the program

> searchtags

For this, first the tag database has to be created via

> searchtags -g

Afterwards a tag or logical combinations of tags can be used for the search:

> searchtags "tag1 and tag2 and not tag3"

The output is either a simple list (plain) or an HTML file:

> searchtags -o html "tag1 and tag2 and not tag3"

To generate the list of tags in the HTML format use the command

> gentags

Misc.

There are other programs for special tasks:

> genindex

(re-)created the year index.

> genyear <year>

(re-)creates the album for the given year.

Finally, via

> update 

the album in the current directory may be updated, e.g., if manual changes have been made to PHOTOS.xml.

Source Code

AlbumGen is writtin in Python (GTK for the GUI). But there are some dependencies to external libraries and programs, e.g. for image conversion. These are

  • EXIF-py
  • Py-GTK
  • Py-Image
  • Py-Sqlite2
  • Py-Parsing
  • ImageMagick (for convert)
  • FFMpeg (for videos)
  • gifsicle (for animated gifs)

EXIF ist bereits enthalten. Die übrigen Packete müssten für Python nachinstalliert werden.

The development of albumgen was more or less sporadic, depending on what was needed. Therefore, the programming structures are not as good as one (me) would wish. However, since time is currently limited and the program works for me, this situation will probably not change. Hence, I apologise for the code quality.

The source code is made public under GNU-General Public License (except EXIF.py).