Generated: December 4, 2003, 23:36:18Copyright ©2003, Kurt NørmarkThe local LAML software home page

Reference Manual of the Photo Show tool

Kurt Nørmark ©    normark@cs.auc.dk    Department of Computer Science    Aalborg University    Denmark    

Source file: tools/photo-show/photo-show.scm
LAML Version 22.00 (December 4, 2003, alpha-4)

The photo show tool generates a continous presentation of gif or jpg pictures from a particular directory. The kernel of the tool is a Javascript mechanism which navigates automatically from one HTML page to the other. The function make-photo-show generates a set of trivial HTML pages (two per picture). The function photos-in-current-directory generates a list photo entries of the jpg and gif file in the current directory. As an alternative you can make this list manually. Photos-in-current-directory depends on the non-standard Scheme function directory-list (which is supported by MzScheme).

Tool Usage: Define a simple LAML script in the directory which contains the photos. See the examples for concrete information. By LAML processing the script the necessary HTML files are defined in an html sub-directory (made by this tool).

The index.html file, generated in the current directory, is a natural starting point of the photo show. The file index-visual.html is an alternative index.

Each execution of make-photo-show genererates a file first.lsp, which contains the name of the first photo in the collection (a string with no extension). The function first-url-in-directory (which generates a continutation url for another collection) uses the first.lsp file of the other directory. Thus, this must be taken into consideration when a more complex collection of photos are organized.

The procedure make-photo-show also generates index-visual-editor.html, which is a page that submits a request to a photo service program at www.cs.auc.dk. The server returns a zip file with all necessary html stuff for a photo show, including new index files. Please notice that this facility is experiment, and not yet meant for general use.

Obsolete. Use the XML-in-LAML Photo Show Tool.

Table of Contents:
1. Example script.3. Other important variables.
2. Default settings.4. Top level functions.

Alphabetic index:
default-lower-captiondefault-lower-captionA default string for the lower captions of pictures (a string)
default-lower-sizedefault-lower-sizeA default string for the lower font size of pictures (a number between 1 and 6)
default-photo-heightdefault-photo-heightThe default height of a photo.
default-photo-widthdefault-photo-widthThe default width of a photo.
default-timedefault-timeA default time (a number, in seconds).
default-upper-captiondefault-upper-captionA default string for the upper captions of pictures (a string)
default-upper-sizedefault-upper-sizeA default string for the upper font size of pictures (a number between 1 and 6)
first-url-in-directory(first-url-in-directory dir)Return the URL of the first photo page (a html page) in dir.
home-urlhome-urlA URL which allows us to exit from the photo index.
last-urllast-urlThe relative URL of the continuation of this photo show.
make-photo-show(make-photo-show photo-list)Make the photo-show from photo-list in terms of individual HTML files and an index file.
photo-destination-dirphoto-destination-dirThe directory in which to write the output html files from this tool.
photo-show-titlephoto-show-titleThe title of the show.
photo-show-verbosephoto-show-verboseA variable that controls if the tool can generate informative messages.
photos-in-current-directory(photos-in-current-directory)Return a list of photo-entries, sorted alphabetically, in the LAML startup directory.
take-subset-by-numbers(take-subset-by-numbers number-list photo-input-list)Return a sublist of photo-input-list, namely the photo entries in number-list.
url-of-first-picture(url-of-first-picture photo-list)Return a URL to the first picture in the photo list.
visual-index-photo-widthvisual-index-photo-widthThe width of photos in the visual index

 

1.   EXAMPLE SCRIPT.
Here follows an example script which makes a photo show. Place it in the directory with you photos.

(load (string-append laml-dir "laml.scm"))
(load (string-append laml-dir "tools/photo-show/photo-show.scm"))

(define default-upper-caption "Some title to appear above photo")
(define default-upper-size 6)  ; font size - a number between 1 and 6
(define default-lower-caption #f)  ; no lower caption
(define default-lower-size 1)

(define photo-show-title "Title of show")

(define default-time 2)  ; show each picture 2 seconds

(define photo-list (photos-in-current-directory))   ; extract photos from current dir
(define last-url (url-of-first-picture photo-list))  ; show cyclic show

(make-photo-show photo-list)


photo-show-verbose


Form
photo-show-verbose

Description
A variable that controls if the tool can generate informative messages.


photo-destination-dir


Form
photo-destination-dir

Description
The directory in which to write the output html files from this tool. Defaults to (startup-directory).


 

2.   DEFAULT SETTINGS.
The default settings apply as defaults for photo-entries. Individual photo entries overwrites the defaults.


default-upper-caption


Form
default-upper-caption

Description
A default string for the upper captions of pictures (a string)


default-upper-size


Form
default-upper-size

Description
A default string for the upper font size of pictures (a number between 1 and 6)


default-lower-caption


Form
default-lower-caption

Description
A default string for the lower captions of pictures (a string)


default-lower-size


Form
default-lower-size

Description
A default string for the lower font size of pictures (a number between 1 and 6)


default-time


Form
default-time

Description
A default time (a number, in seconds). Show each picture default-time seconds


default-photo-width


Form
default-photo-width

Description
The default width of a photo. Using #f as value of this variable means that we use the actual width of the photo


default-photo-height


Form
default-photo-height

Description
The default height of a photo. Using #f as value of this variable means that we use the actual height of the photo


visual-index-photo-width


Form
visual-index-photo-width

Description
The width of photos in the visual index


 

3.   OTHER IMPORTANT VARIABLES.


photo-show-title


Form
photo-show-title

Description
The title of the show. Intended to be redefined after this tool is loaded. If not redefined, no title is shown.


last-url


Form
last-url

Description
The relative URL of the continuation of this photo show. You cannot supply an absolute URL. This URL is relative to the directory, in which the picture resides. This variable must be re-defined after this tool is loaded. You can use (url-of-first-picture photo-list) as the value of this variable to make a cyclic show. If #f, this show is terminated by an empty screen in the background color.


home-url


Form
home-url

Description
A URL which allows us to exit from the photo index. Like last-url, this URL must be relative. It is interpreted as relative to the directory in which the photos reside. This variable can be redefined after photo.scm (this tool) has been loaded. If not redefined, no home url is presented.


 

4.   TOP LEVEL FUNCTIONS.
The functions in this section are used in the LAML script which generates the photo show.


make-photo-show


Form
(make-photo-show photo-list)

Description
Make the photo-show from photo-list in terms of individual HTML files and an index file. Photo-list may be generated by photos-in-current-directory, or manually. Photo-list is a list of photo-entries, of length at least one. Each photo-entry is of the form ("photo-file.ext" show-time "upper-caption" upper-size "lower-caption" lower-size).


photos-in-current-directory


Form
(photos-in-current-directory)

Description
Return a list of photo-entries, sorted alphabetically, in the LAML startup directory. A photo entry is a list of the form ("photo-file.ext" show-time "upper-caption" upper-size "lower-caption" lower-size) upper-caption and/or lower-caption may be #f in case no caption apply; In that case upper-size and lower-size (integers, seconds) do not matter.


url-of-first-picture


Form
(url-of-first-picture photo-list)

Description
Return a URL to the first picture in the photo list. This may serve as a reasonable value of last-url. As for last-url, the resulting URL is relative to the picture directory


first-url-in-directory


Form
(first-url-in-directory dir)

Description
Return the URL of the first photo page (a html page) in dir. The URL is relative to the HTML directory of the current collection of images, and it will normally address the first html file in the next collection. Thus the return value is a legal value of last-url, just like the value of url-of-first-picture. The directory dir is given relative to the photo directory of current collection of images. This function relies on the file first.lsp, which is generated by the photo show system in each picture directory upon processing. If no first.lsp file exists, the function returns the empty string.


take-subset-by-numbers


Form
(take-subset-by-numbers number-list photo-input-list)

Description
Return a sublist of photo-input-list, namely the photo entries in number-list. The first photo is number 1.


Generated: December 4, 2003, 23:36:18
This documentation has been extracted automatically from the Scheme source file by means of the Schemedoc tool