1. About Photopub 2. Installation 2.1 Installing from the tarball 2.2 Installing from an RPM package 2.3 Installing from a Debian package 3. Configuration 3.1 Quick start 3.1.1 Configuring /etc/photopubrc 3.1.2 Creating ~/.photopubrc 3.1.3 .info files 3.2 Webserver configuration 3.3 General guide 4. Reference
Photopub is a CGI application to publish photographs on the World Wide Web.
It was originally concieved as a way of automatically generating thumbnailed previews of digital camera photographs, as soon as they were placed in a specific directory. Since then, photopub has expanded to incorporate many features such as photograph captions, multliple picture formats, html templates, and most importantly, multiple users. This manual explains how to install, configure and use photopub.
Currently, photopub can be installed manually, by downloading a release as a set of tarballed files, or it can be installed from a ready-made RPM or Debian package.
The only changes that should be initially required to the main config file are to enable PhotoPub for each individual user that you wish. In the following fragment, each user should be added to the "users" line, separated by spaces:
<path /users> <userconfig> # allusers # not implemented users ganesh nick file $HOME/.photopubrc </userconfig> </path>
This gives each user control over the /users/username namespace, using their ~/.photopubrc file.
Next, add a link to each user's main album, if you so wish. By convention, this album is called /users/username/all. This link will be added to the default album /all and will thus appear on the page at http://hostname/photopub/album.
<album all> # insert links to users here, e.g. # <link /users/foo/all> # title "Joe Bloggs" # level 1 # </link> <link /users/foo/all> title "Ganesh Sittampalam" level 1 </link> <link /users/foo/all> title "Nick Burch" level 1 </link> </album>
Each user should create such a file, as follows. You should first decide how you wish to organise the /users/username namespace. The recommended arrangement is for photos from camera "foo" to go into /users/username/foo; even if you only have one camera now, it makes sense to plan for the future or for importing photos from other sources.
Suppose that your pictures are stored in /home/username/photos/foo. If your camera resets the numbering every so often (e.g. after you download pictures), then each group should be put in subdirectories, which will end up mapped to subpaths in PhotoPub namespace. If you want to use an alternative structure (perhaps because you already have your photos in such a structure), that should work fine, but these instructions don't yet cover it.
Here is a sample ~/.photopubrc for camera "foo", with pictures in /home/username/photos/foo:
<path foo> <imagedirs> dir /home/username/photos/foo prefix p digits 7 suffix .jpg </imagedirs> <infofile> dir /home/username/photos/foo filename .info allowhtml no makealbum all </infofile> </path> <album all> include foo/all </album>
The most important bits to change, apart from the paths and directory names, are the "prefix", "digits" and "suffix" options. Together these determine the format expected from picture file names. For example, the settings above will map "p0000001.jpg" to picture number 1, etc. If the numeric element isn't zero-padded, set "digits" to 0.
These files are used to annotate your photos with extra information, such as descriptions, which photos should be grouped together in the album page, and how the photo should be adjusted when presented to the user. The file should be placed in the same directory as the photos it describes. If you don't like the name, use whatever you like (and change the "filename" option above). Here's a short sample of such a file:
group 1-5 My first photos describe 1 Me rotate 1 90 adjust 1 1.1 1.1 1.1
The "group" item will cause an entry pointing to that range of photos to go into the album page. The "describe" item will provide a caption for the range page. Use "rotate" to turn the picture the right way up, and adjust to change the colour balance - the values given should be gamma correction values for red, green and blue respectively, with 1 meaning no change.
Following the principles set out by Tim Berners-Lee in "Cool URIs don't change", every effort has been made to reduce implementation dependencies (taking /cgi-bin/ out of the path, dropping the .pl extensions on the perl scripts, etc) in PhotoPub URLs, to allow for the possibility of an entirely different implementation of the same interface in future.
Thus, a "standard" installation will be accessed at the URL
http://hostname/photopub/{album|range|display}?...
If you installed from a package and are using Apache as your webserver, this should have been set up automatically, but you may need to deal with this manually if your configuration is non-standard in some way that collides with the assumptions we made.
If for whatever reason you do not wish to do things in this way, you are mostly on your own for now, but you may find the following settings in /etc/photopubrc useful:
albumlinkroot album rangelinkroot range displaylinkroot display
PhotoPub makes links to other PhotoPub pages using relative links, so everything but the final element in the path of these links is determined by the URL you access it at. These settings control what that final element should be - you may for example wish to change album to album.pl, etc.
We will try our best to avoid incompatible changes in the query parameters and script names, although it cannot be completely ruled out, especially in development releases.