Web Album Generator
The goal of this software is to serve as a simple drop-in image gallery script. The following describes the intended functionality in more detail.
When placed in a folder, it will render a web page with all the images and videos in the folder. All subfolders will be rendered as sub-albums.
The script does not require anything besides PHP5 with the GD extension. Furthermore, the script will not make any modifications to the content of the folder where it is placed. In fact, it does not require write access at all.
The supported image formats are JPEG, PNG and GIF. The supported video formats are WEBM, MP4, and M4V. The script is not capable of extracting thumbnails from video files.
Note: This scripts generates all web pages, thumbnails, etc. on the go for every separate site access. Thus, the script is not suitable for sites with a high volume of traffic or with an exceptionally large collection of images.
The captions of the albums will be retrieved from the folder names. The captions of the images and videos will be retrieved from the file names unless an image has IPTC metadata and the "Caption" field in the metadata is not empty. In such a case, the IPTC "Caption" field will be used for the image caption.
The albums, images and videos will be sorted according to the folder/file names.
If images have to be sorted differently, it is necessary to rename the files
accordingly. For example, to sort by capture date, you can use the exiftool to
rename the image files:
exiftool "-FileName<CreateDate" *
If there are multiple videos with the same file name (e.g., "video.webm" and "video.mp4"), then these files will be considered as alternative encodings of the same video. If there is an images with the same file name as a video (e.g., "video.jpg" and "video.mp4"), then the image will be considered as a snapshot/preview of the video and will be used to generate a thumbnail for the video. Also, the metadata from the image file will be used for the video. For example, the IPTC "Caption" field of the image file will be used as the caption for the video.
If the content of a folder should be protected from public access via the script, you can place a file called "password.txt" in the folder. Then, the script will request the password contained in the file to access the album content. The same password will apply to all subfolders unless a subfolder contains another "password.txt" file with a different password. A "password.txt" file can contain multiple lines with alternative passwords. An empty "password.txt" file will reset the folder and subfolders for public access. The protection described here will work only when accessing the content via the gallery script and will have no effect on direct access to the content.
After entering the password, the URL for a protected folder will contain a "key=..." portion. Such a URL can be sent to others to view the protected content without requiring password entry.
Note: The pasword protection scheme offered by this script is not secure and must not be used to protect very sensitive material. Once a URL with the "key=..." portion is known to others, it is possible to recover the password used to access the content. Furthermore, the protection scheme works only when using the script; it does not block access of the content through direct URLs. It should be considered only in conjunction with other access restriction schemes, such as .htaccess files:
<files wag.php> allow from all </files> order allow,deny deny from all
- Web Album Generator v.2 - 2014-09-21
Copyright (c) 2014, Lenko Grigorov All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.