This project is a dead simple web photo gallery for displaying pictures from the file system or an FTP server. It has been tested on Windows, but with the right binaries there is no reason why it shouldn't work in other platforms.
It uses Mongoose (a lightweight, portable, cross-platform web server) and php for serving a navigable list of folder and images, with pre-generated thumbnails and fancyBox for displaying the actual pictures.
The thumbnails are generated with the help of a horribly written C# program called Thumbinate.exe (source code available here). This console app takes two directories as parameters (source and target folders) and generates 150x150 thumbnails for all the JPG pictures found, preserving the directory tree. At this stage only a Windows binary is provided and the program has to be called manually (or scheduled appropriately).
A config.ini file should be created in the root folder for configuring the gallery. The available options are enumerated below.
Option | Description | Default value |
sto_type | Source type. Accepted values at the moment are ftp (for an ftp server) or fs (for a folder in the local filesystem). | fs |
sto_basedir | The root folder of the pictures to be displayed. All the original pictures are within this folder and its subdirectories. | ./pics/gallery |
thumb_basedir | Thumbnail folder. The directory tree must be identical to the one on sto_basedir, and all the thumbnails must have the same name as the original picture. | ./pics/thumbs |
ftp_server | IP address or name of the FTP server (only used if sto_type is ftp). | 127.0.0.1 |
ftp_user | User profile for accessing the FTP server. | user |
ftp_passwd | Password for accessing the FTP server. | password |
The following is an example of a config.ini file:
[global]
sto_type = "ftp"
sto_basedir = "/Files/Pictures"
thumb_basedir = "./thumbs"
[ftp]
ftp_server = "127.0.0.1"
ftp_user = "user"
ftp_passwd = "password"
- Generate 150x150 thumbnails by running Thumbinate.exe (or by any other means).
- Create a text file called config.ini with the desired options in the root folder of the project. Make sure that sto_basedir and thumb_basedir point to the right directories.
- Run mongoose-3.1.exe. This will start the web server.
- Navigate to http://localhost:8080/.
- Profit.