|Generated: December 4, 2003, 23:36:18||Copyright ©2003, Kurt NÝrmark|
Reference Manual of the Photo Show tool
Kurt NÝrmark © email@example.com 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
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:
|default-lower-caption||default-lower-caption||A default string for the lower captions of pictures (a string)
|default-lower-size||default-lower-size||A default string for the lower font size of pictures (a number between 1 and 6)
|default-photo-height||default-photo-height||The default height of a photo.|
|default-photo-width||default-photo-width||The default width of a photo.|
|default-time||default-time||A default time (a number, in seconds).|
|default-upper-caption||default-upper-caption||A default string for the upper captions of pictures (a string)
|default-upper-size||default-upper-size||A 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-url||home-url||A URL which allows us to exit from the photo index.|
|last-url||last-url||The 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-dir||photo-destination-dir||The directory in which to write the output html files from this tool.|
|photo-show-title||photo-show-title||The title of the show.|
|photo-show-verbose||photo-show-verbose||A 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-width||visual-index-photo-width||The 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
|A variable that controls if the tool can generate informative messages.
|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.
|A default string for the upper captions of pictures (a string)
|A default string for the upper font size of pictures (a number between 1 and 6)
|A default string for the lower captions of pictures (a string)
|A default string for the lower font size of pictures (a number between 1 and 6)
|A default time (a number, in seconds). Show each picture default-time seconds
|The default width of a photo. Using #f as value of this variable means that
we use the actual width of the photo
|The default height of a photo. Using #f as value of this variable means that
we use the actual height of the photo
|The width of photos in the visual index
3. OTHER IMPORTANT VARIABLES.
|The title of the show.
Intended to be redefined after this tool is loaded.
If not redefined, no title is shown.
|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.
|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 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).
|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.
|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
|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 number-list photo-input-list)|
|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