Kiddo's Lightbox Gallery

This is a semi-automated website gallery that achieves the following goals

  1. easy to integrate into any design with PHP
  2. simple code
  3. integrates with Lightbox automatically
  4. optional thumbnails generation
  5. thumbnails preserve aspect ratio (no "stretched") images; yes, that means automatic cropping!
  6. independent thumbnail widths and heights; you can have artistic, rectangular thumbnails
  7. as fast as possible (no MD5 hashing)

Demo

Visit my drawings gallery.

Screenshots

With 30x100 thumbnails activated:

Kiddo's Lightbox Gallery with thumbnails

Without thumbnails:

Kiddo's Lightbox Gallery without thumbnails

To set it up

  1. Download with Bazaar, using bzr branch http://code.ecchi.ca/kiddo-lightbox-gallery
  2. Make sure Lightbox is integrated into your website design if you want to use it (it works fine without it, though)
  3. Make sure that the ".thumbnails" folder can be created inside the folder where the script is called. This script will attempt to create the folder itself, if possible, but sometimes you really have to mess with folder permissions yourself.
  4. Import the script where you want to create your gallery, and call the scan_dir function, with the target folder (no "/" at the end/beginning), as many times as you need. If you don't specify the target folder, "galerie" will be used as a default.

Example code to call the gallery

Note that in the following example, I am assuming you got the code using bazaar and left it in its own kiddo-lightbox-gallery/ subdirectory. In this example, I have three subfolders that I want to show, nested 2 levels deep. At the end, I also show the contents of the default folder ("galerie").

code sample

To update it

Simply go in the kiddo-lightbox-gallery/ folder and run bzr pull (or bzr merge if you did changes that you committed using bzr commit).

License and contact information

Kiddo's Lightbox Gallery is Free and Open Source software by Jean-Fran├žois Fortin Tam, distributed under the GNU GPL v3 license.

You can find contact information on my home page.