NAME

Photog! - The Photography Website Generator

SYNOPSIS

photog [-q] [-v] [destination]

photog-[scale, watermark, thumbnail, preview]

DESCRIPTION

Photog! turns a directory tree of source images into a photography website with nested albums of chronologically sorted photographs. To get started, simply cd to the source directory and call photog:

    $ cd Pictures
    $ photog

Upon the first run, Photog! asks the user for a destination directory, which it writes to the file photog.ini inside the source directory. The destination can also be specified on the command line as the final argument, or inside a pre-existing photog.ini file. Subsequent runs of the photog command do nothing unless the contents of the source directory have changed. Photog! only regenerates the parts of the website that should be updated.

OPTIONS

-q

Be less verbose

-v

Be more verbose

CONFIGURATION

Photog! reads configuration directives from a file named photog.ini inside the source directory. Subdirectories can contain additional configuration files that override certain settings from the root configuration file. A value set in the configuration file will become the new default value for all child albums.

Config files consist of a number of variable = value directives. Empty lines and lines starting with a # are ignored. All the possible configuration variables are documented in the manual page of Photography::Website::Configure, the module that implements Photog!'s configuration system. Here is an example configuration file:

    # This is an example ~/Pictures/photog.ini
    title = Super Formosa Photography
    watermark = /home/jj/watermark.png
    template = /home/jj/frontpage-template.html
    destination = /var/www/superformosa.nl

This tells Photog! the title, watermark, template, and destination to use when generating the album that corresponds to the directory ~/Pictures. The albums that are created from the subdirectories inside ~/Pictures will also have the same title, watermark, template and destination, because these values are inherited by all child albums (unless they are overridden by additional photog.ini files). Again, for a complete list of all possible configuration variables consult the Photography::Website::Configure(3) manual page.

TEMPLATING

Photog! comes with a file named template.html that uses Template::Toolkit syntax to render each album's index.html. The default template uses Javascript to "pack" images into horizontal rows. You can supply the path to your own template with the template configuration variable.

The easiest way to create your own template is to start with a copy of the default template. The location of the default template varies by platform, but it can always be found with the following Perl oneliner:

    perl -MFile::ShareDir=dist_file -E \
    'say dist_file("Photography-Website", "template.html")'

All the configuration options automatically become template variables. An additional template variable, items, contains the sorted list of the album's children. Here is an example template (see Template::Manual::Intro for an introduction to the template syntax):

    <h1>Welcome to [% title %]!</h1>
    <p>These are my photo albums:</p>
    [% FOREACH item in items %]
      [% IF item.type == 'album' %]
        <img src="[% item.src %]" title="[% item.my_custom_title %]">
      [% ENDIF %]
    [% ENDFOR %]

As you can see, this example references the attribute my_custom_title of each child album. This is not an "official" configuration option, but as long as you set it yourself in the album's photog.ini it will be available to all child albums just like the regular configuration variables.

ADDITIONAL COMMANDS

Photog! calls the commands photog-scale, photog-watermark, photog-thumbnail, and photog-preview to generate scaled, watermarked, thumbnail and preview images. These commands are simple shell scripts that have been installed to the same path as the photog command. They call ImageMagick to do the actual image processing. Each command prints out a simple usage instruction when called with no arguments. If you want to change Photog!'s behavior for generating images and thumbnails, you can supply your own commands in the configuration file (see Photography::Website::Configure).

SEE ALSO

Photography::Website, Photography::Website::Configure

AUTHOR

Photog! was written by Jaap Joris Vens <jj@rtts.eu>, and is used to create his personal photography website at http://www.superformosa.nl/