                    Cute Little Image Gallery Script (CLIGS)

Introduction

   The Cute Little Image Gallery Script (CLIGS) is a PHP script that
   autogenerates a nice html index for a directory full of jpeg images. CLIGS
   (c) Copyright 2005 John Leach and is licensed under the terms of the Gnu
   Public License version 2.

   If you like CLIGS and/or have any suggestions feel free to [1]e-mail and
   tell me about it.

Features

     * Scales all the images to useful sizes on the fly
     * Uses an on-disk cache to relieve load on the server
     * Custom logo overlay
     * Reads image metadata generated by [2]gthumb
     * Reads image metadata from EXIF headers.
     * Simple XML gallery metadata
     * Sports tidy and compliant HTML
     * Entirely configurable using stylesheets.

   See an [3]example gallery to see what it can do.

Requirements

   CLIGS needs the following stuff to work:

     * PHP 4
     * Probably Apache
     * The [4]PHP Pear module Page2. (see [5]below for more help)
     * PHP support for the GD2 graphics library
     * PHP support for the EXIF library
     * A directory writable by the web server (for resized image caching)
     * Ability to configure Apache URL rewriting

   For help getting these requirements installed, see [6]below

Download

   Get the latest version of the script from the [7]downloads directory

Installation

   For help getting the requirements, see [8]below

    1. copy the cligs.php script, the up.png image and the cligs.css
       stylesheet into your web root. Let's say /home/john/www is the web
       root.
    2. If your webroot does not appear at the domain root (for example,
       perhaps you share web hosting and it appears in a subdirectory) you
       need to edit the variable $base pointing at the subdirectory. E.g:
       your url is http://www.example.com/users/john/, set the variable to
       "/users/john"
    3. make a directory in your webroot where you'll be storing your images
       and sub-galleries. Let's say gallery/.
    4. Setup Apache URL rewriting:

 <Directory /home/john/www>
         RewriteEngine On
         RewriteBase /
         RewriteRule ^gallery/.*$ /cligs.php
 <Directory>
 

    5. make a directory in your webroot called thumbcache/ which is writable
       to by the user Apache runs as. In my case the directory looks like
       this:

 drwxrwxrwx  91 john www-data 4.9K Mar 10 22:25 thumbcache

    6. upload your images to the gallery/ directory. Any sub-directories will
       be listed as sub galleries. If you've used gthumb to create metadata,
       ensure the .comments/ directory is uploaded (you'll need a recent
       version (2.6 onwards?) of gthumb to create this).
    7. Optionally write an xml file for each gallery (directory) called
       gallery.xml, specifying a gallery title, description etc. and
       optionally the full path to a png file containing a logo to overlay in
       the top left corner, an image to use as the icon, and some text to use
       as a footer:

 <gallery>
         <title>My holiday in Italy</title>
         <description>Photos from holiday in Venice, Italy.</description>
         <author>John Leach</author>
         <date>December 2005</date>
         <logo>/home/john/www/overlay-logo.png</logo>
         <icon>Image18.jpg</icon>
         <footer>All the photos are belong to me</footer>
 </gallery>

       If you don't specify an icon, a random one is chose each time.
    8. Go view your cute little gallery

Requirements installation

   I'm just going to cover [9]Fedora and [10]Debian here. It should be enough
   to help you with other distros. If you're compiling from source, then
   you're on your own.

  GD support for PHP

   On Fedora this is available from the php-gd rpm. On Debian it's called
   php4-gd.

  PHP Pear

   Get the base PHP Pear installed first. On Fedora this is available from
   the rpm named php-pear. On Debian it's called php4-pear.

   Now you can use the pear command line to install the HTML_Page2 module. It
   seems this module is still in development, so you need to tell Pear you're
   happy installing devel modules:

 pear config-set preferred_state devel

   Then install the module:

 pear install HTML_Page2

Limitations / Bugs

     * Image or directory filenames with characters that need to be HTTP
       encoded (other than spaces) won't work. This is currently due to
       laziness on my part. I'll fix this soon I'm sure.
     * Depending on your apache setup, you might not be able to delete the
       image cache yourself. I'll need to implement this feature in the
       script at some point I guess.

   Back to [11]johnleach.co.uk

References

   Visible links
   1. mailto:john@johnleach.co.uk
   2. http://gthumb.sourceforge.net/
   3. http://johnleach.co.uk/photography/
   4. http://pear.php.net/
   5. http://johnleach.co.uk/documents/cligs/#phppear
   6. http://johnleach.co.uk/documents/cligs/#phppear
   7. http://johnleach.co.uk/downloads/cligs/
   8. http://johnleach.co.uk/documents/cligs/#phppear
   9. http://fedora.redhat.com/
  10. http://www.debian.org/
  11. http://johnleach.co.uk/
