Phoghorn is a web-based image gallery with built-in automatic thumbnail generator for spiffy the webserver.
Its features are:
By default, phoghorn assumes there is a directory called galleries
in the directory from which you call its functions (ie, the same directory in which you placed index.ssp
). It will create thumbnails on-the-fly when there aren't any yet, and only for those pictures on the page that is currently being viewed. By default, these will be placed in the thumbs
directory under the gallery's directory.
In the main page (save this as index.ssp
):
(use phoghorn spiffy-utils) (define content `((html (head (title "Showing gallery: " ,(get-var (gallery-var)))) (body (phoghorn-gallery))))) ;; We want bigger pages (parameterize ((page-size 40)) (output-html content phoghorn-rules pagination-rules shortcut-rules universal-conversion-rules))
In the zoomed-in page (save this as zoomed.ssp
):
(use phoghorn spiffy-utils) (define content `((html (head (title "Showing photo: " , (get-var (entry-var))) (body (phoghorn-zoomed-entry)))))) ;; The shortcut-rules and the pagination-rules are mandatory, by the way (output-html content phoghorn-rules pagination-rules shortcut-rules universal-conversion-rules)
Phoghorn can be customised to the max. The following SRFI parameters are supported, in addition to the configuration options for spiffy-utils pagination (which phoghorn uses internally):
You can use these functions if you want more control over the way your gallery is output, ie using it more as a library than as a complete thumbnail gallery package.
gallery-var
).Returns two values: The first value is a list of subgalleries in that gallery, the second value is a list of entries (ie, pictures) in that gallery.thumbnail/epeg
or thumbnail/imlib2
based on the entry file. Side-effects: creates the thumbnail if it does not exist and creates the thumb-dir
if necessary.thumbnail
. Note: the source image must be a jpeg.thumbnail
. Note: the source image must be of a type understood by imlib2.entries
list, as seen from the selected entry. Returns #f
if this is the first entry in the list.entries
list, as seen from the selected entry. Returns #f
if this is the last entry in the list.This section describes the SXML tags that are available when you use phoghorn-rules
.
entries
, headed by a pagination list.galleries
.gallery
is #f
, a link to the root gallery with (root-gallery-name)
as the link title is generated.entry
with the (generated if necessary) thumbnail.zoomed-url
with the gallery and entry as parameters. (using link-to
).gallery-var
and entry-var
.Copyright (c) 2005 - 2008, Peter Bex (peter.bex@xs4all.nl) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.