Andrew Fairbairn


HTML Photo Album Maker

Overview

This is a program I wrote that takes a bunch of .jpg pictures and produces a HTML photo album (like the ones in the 'photos' section of this website). The album consists of a title page and then a separate picture page for each of the photos. You can add various bits of information about the pictures to the picture page, such as title, comments and date.

Download

Download a zip file containing all the program's files: HTML album.zip.

Updates, Bugs and Fixes


26/01/06. New version deletes obselete html pages, pictures and tumbnails when albums are edited. Bug fixed in the picture preview when the order of pictures are changed when creating a new album. Currently no other known bugs. I will update the interface soon to make the program a bit more userfriendly.

Installation

Extract all the files in the .zip file into a folder on your computer - it doesn't matter where the folder is or what it is called, just that all the files are put into it. The file browsing feature of the program, used to locate the .jpgs on your computer, will start in the folder where the HTML album.exe file is located. Therefore, it will save time effort to put the program into a folder located near to the place where your photos are saved.

As soon as the program files have been extracted from the .zip file you're ready to go - just run HTML album.exe. You can move the folder containing the program around to more convenient places at any time, the only important thing is to make sure that all the program files are kept together. 'Fraid you'll have to create shortcuts manually if you want them.

What the program does

  • Converts a list of .jpgs selected by the user into a HTML photo album by:
    • Makes a title page with thumbnails (optional) that are linked to picture pages with the full size .jpg
    • Makes an individual page for each full-size picture with navigation buttons linking it to the 'next' and 'previous' picture pages, and an 'up' button that links back to the title page.
    • Allows the user to append information to the picture pages. This includes: Title, Comments, Date, Film, Lens, Camera body, Technical notes

    What the program doesn't do

  • For the time being the program can only be used with jpeg format digital pictures (i.e. files with .jpg file extensions, not .gif, .bmp, .tif, etc.). In addition, it will only recognise jpeg files with .jpg file extensions, not .jpeg extensions.
  • HTML Photo Album maker doesn't contain any kind of picture editing functions. This means that you have to edit your source .jpg files down to the size you want them to appear on a webpage before using HTML Photo Album Maker. Also, if you want thumbnails on the title page you need make thumbnails yourself beforehand (see below).

    Instructions

    Fistly, before using HTML Photo Album Maker, edit your pictures so that they appear as you want them on a webpage (i.e. right size, compression, etc.), and make sure that they are saved as jpegs with .jpg file extensions. These edited jpgs will be referred to a the source images for your HTML album. Source images for a single HTML album may be located within multiple folders.

    If you want thumbnails of the source images to appear on the title page of your album you need to make them yourself beforehand. It is possible to automate this process in programs like Photoshop, and I'm sure there must be freeware out there that will do it too. When you have edited the file down to the size of thumbnail that you want, save it in a sub-folder called "thumb" within the folder containing the full-size source image. The name of the thumbnail .jpg must be exactly the same as that of the full size image. If the thumbnail is not in a subfolder called "thumb", or if the name is different from the relavent source image HTML Photo Album Maker will not find the thumbnail, and so a thumbnail for that source file will not be included on the title page. If no thumbnails are located, only the title of the HTML album will appear on the title page. The title is a link to the first picture page of the album, and if there are no thumb nails on the title page the only way to reach the other picture pages is using the 'previous' and 'next' navigation buttons.

    When using the program to create a new HTML album, you are prompted to create a folder. This folder will contain the title page of the album, sub-folders called "pics", "html" and "thumb". When you select your source images, copies will automatically be transferred to the "pics" folder, and any thumbnails that are found will be copied to the "thumb" folder. The picture pages of the album will be created in the "html" folder. The program then gives you the opportunity to alter the appearance of the title and picture pages (e.g. font, colours) and to add information to the picture pages, such as date and comments.

    Hopefully the program should be fairly self explanatory. Below are a few comments for those wishings to make some alterations to the formatting of the pages produced

    The title page and picture pages are based on templates kept in the folder that HTML Photo Album Maker was extracted into, called titletemplate.txt and template.txt respectively. If you are familiar with HTML you can make your own changes to these files, however deleting certain elements may cause the program to stop working. The program uses remark elements to locate and change various parts of the templates to create the title and picture pages, so it is important that these remarks are not deleted. However, the order of the parts (e.g. nav buttons, pictures, tables etc.) can be shuffled around, and anything can be added to the templates so long as it is not contain any of the same HTML remark tags that are used as id tags by the program.

    The navigation buttons inserted by the program into the picture pages can be changed by replacing the "next.gif", "previous.gif" and "home.gif" files in the program folder with the desired button files. These must be .gifs with the same names. When an album is created the navigation button .gifs are copied to the "html" sub-folder, so to change the buttons displayed in an existing album these .gifs can be replaced with other button .gifs with the same names.

    Code

    This is the first and only program I've written, so the code is accordingly shambolic. The project expanded beyond what I expected, and I ended up creating a monster. John apparently wanted a good laugh at the frankencode. If you'd like to join in you can download the visual basic project files here: code.zip. This is slightly out of date, but close enough to the current code.