##############################################################################
# Picture.cgi                     Version 1.5                                #
# Copyright 2001  Glenn Dempsey   webmaster@clovenfoot.com                   #
# Created 08/09/01                Last Modified 12/17/01                     #
# Cloven Foot:                    http://clovenfoot.com                      #
##############################################################################
# COPYRIGHT NOTICE                                                           #
# Copyright 2001  Glenn Dempsey   All Rights Reserved.                       #
#                                                                            #
# Picture.cgi may be used and modified free of charge by anyone so long as   #
# this copyright notice and the comments above remain intact.  By using this #
# code you agree to indemnify Glenn Dempsey from any liability that          #
# might arise from its use.                                                  #
#                                                                            #
# Selling the code for this program without prior written consent is         #
# expressly forbidden.  In other words, please ask first before you try and  #
# make money off of my program.                                              #
#                                                                            #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium.	In all cases copyright and header must remain intact #
##############################################################################

Thanks for downloading picture.cgi

Report bugs to:  picture-bugs@clovenfoot.com

I will attempt to walk you through the steps of installation.

1.  Unpack the picture.zip file.  (If you are using WinZip, be sure to "Extract" the files instead
    of just highlighting and copying them.  The reason for this is that if you "Extract" the files,
    the directory structure they are in will be preserved - note the directory structure in step 2.)

2.  There should be a total of 8 files included in the package:

	a. cgi-bin/picture.cgi -- the script that runs everything.
	b. cgi-bin/config.pl -- the configuration file for picture.cgi
	c. graphics/picture.html -- the page that appears if a user clicks on an image.
	d. graphics/picturegallery/000001-Kickin'_It.jpg -- image 1
	e. graphics/picturegallery/000002-Homer's_Brain.jpg -- image 2
	f. graphics/picturegallery/thumbs/000001-Kickin'_It.jpg -- thumbnail for image 1
	g. graphics/picturegallery/thumbs/000002-Homer's_Brain.jpg -- thumbnail for image 2
	h. README.txt -- the file you are looking at now!

    I tried to mimic what the directory structure should look like once you've installed the 
    script, but the final outcome of your directory structure may look much different depending
    on how you choose to install.

3.  Modify the config.pl file.  I have included instructions for changing the variables within
    the file itself.

4.  Change the shebang (the first line) in the picture.cgi file to where ever Perl is located on
    your server.  The most common locations are:
    #!/usr/bin/perl
    #!/usr/local/bin/perl
    
5.  Put both the picture.cgi and config.pl files in your cgi-bin.  They must be in the same folder!
    CHMOD picture.cgi to 755
    CHMOD config.pl to 644

6.  Place the picture.html file into your graphics directory.  If you don't have a graphics
    directory, you should create one.  Name it whatever you want (i.e. images, graphics, pics, etc.)
    You will need this location when you modify the config.pl file.  

7.  Create a folder called "picturegallery" inside of your graphics directory.  Be sure to CHMOD
    your "picturegallery" folder to 711 -- that seems to work best and be most secure for the
    picture.cgi script.  Place image 1 (000001-Kickin'_It.jpg) and image 2 (000002-Homer's_Brain.jpg)
    into the "picturegallery" directory (you can delete them later, but for testing purposes,
    let's go through the steps).
    
8.  Create a folder inside of the "picturegallery" folder and name it "thumbs".  CHMOD that folder
    to 711 also.  (Note: you can name this folder whatever you want, I am just giving you
    suggestions, and trying to simplify the installation process.)  Place the thumbnail for image 1
    and image 2 into the "thumbs" directory.
    
9.  I have given you two sample images along with their thumbnails (Note: thumbs use the same
    exact name as their parent file).  Please note their naming convention.  It is very important
    that you follow the way they have been named, otherwise the cgi with either not work at all,
    or work and not display the image correctly.  Let's examine one filename:
    
    000001-Kickin'_It.jpg
    
    a. The first portion is a number:  000001
       Your first image will have the number 000001.  All subsequent images will increment this
       number by 1.  Picture.cgi sorts your images in reverse order, so the first image you created
       will appear on the last page.  Reason for this is most people want the newer images they created
       to appear first.  I may, in the future, have different sorting options, such as by file date or
       alphabetical sorting.
       
    b. The second part, after the dash, is:  Kickin'_It
       This is the title of your image.  This will show up in the ALT tag for each image
       displayed.  Underscores represent a space. Although you can probably use most symbols
       such as !,@,#,$,%,&, or anything else, please note that these symbols may break the script.
       Use them with caution, and if you keep getting an internal server error, you may want
       to check the names of your image files before anything else.
       
    c. Third part:  .jpg
       This should be obvious, but I wanted to say a couple things about it.  In the config.pl file
       you are given a variable with a value of two media types.  You can change this so that you
       only use JPEGs, or only GIFs.  Or you can add a media type -- it is entirely up to you.
       
10. The way to execute your new picture gallery is simple:
    http://www.yourserver.com/cgi-bin/picture.cgi


This script has been tested for Perl 5 and above.  It will probably work for versions lower, but I
guarantee nothing.  I am only an intermediate Perl programmer, so if you find parts of the script
that can be optimized, feel free to do so, and email me a copy of what you did so I can learn from
it.  Don't email complaining about the script not working unless you have exhausted your efforts
and are convinced that there is a bug in my code.

This is my contribution of the Perl community; I have taken so much, but have given so little.
I look forward to creating more useful scripts for all you webmasters!