|In this README:|
DISTRIBUTION / LICENSE
HOW TO USE
1. web server (tested on apache Linux/Unix but reported to work on Windows NT/2000) 2. Perl 5.00503 (may work with others) 3. ImageMagick (with PerlMagick) 5.2.2 4. Image::Info and IO::String (to get EXIF data stored in the images by digital cameras).
NOTE: if you do not have root access to install these perl modules, just follow the easy instructions in README.IMAGEMAGICK to install them locally.
My Photo Gallery is a Web-based photo gallery with support for other filetypes. It is easy to setup and even easier to maintain. Slick-looking image/file galleries and thumbnails are generated on the fly from the directory that you specify. Creating an album is as easy as creating a directory and FTPing your pictures to that directory. A Web administration interface is available, and updating is just as easy. It also includes advanced features such as image logging, resizing, rotating (lossless), extracting EXIF data from digital cameras, and visitor comments. Many other file formats are recognized and given a special icon.
Automatic creation of photo,movie, and file galleries Web based upload and gallery manager Automatic unzip'ing of uploaded .zip files (requires 'unzip' to be installed and in your path)
Uses a template.html file to quickly make everything match your current site Simply ftp your stuff or use the web based manager Pretty file name option (in config file) Automatic thumbnail generation Automatic creation of various sizes of each image so that your visitors can specify the viewing size of their preference. Logging for each time a picture or album is viewed. Visitors can comment on each picture. Shutterfly.com support to allow your visitors to order prints. Manage your photo galleries from the web. Previous/next picture buttons with thumbnail preview Automatic extraction of EXIF data embedded from most digital cameras Easyily themable with your custom colors, logo, and main page Configurable filetype support to support any filetype for download Upload, rotate (lossless), rename, or delete images using the web manager interface password protect directories using a lock file of user/pass's replace :-) (and about every other derivation) with a picture of a smiley I am sure there is more that I cannot think of.
|DISTRIBUTION / LICENSE|
This software is released under the GPL. Please see the included LICENSE file. Copyright (C) 2000 Michael Spiceland This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Use this script at your own risk! I make no warranties that it is hack proof!
IMPORTANT: You must have the perl modules listed in the requirements section before this script will work. Even if you do not have root access, you can install them locally using the instructions in docs/README.IMAGEMAGICK. Read the doc/FAQ.html or Intro to CGI at http://fuzzymonkey.net/perl/ to easily troubleshoot it.
1. Install scriptsThis script will need three directories. One is for the cgi scripts, one is for the main source images that you want a gallery of, and the third is a data directory to store the thumbnails, resized images, comments, and descriptions. By using a separate directory for the data, your original photos are left untouched. The original photos are only read, never written to (unless you are renaming or rotating the image).2. Configure My Photo Gallery
Here is what I use:
/home/username/www/cgi-bin/photo/ (to store all the script stuff)
/home/username/www/photo/ (to store all of the images for display)
/home/username/www/photodata/ (to store thumbs and other data)
For example, this is what I do:
ftp myphotogallery.tar.gz into my www/cgi-bin/
tar -zxvpf myphotogaller.tar.gz
mkdir /home/username/www/photo (to be the main directory for the galleries)
mkdir /home/username/www/photodata (to be the data directory for the galleries)
mv site-images/ /home/username/www/photodata/
One of the most common issues when installing "My Photo Galley" has to do with permissions. The web interface in the next step will point you at how to use the manage.cgi script to check some of the most common errors. If this doesn't work or you get an internal server error when you attempt to run the manage script, please check the docs/FAQ.html included in the package.
Using the web interface
If you followed the instructions above, you can use the manage.cgi script to check for all of the requirements and set up all of your variables. Simply point your browser at:
Using the web interface you can:
verify you have the dependancies installed set-up and configure your configuration/variables manage/edit photo galleries find out more information on included too
If manage.cgi has problems finding your local Image::Magick install then you may need to use a use lib line at the top of the index.cgi and manage.cgi script. More details are below in the manual section.
Editing the config file manually
3. Create your photo galleries
Edit sitevariales.pl (in the cgi-bin/photo/ directory) to suit your needs. You will need to make sure the directories chosen in the two above steps are in this file correctly.
If you had to install Image Magick with NON-root permissions (the work around described in the README.IMAGEMAGICK) make sure you add the use lib ""; line to both index.cgi and protected/manage.cgi. I use the following two lines at the top of both scripts:
use lib "/home/username/www/cgi-bin/local/lib/site_perl/5.6.0/i686-linux/"; #ImageMagick
use lib "/home/username/www/cgi-bin/local/lib/site_perl/"; #Image::Info and IO::String
You can easily change the entire look of your galleries. There are a few basic ways to change the look:
modify the colors in sitevariables.pl upload a new logo to site-images/ and specify it in sitevariables.pl upload new buttons and images by simply replacing the old ones in site-images/ update the news.html (your frontpage of the gallery) to look as you want.
Setting up your galleries
Use the manage.cgi script to upload your photos and .zip files. Alternatively, you can keep reading for information on how to manage your galleries manually.
Now you need to mv or upload your pictures into directories under the directory created in the step above. For example, if you use the directory mentioned above you could make a directory /var/www/html/photo/florida2000/ and then put all the pictures from the florida trip in that directory. You can make as many of these directories as you like. I will from now on call these "albums".4. SECURE YOUR MANAGER.CGI OR DELETE IT !!!!!
Password protecting your galleries
If you want to password protect a directory, you will need to manually put in a lock file. This file should be named 'lock' and be placed in the directory that you would like to password protect. It should contain the username and passwords for any users that you want to give access to, one per line with username=password. For example, if you want henry to have access using the password 'oranges' you would put
in the file 'lock' that is in the directory that you want to deny access for. Please be carefull using this feature as it is not gauranteed to prevent access although it is secure enough for almost all uses.IMPORTANT: You should use htaccess or some other method of password protecting the protected/ directory. If you not know how to do this, please ask your server administrator to password protect this directory for you. If you choose not to do this PLEASE remove this directory. manage.cgi is a script that you can use to manage your photo galleries. It is not secure enough to allow public access to it. Many accounts have a web interface that will allow you to do this. IF YOU CHOOSE TO LEAVE THE MANAGER.CGI ON YOUR SERVER, PLEASE DO SO AT YOUR OWN RISK AND MAKE SURE IT IS PASSWORD PROTECTED.5. Your done!
Thanks to Michael Phan for sending this link to a good tutorial on .htacces.Fire up your browser and point it at the index.cgi script. Good Luck! Email me if you use it!
|HOW TO USE|
Just point your browser at it
If you get an internal server error, run it from command line so that you can see what is going wrong. See my docs/FAQ.html on my script page for more info.
You may also use the web based administration (if installed) by pointing your browser at: http://www.yoursite.com/cgi-bin/photo/protected/manage.cgi
11.23.2000 Initial release.
11.28.2000 Added commenting section and a few new settings in sitevariables.pl Added a few more images to site images. Fixed back button to work even after comments.
11.28.2000 Fixed space in filename issue (hopefully) there were many bugs here to squash. Changed location of descriptions to descriptions/ sub directory under the album. This is more organized.
11.29.200 MAJOR changes. Added manager.cgi in protected/ and all of its features Added shutterfly.com support. Added many new variables in sitevariables.pl Added wrapping if the number of albums goes over the albums per row variable.
12.03.2000 fixed bug when reporting the height to shutterfly. fixed a few bugs and enhanced security in manage.cgi (I still think manage.cgi should be as proetected as you can make it in order to be safe)
12.08.2000 Changed to version 1.4. Added prev/next links and thumbails for prev/next. Added width tag on preview images. Changed image to a border table with rows. Removed the exact timestamp from the images.
12.19.2000 Changed to version 1.5. A few asthetic changes including a smaller date on each file in the album. Added check for empty directory name. Moved the directorycheck() sub to common.pl so that I could add it to the manage.cgi. manage.cgi now also creates thumbnails that were unavailable before. Added README.IMAGEMAGICK
12.30.2000 Added a link to the index.cgi to the manage.cgi. Added maxWidth viewing option for visitors. Added a cookie to store the users viewing preference. Changed background color and updated corner pictures.
1.10.2001 Major update to appearance. Added search.
1.28.2001 Version 1.8 Added support for movies. Still need to fix comments for movies.
5.27.2001 Version 1.9 Added email option for commenting. Fixed movie commenting.
6.11.2001 Version 1.95 Fixed issue where pictures with caps extention (.JPG) would not show up.
7.17.2001 Version 2.0 Added subfolder support. Also updated the manager to support subfolders. Changed the sorting of the folders. Using ping now to get the resolution of the images instead of having to open the image first (much faster).
7.22.2001 Version 2.01 Fixed the picture size returned from the 5.3.6 version of image magcik when using the ping command. Added a new variable called $old_imagemagick to sitevariables to specify which image magick you have installed.7.22.2001
8.2.2001 version 2.02. New images for folders, buttons, arrows, etc. Added comments to teh colors section of the setup to make it easier to see what you are changing. Made the text color variable actually work and change the color of the text in the menues.
8.4.2001 version 2.5. Complete overhaul of the way the script works. Re-wrote the album display routine. Better support for any filetype. You can now register filetypes using the %filetype hash in the sitevariables.pl file. Also re-did the standard images used for buttons,logos, etc. Also a complete overhaul of the manager script! Added support for Image::Info to get the EXIF data stored by digital cameras.
8.10.2001 version 2.6. Major security fix! Now it dies if someone puts .. in the album name they want to view! Fixed deleteing a picture to delete the picture and all different sizes of it (manage.cgi). Fixed problem with spaces in image names for older netscapes. Added alpha watermarking code.
6.12.2002 version 3.1. Major updates: My Photo Gallery is now much more customizable thanks to the use of a template file. Using this file, the photo gallery is generated inside an html page at the point where you specify. This makes it really quick and easy to make the photo gallery match the current site. added a smaller viewing option for all pictures of 320 pixels in width. Took off the main menu on the right side. Added option to turn off the shadows around each picture. New png images for directories to allow for any color background that you wish. Added password protection for any dictory where you want to require a username and password. No longer using Image Magick's ping function to prevent incompatablities between versions.
3.6.2003 version 3.2 Major updates: Complete re-write of the manage.cgi script. Users can now easily update the config file through this web based interface. New manage.cgi now acts in batch mode, allowing an entire directory to be processed at a time with description editing, rotation, deletion, and more. Automatic unzipping of uploaded files when using manage.cgi. New version fixed many bugs. Main index.cgi has many cosmetic changes. Picture table now tightly holds all generated information in a smaller table, buttons accross the top have been streamlined. Package now includes a command line script (createfiles.pl) that is capable of doing all of the processing ahead of time for the script instead of waiting to do this dynamically.
8.24.2003 version 3.4
Fixed a bug that caused the manage.cgi script and index.cgi script to create different thumbnails that prevented rotation, etc.
Fixed a bug that required the username and password to be entered twice to gain access to password protected folders. This was due to the script ignoring the value passed by the form and only looking at the cookie.
Fixed a bug allowing access when the username and password fields were left blank in certain conditions.
Fixed a bug in the createfiles.pl script that ignored directories containing spaces. This was due to the glob() function needing the spaces to be escaped.
Fixed a bug that didn't show the "order this photo" button for shutterfly support.
09.07.2003 (version 3.5)
10.19.2003 version 3.6
major security flaw fixed. Rotating images now is completely lossless (meaning absolutely no loss in quality) by optionally allowing jpegtran to handle the rotations instead of Image Magick. Option to replace :-) and the like with small images of smilies. Bug fixes in EXIF data for Shutterspeeds longer than one second and some irreported focal lengths. Fixed bug that ignored the config option to overlay the magnifying glass over the thumbnails. Fixed a bug with the calculations for focal lengths (please let us know if it is reporting incorrect values for your camera).
11.01.2003 version 3.7
Management script can now be used to move pictures around while safely moving the data files as well. Using the management script, all of the data files including various resizes, comments, descriptions, etc will be moved along with the picture. When watermarking is enabled, uploaded images are now automatically watermarked. Added option to remove leading numbers from filenames when displayed. Added option to specify the quality level for resized images. The EXIF data from some cameras included the "Make" in the "Make" and the "Model" causing duplicate words. This is now detected and prevented. Updated License note at the top of imagemagick.pl. New lines now show up correctly for album descriptions (replacing \n with <br>).
11.01.2003 version 3.8
Security fix (update strongly suggested). Listing of files now lists directories first before photos and other files. ClubPhoto.com support added. When enabled, you visitors can now order prints of your pictures from either ClubPhoto.com or ShutterFly.com. A small image appears next to each thumbnail when comments are available. When the user hovers over this icon it informs them that comments are available.
4.4.2004 version 3.9
Pictures can now be selected to appear to be overlayed ontop of the folder picture. Images to be used for folders can now be graphically selected using the web based manage script. Changed logging functionality to speed up page loads with lots of folders. Fixed a bug that prohibited uploading of non-image files with the manage script. Fixed a bug deleting non-image files from the root picture directory with the manage script.
6.3.2004 version 4.0
Thanks to many people for this release including Scott Allen, Neil Hooey, Matthew Ball, Chuck Brady, and others. Most of these bugs were reported and or fixed by users. Scott provided a re-written EXIF subroutine that is much smarter than before. Only present elements are displayed and if they are not any found the entire EXIF data table is not displayed. Fixed bug in using jpegtran with pictures with spaces. Users can specify how many thumbnails are generated per page and page numbers are assigned. A bug was fixed with Windows servers paths for the config file. EXIF data and embedded thumbnails are no longer stored in thumbnails or resized images to save space. Various bugs fixed.
10.04.2004 version 4.01
Fixed problem with pagination in main directory. Now works just as smoothly as subdirectories.
I need to do/need help with the following itemsSend questions or comments to email@example.com
1. disable right click to save with java script (I now have an example, just need to integrate it). 2. fix shutterspeed bug with shutterspeeds over 1 sec. 3. allow the creation of the username and password lock files via the manage.cgi script.