Documentation

Quick Start Guide

  1. Download and unzip the SimpleGal package.
  2. Copy or rename the file called config-example.php to config.php and open it in your favourite text editor, editing the values to fit your own details. Be sure to edit the username and password.
  3. Upload everything to your site.
  4. That’s it!

System Requirements

Up to and including version 3.1, SimpleGal requires:

  • a PHP version greater than or equal to 4.2
  • PHP’s GD library installed

From version 3.2, SimpleGal requires:

  • a PHP version greater than or equal to 5
  • PHP’s GD library installed

Most paid webhosts have one or both of these configurations available.

Basic Usage

Albums

Albums are collections of images, held together by a common theme: you might make an album containing all your snaps from a holiday, for example, or all your landscape photographs.

Albums are simply directories within your albums directory. To create new albums, create a new directory there; to delete albums, delete the directories there.

Alternatively, you can create albums from the admin screen. Log in, then click “Admin”, then “Create album”. Type the name of the album, and it will be created for you.

To delete an album, simply delete the directory or visit the “Delete album” screen in the admin.

Adding Images

There are two ways to upload images. The first is via FTP: simply upload your images to the album directory, and then when you next view your album SimpleGal will automatically take care of thumbnail generation for you.

The second method is via the web interface; simply log in, hit “Upload Image”, and select an image from your computer.

Advanced Usage

Generating thumbs for large albums

If you have an album with many images in it, SimpleGal’s automatic thumbnail generation may baulk at it—running out of memory, for example. If you have command-line access to your site and ImageMagick installed and in your PATH, you can work around this; simply run php cli.php from the shell, and SimpleGal will use ImageMagick to generate your thumbnails and sized images for you.

Run php cli.php --help for information on how to configure the thumbnails generated.

Improving performance

SimpleGal is pretty nimble by default, but you can improve performance drastically by enabling the template cache. When enabled, SimpleGal only searches for images, parses metadata files, sorts images and does other sorts of expensive operations when it has to; otherwise, cached versions are served.

Enable the cache by setting a cache lifetime in your config.php:

define('CACHE_LIFETIME', 86400);

The lifetime is the number of seconds before cached templates are considered “stale” and regenerated. If set to 0, cache files will always be regenerated, effectively disabling the cache; if set to -1, cache files will only expire when purged. You can purge the cache manually from the administration panel, and individual cached templates are purged intelligently when you perform actions such as uploading images, updating album metadata or updating album thumbnails.