EGallery – Automatic PHP Image Galleries
Delivering images to clients or models has always been a hassle, requiring me to either use another web service or asking clients to right click and save images from a list of files (how boring!). I was tired of explaining the difficult download process and wanted to come up with an easier method that is both simple for me and for clients downloading the images. That’s why I spent some time writing my own PHP script that will generate an image gallery automatically from any directory filled with images.
Presenting EGalleryEGallery (“E” for Eric) is a free PHP script that generates an image gallery automatically. Once you have a directory of image files, just upload the EGallery files to that same directory and “POW!” you have yourself a full-fledged image gallery. Thumbnails are automatically processed and cached and link to an original resolution copy of your images, which users are prompted to save to their computer. Want to see it in action? Follow this link for a demo.
Click on the button to the right to download Egallery.
InstallationSince EGallery does NOT use a database, the installation process is very easy. Follow these few basic steps to install EGallery on your PHP-enabled website in just seconds:
- Upload images to a new directory on your web server. For example: YOUR-WEBSITE.COM/sample/
- Upload the /egallery/ directory to the same subdirectory that you just created on step 1. Example: YOUR-WEBSITE.COM/sample/egallery/
- CHMOD the /egallery/cache/ directory as well as the contained index.html file to 777.
- Upload the index.php file included with the download package to the directory you created on step 1.
TroubleshootingQ. Why don’t I see thumbnails? A. First, make sure that you have the correct write permissions. Set the CHMOD value to 777 for the cache directory and the index.html file within it. Another possible cause may be that the images are so large that they are using up your server’s memory. You may have to temporarily change your php.ini file settings to increase the memory limit. If you can get it as high as 128MB then you should be good to go. You can also try changing the MEMORY_LIMIT value in the thumb.php file. Q. The image upload page shows a success message, but why don’t I don’t see new files? A. If your image gallery directory (where the images are stored) is not set to CHMOD 777, then the upload script won’t have permissions to write the uploaded images to that folder. Change the permissions to CHMOD 777 for the gallery folder and then try re-uploading the images. Q. I set the permissions, so why can’t I still see thumbnail images? A. View the page source code to get the the URL for the image thumbnail, then navigate to that URL. If you see an error like “Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)…”, then continue reading. You will see an error like this when your server is not able to allocate enough memory to process the thumbnail images. If you are able to edit your server’s memory limit, you should try adjusting it from the php.ini file (Google for more info). From Cpanel’s WHM page you can edit the memory_limit from the PHP Configuration Editor page. My suggestion is to temporarily increase the limit to a high number, like 128M, then reset it to normal after you have generated thumbnails. Q. I changed the password, but now I can’t login! A. If you were previously logged with another password the script has trouble overwriting the previous password cookie. Clear your browser cookies, then try logging in again.
- Version 1.0
- Initial release
- Version 1.1
- Added Upload feature(visit /egallery/upload.php)
- Added Download all files as .zip feature
- Misc bug fixes and updates
- Version 1.2
- Altered the style
- Added option to display image EXIF details