SLiMSuite REST Server

EdwardsLab Homepage
EdwardsLab Blog
SLiMSuite Blog
REST Pages
REST Status
REST Tools
REST Alias Data
REST Sitemap

pic_html V1.1

HTML generator for picture websites

Module: pic_html
Description: HTML generator for picture websites
Version: 1.1
Last Edit: 23/11/05

Copyright © 2005 Richard J. Edwards - See source code for GNU License Notice

Imported modules: rje

See SLiMSuite Blog for further documentation. See rje for general commands.


This module is designed to take one or more folders of pictures and generate linked HTML pages for them. An accessory application for making thumbnails is needed. This should be used prior to running the program, or at the prompt.

At present, this script will generate photos for an assumed hiearchical ordering. The current directory should be the one from which the program is run, and this will contain the pictures.htm file which links to the other pages. Within this there are then three hierarchies of folder: 1. A 'Type' of picture group, e.g. Holidays or Animals etc. 2. A 'Group' of pictures within the type, which may itself have multiple subfolders 3. An 'Element' of the group of pictures, which consists of a single set of linked photos

The 'Group' is the primary focus of this script as photos will generally be added for a particular event (a holiday for example). In addition to the folders for individual elements, each group should have a thumbnails folder which has all the thumbnails for that group. Each element has its own folder for which a set of linked web pages is generated. These are linked directly to the Pictures page.

The pages for each element consist of two frames: 1. A margin, for easy navigation to individual photos and thumbnails pages etc. 2. The main frame where the photos are displayed, with their names and a short description.

Each photo has its own page, with arrows cycling through the previous and next photos (in a circular fashion via the thumbnails page) with the title of the picture underneath and, if desired, a small description. Clicking on the picture will open it full size in another page. In addition to these, there is a thumbnails page, which links to the individual web-pages, and a downloads page which links direct to the photos themselves.

If usehome=T and/or edithome=T are used (both are by default) the pictures home page will be read for existing descriptions and edited to contain links to all folders and descriptions in the picdesc file, i.e. the content from the two files plus any additional folders added, will be merged. When reading from the pictures home page, the script recognises Types, Groups and Elements of photos on a strict pattern recognition in the HTML: Type: '^<HR><H2>(.+)</H2>' => Type Description Group: '^<P><B>(.+)</B>' => Group Description Element:'^<A HREF="(\S+)/(\S+)/(\S+)/index.htm" TARGET="_top">(.+\S)</A>;' => type,group,el, Element Description In each case, the number of photos may be extracted from the description with '\s+[(\d+)]$'. Be careful that no other lines will match these patterns. (The Group pattern may occur BEFORE the first Type pattern but NOT AFTER it.)


### File locations etc. ###
pichome=FILE : File name for pictures home page [pictures.htm]
usehome=T/F : Whether to extract descriptions etc. from the pictures home page [True]
edithome=T/F : Whether to regenerate the pictures home page [True]
picdesc=FILE : File with picture descriptions Type:Group:Element Description [pic_descriptions.txt]
extlist=X,Y,..,Z : List of acceptable picture file extensions [jpg,gif]
picfolder=X : Name of primary folder to look in for photos [*]
thumbnails=X : Folder containing thumbnails for all pictures of this type [thumbnails]
thumbname=X : Name to distinguish thumbnails from actual pictures (will rename) [_thumb]
### Webpage Appearance ###
homeback=FILE : File to use for picture home background [None]
hometitle="X" : Title to use for home web page ["Photo Page"]
picback=FILE : File to use for other page backgrounds [None]
fontface=X : Font to use for text [Comic Sans MS]
larrow=FILE : Image file for Left Arrow (pref GIF) [larrow.gif]
rarrow=FILE : Image file for Right Arrow (pref GIF) [rarrow.gif]
picids=T/F : Whether pictures have picture IDs 'ID - Name.*' [True]
thumbheight=X : Height of thumbnails (pixels) in Preview pages [120]
### Other ###
clearhtml=T/F : Delete existing HTML in picture folders (*.htm and *.html) - may overwrite anyway. [True]

© 2015 RJ Edwards. Contact: