$Id$ AutoGallery, version 2.2. (c) 1998 Retina Communications Group by John Adams URL: http://www.retina.net/~jna/gallery Main Distribution: ftp://retina.net/pub/gallery/autogallery-current.tar.gz Introduction Ever have hundreds of pictures that you want to put on your web site, because you have such an amazing collection of pictures you've got to make everyone see them too? I do. Sure, there's the common route of hand-coding HTML and going through the entire process, but everytime you change an image you've got to re-edit the HTML and (possibly) modify a complex layout. Autogallery builds an index of pictures with captions, thumbnails, multiple section support, tables, and a complete search engine for searching against your gallery. It's display engine automatically supplies WIDTH and HEIGHT tags for proper image display, eliminating the need to copy this information into your documents by hand. License autogallery is relased to the public domain under the GNU public license, with the following caveats: You MAY NOT use this software in a commercial application or commercial web site without prior permission from the author. This software is email-ware. If you use it, send me some mail with the URL you've used it on. :) Portions of Autogallery are derived from the source of wwwis (for image sizing) and CGI.pm by Lincon Stein. Requirements * You must be able to run CGI scripts at your ISP that end in .cgi (of course, if you own the web server, it doesn't matter much.) * Perl 5.003 or better * CGI.pm (included in this distribution) * That all your images are .jpg. Sorry, it's too much code at this point to support multiple formats, and you should be using .jpg at this point in time anyway for images. It's smaller. Installation: 1) Untar the distribution in your public_html directory. 2) Edit gallery.cfg and tools/index.cgi: * Change $ROOT to the root of your gallery (a unix pathname) example: /home/retina/J/jna/public_html/gallery * Change $ROOTURL to the root URL of your gallery example: http://www.retina.net/~jna/gallery Do NOT add trailing slashses to $ROOT or $ROOTURL. 3) Edit layout.pl and customize the HTML that's inside of the header and footer subroutines. Make it look like something that belongs to YOUR page, not mine. ;) Note that I use 'header.jpg' in quite a few places. You may consider creating one of these for yourself - The program will insert the image at the top of pages that it generates (with the exception that the image will not be included on the pages generated by display.cgi) 4) Edit the images that are in $ROOT/navelements/ with your favorite graphics editor to reflect your page: 2.0banner.jpg Displayed at the top of gallery pages display-header.jpg Displayed when the user clicks on an image above the requested 'full-size' image. na.gif Displayed when a thumbnail doesn't exist How to adding pictures to your gallery: 1) Edit the file named 'masterlist'. Masterlist contains all of the section page numbers and entries. Add an entry to the bottom of this file in the form: number:default image:section title The section title should not contain a colon (:), and the pages should be listed in ascending numerical order. The default image is the image that appears when a section view is requested through options=V in the query string. See index.html for an example. If you need to take a section offline later, you can do so by commenting out the line with the pound symbol (#). 2) Put the pictures in NUMBERED directories underneath $ROOT. These numbers correspond to the numbers you used when you edited 'masterlist'. Thumbnails go into the directory under a directory called (you guessed it) "Thumbnails". The filename for a thumbnail is the same as the image, with the letters '-sm' (for SMall) inserted before the extension. (i.e. foo.jpg is accompanied by Thumbnails/foo-sm.jpg) If this directory doesn't exist or if the thumbnail for a particular image doesn't exist, it's replaced with navelements/na.gif during presentation. [ Note: I use a script to build all of my thumbnails from the command line. and it saves an incredible amount of time. If you have the ImageMagick package installed, you can take advantage of my script! See $ROOT/tools/build_thumbnails for more info ] The structure of your gallery directory should now look something like: $ROOT/display.cgi $ROOT/script.cgi $ROOT/{other meaningful .cgi and .pl files from the distribution} $ROOT/1 $ROOT/1/Thumbnails $ROOT/1/Thumbnails/picture-sm.jpg $ROOT/1/descr $ROOT/1/thelist $ROOT/1/picture.jpg ... and so on ... 3) After you've copied your pictures into the directory, create a default caption file by cd'ing into the directory and typing '../tools/build_list' 4) A new file will be created, called 'thelist'. Edit this file and add descriptions for your images. Note that at the moment you can't use colons in the descriptions. I'll probably fix this at some point, though. The format of thelist file is: filename:description The order of image presentation is determined by the order that names are listed in the file. First image first, second line second, and so on. To remove an image from the list, delete the line (duh) or comment out the line by prefacing it with the pound (#) sign. If you'd like an automated way to edit this file, cd into the $ROOT directory and type tools/int-describe. int-describe generates 'thelist' files while prompting you for descriptions. I sometimes find it useful when I'm adding a large amount of files. 5) Create another file in the numbered directory, called 'descr'. descr is raw HTML to be inserted after the "Images Available" line during presentation. You might put something in the descr file that says "lots of dumb pictures of nekkid sparrows" or something. It's up to you. 6) All Done! Go try it out. open $ROOTURL/script.cgi with your browser. You should get a page with your images, description file, and captions. I'll suggest that you create an index.html page that points at the script.cgi (as I've done, see example.html and "Other Issues" below.) And remember, if it doesn't work, it's FREE software. I cannot answer questions about particular configuration issues, but I'd be glad to hear about bug reports from anyone who's having problems once the sofware is up and running. Other issues: * Sometimes people do stupid things with your site, like open your gallery directories directly. This is a hassle because they'll get the on-disk directory instead of the gallery interface, or nothing at all depending on your server configuration. The solution for this is to copy tools/index.cgi into your numbered directories. This particular index.cgi will redirect the user into the main script interface and AUTOMATICALLY bring up the list for the page they've requested. It also allows you to say things like: http://www.retina.net/~jna/gallery/21 To make people go to page 21 of the gallery without having to deal with the other form for direct page access, which is ugly and hard to remember: http://www.retina.net/~jna/gallery/script.cgi?page=21 You may also wish to create an index.html with a welcoming banner for your gallery in the top-level directory (/gallery), but you have to duplicate the FORM elements from the script to get things to work right. It's annoying and I'll probably rewrite it so that this list is auto- generated at some point. * What if I want to move an image from one gallery page to an other and move the description with it without having to do lots of edits? I've included a script for this in $ROOT/tools, called 'mover'. Have a look at it, it's extremely useful. It should be run from root, and it's syntax is: mover i.e. mover foo.jpg 1 2 Would move foo.jpg and its associated thumbnail and description from section 1 to section 2. Conclusion Best of luck with your gallery. Visit mine often when you can, and if you use the software, email me the URL so I can see your work! Enjoy! John jna@retina.net