If you have your own hosted environment, you can use any number of server-side applications to display your photos. Two of the more popular photo gallery software applications are Gallery and Coppermine, both written in PHP, and both capable of working in most systems. In addition, several content management systems, such as WordPress and Drupal, also have photo uploading and management capability built in, either for adding photos to posts or for creating an entire gallery.
The grand poobah of server-side photo software, though, is Gallery. It's always been a powerful piece of software, but not always the easiest application to set up. Even now, with simple steps to follow, you still need to set up a database first and be able to modify directories and files. Most of the instructions are from the command line, but you can install Gallery using FTP.
At the time of this writing, there are three different versions of the Gallery application: Gallery 1, Gallery 2 (which I cover in this section), and Gallery Remote for client-side photo posting. For a brand-new installation, you're going to want to install Gallery 2.
Tip
Download Gallery at http://gallery.menalto.com. If you're not sure about the requirements for running Gallery, contact your hosting company and ask whether you can run Gallery on your site.
The application checks to make sure the required technology is present, but you'll need to create the database first. Most hosting sites provide database functionality, including database creation wizards, which handle all the tech required. The MySQL installation is the default install and doesn't require any additional modules.
What are the Gallery requirements?
Unix or Windows
A web server, such as Apache or IIS
PHP (version 5 required after February 2008)
Some image processing library (most sites have ImageMagick and/or GD installed)
A database, such as the aforementioned MySQL, or PostgreSQL, Oracle, or SQL Server
Gallery runs well in both Windows and Unix environments, but most hosting companies run Linux (Unix). All but the cheapest hosting sites support all the other requirements.
Warning
If your hosting company provides a site management package, there's a good chance Gallery is provided as a push-button installation. Check with the company before installing it manually.
During the installation process, you'll be given options as to which plug-ins to install. The list is lengthy, but many have to do with migration from Gallery 1, camera-specific options, integration with third-party tools, and so on. Go through the list carefully, and be conservative with what you install—you can activate or deactivate modules at a later time.
You can create multiple albums with Gallery, each with its own title, description, subdirectory, keywords, and other data. Each can be given its own layout and use a different predefined theme. Figure 4-34 shows part of the Theme configuration page in the Gallery Administration pages.
Gallery is one of the most configurable applications I know of, which is good and bad. Unless you're into development, you might want to start with design themes and get into the more advanced modification facilities only when you're familiar with the application.
You can access new themes at http://codex.gallery2.org/Gallery2:Themes. Browse through the many options, and once you've found the theme you like, install it via your own Gallery Site Admin pages through the Gallery → Plugins option. The installation is automatic, and once the new theme is installed you can activate it for any album. Also, once you become familiar with the tool and the templates, you can create your own design.
There's a variety of ways to add photos to a Gallery Album. The simplest is through the web browser directly to the site. You can upload one or more photos at the same time, and add both titles and descriptions. If the template includes the option, any metadata attached to the photo also gets parsed out when the photo is uploaded.
There are several client-based applications that can also be used to upload photos, including a Java application, a webcam connection, through Google's Picasa export file, via Windows XP functionality, and through an upload directory if photos are already uploaded to your site.
This latter option is nice if you've been uploading photos through a weblog or other content management tool. I used it when writing this book to add figures that I uploaded to a special directory for my tech reviewers. Once I specified the directory, it then listed each photo with a checkbox next to it. Clicking on any of the boxes uploaded the photo, as shown in Figure 4-35. You can use a symbolic link (symlink) to make it seem as if the photo is coming directly from the Gallery rather than the separate folder. This ended up being a nice way to peruse the figures from this book during the editing process.
One of the advantages of using the local server option is that it's faster to upload photos in batch using an FTP tool. The disadvantage, though, is that you can't give titles and descriptions for each item. You can, however, edit these for each item after they're loaded.
Get Painting the Web now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.