ReturnPhotoLyzer
A simple but powerful photo gallery application for the web

PhotoLyzer is a web application for viewing and writing captions for photos. It is simple to use and install, has support for multi-language text. The philosophy behind the development of PhotoLyzer is to make it as easy as possible to publish images on the internet.

PhotoLyzer works through the use of 3 web pages. The Thumbnails Page, the View Image Page, and the Edit Page. Descriptions and screenshots of these pages are presented below.

View an actual on-line gallery of pictures taken on a recent scuba diving trip

Download the latest version (v1.9)

 
Features
  • Entirely written in a self-contained single perl script, easy to modify.
  • Easy installation.
  • The size and quality of full size images and thumbnails are configurable, without affecting your original images.
  • No database required to use (yes, this is a feature, not a bug)
  • Multilanguage support, all UTF-8 encoded languages supported
  • Image captions can be written in multiple languages, but only the current active language is displayed.

Thumbnails Page
Thumbnail PageThis is the what you see when you first view a PhotoLyzer online gallery. All the images are presented as small thumbnails with text captions. At the top of the page is a description of the gallery, and at the bottom is a place where you can enter your password to edit the page. Clicking on a thumbnail brings up the View Image page.
View Image Page
View Image PageA full size image is displayed when you click on a thumbnail. The top of the page shows the gallery description, and the caption for this image. The thumbnails of the next and previous images are displayed, clicking on either allows you to navigate through the images from the View Image page.
Edit Page
Edit PageThis is the configuration page, which you access by entering your administration password into the Thumbnails Page. From here you can configure the size and quality of both the thumbnails and full size images, amongst many other options. Lower in the page (not shown in the screenshot) is the equivalent of the Edit Text page shown in the screenshot below.
Edit Text Page
Edit TextSimilar to the Edit Page, but only allows you to change the image caption text and the page description. To access this page, enter the Edit Text password from the Thumbnails page. This page is intended to be used by 'regular people' (as opposed to you) who simply want to have fun annotating their online image gallery. The page shown in this screenshot has been configured to support 2 languages.


Installation
Installation pre-requisites

You must install a number of software packages in order to use PhotoLyzer. All of the prerequisites necessary to use PhotoLyzer are available with any modern Linux distribution (and probably any of the *BSDs as well). You will need to setup a web server that allows for CGI script execution, and you will need to install a small list of perl modules.

  • Apache: any web server will work, but it has only been tested with Apache v2.0.
  • Perl: use v5.8.0 or higher. Using a lower version of Perl will work, but you will not be able to support multiple languages. Do not question, just install a recent Perl...
  • Perl Modules: a number of perl modules are necessary, these shuld all be available from your Linux Distribution CD. You can also install them from CPAN (follow the links). To test your installation for these installed perl modules, run the PhotoLyzer script from the command line using the '--check' option.
    • CGI: allows for the web pages to be generated. Tested and works with v2.81 and v3.0, but any recent version will probably work.
    • Image::Magick: handles the image manipulations. Tested and works with v5.5.6, but any version will probably work.
    • Locale::gettext: handles multi-language support. Tested and works with v1.01, but any version will probably work.
    • XML::Parser: handles the XML configuration file. Tested and works with v2.31, but any version will probably work.
    • XML::Dumper: handles the XML configuration file. Tested and works with v0.4 and v0.71. Any version greater than 0.71 will probably work. However, do not use any versions between 0.4 and 0.71, as there is a compatibility problem.
Apache SetupYou must setup your web server somewhat to use this script. There is more than one way to do this, below I describe one method.
  • Set "DocumentRoot /web/htdocs" (obviously, use whatever the hell you want).
  • The directive must have ExecCGI set. for example: "Options Indexes FollowSymLinks ExecCGI"
  • "AddHandler cgi-script .cgi" must exist somewhere
  • Add "index.cgi" to the DirectoryIndex directive, this allows the index.cgi script to be loaded by simply entering the directory name. for example:

License

This program is distributed under the terms of the GNU General Public License. See: http://www.gnu.org/licenses/gpl.txt
Copyright © 2003 Jon Lapham HOWTO (this script and images):
  1. Copy the images you want to view into a subdirectory under your apache DocumentRoot. Let's use "/web/htdocs/shit" as an example.
  2. Enter this new directory, and make a symbolic link to the photolyzer script. "ln -s ../WHEREEVER/photolyzer-1.6.cgi index.cgi". Notice that the sym link is named "index.cgi".
  3. Set the executable permissions for this link "chmod a+x index.cgi".
  4. Set the permissions for the directory "chmod o+rwx /web/htdocs/shit", this is necessary b/c the httpd deamon needs to be able to write in the directory.
  5. Fire up mozilla, and go to "http://SERVERNAME/shit/index.cgi" from here, you can set the passwords and set the size and resolution of the images.

All original image files exist in the root directory, along with this script and a autogenerated configuration file (config.xml).
All modified images (resized, thumbnails, etc) exist in the "imgs/" subdirectory

INBAAAPBIIWTAWIWIWBTFAQ

(I've Never Been Asked Anything About PhotoLyzer, But If I Was, These Are What I Would Imagine Would Be The Frequently Asked Questions):

Q) What does the "quality" setting for images mean?
A) That refers to the amount of JPEG compression to allow. A quality setting of 100 means no compression, which gives the nicest looking image but the size of the image will be large. I find that a quality setting of 75 gives images that look (to my eye) identical to quality setting of 100, but which are much, much smaller. For example, I have a fairly complex 800x600 image which is 166 KB at quality 100 and 69 KB at quality 75. The two images look identical to me. I recommend you use a maximum quality of 75.

Q) Is there an easy way to change the default values of some parameters?
A) Yes, edit the %defaults hash.

Q) Why don't you re-write this is python|java|C|FORTRAN|lisp?
A) Bite me

Q) But, I thought that Perl sucks, isn't that true?
A) See previous answer

TODO

1) Deal with HUGE numbers of pictures by splitting into pages.
2) Make the stylesheets work in a way that does not require you to edit this file to add new classes.

CHANGELOG

  v1.7 (Feb 04, 2004)
       * Require XML::Dumper v0.4 or v0.71 (or greater).  There was an 
         incompatibilty in versions between 0.4 and 0.71.
       * Changed the appearance of the configure page
       * Added a link to the photolyzer web page 
  v1.6 (Jan 12, 2004)
       * Bug fix: do nt use undefined variable config{'thumb_timestamp'} in 
         edit_config_text().  Well, rather, look to see if it is defined before 
         using it.
  v1.5 (Dec 20, 2003)
       * Convert to internal and external UTF-8 encoding for exerything.
       * Look for undefined hash values, and convert them to '', fixes stupid
         bug in XML::Parser.
       * the show_thumbs and show_image gallery descriptions area floating table,
         now short descriptions will be page-centered.
       * added a black border to the current image in show_images
       * added 'title' tags to the images in the show_images and show_thumbs pages
       * added 'alt' tags to the images in the show_images page
       * Split the edit_config subroutine into edit_config_admin and 
         edit_config_text for ease of use
       * Added multi-language support, using the web-page-o-matic (WPOM)
         cookie framework
       * Added a "pttext" class to the stylesheet.
       * Added "width='95%'" to the main image thumbnail table in show_thumbs.
  v1.4 (Jan. 31, 2003)
       * The config.xml file should be world writable... so the local user can
         hand-edit the file if necessary
       * The admin should be able to edit the "original image location"
       * Moved the "reset images" button to the bottom of the page, so you
         don't accidentally click on it when saving changes.
       * Allow for new images to be dealt with if copied into the original image 
         directory *after* the initial configuration.
  v1.3 (Jan. 27, 2003)
       * Stand Alone mode!!  Woohoo!  "./index.cgi --sa"
  v1.2 (Jan. 27, 2003)
       * New documentation feature: INBAAAPBIIWTAWIWIWBTFAQ woohoo!
       * "text only" edit should not make the "reset config and images" 
         button available.
       * You can specify the "image location" to use images from directories
         other than where the script is located
       * You can change the background color.
       * Images will not be "grown" to maximum size if the original
         images are less than the maximum image size.
       * Oops, the password fields were not hidden in the config page.
  v1.1 (Jan. 24, 2003)
       * Set the 'width', 'height', and 'alt' correctly for the thumbnails, 
         this should make the page appear to render faster over slow 
         internet connections.
       * Added the "display image name" and "display image size" parameters.
  v1   (Jan. 20, 2003)
       * It works.

Valid HTML 4.01!