Image gallery generator, graphical interface
This online script generates a web page with an image gallery built with all images in a directory.
This tool lets you select image files from a list built from the content of your website, to make a gallery, set according to your preferences.
The program works in two stages. A first interface offers options to select the image files, then once the list is displayed, a second interface lets you define how to make the gallery. It is created in an HTML file on the website in the chosen directory.
Note that the appearance of the gallery is defined by yourself in a stylesheet. So the images are inserted with the "thumb" class and the CSS file is referenced as "gallery.css" in the generated page.
You have to build this style sheet and define the "thumb" descriptor.
Interface for selecting files
Source of images
The directory where the images are stored. By default, "/images/".
Always ended with "/".
Recurse
Crawl recursively sub-directories or not. Default not, only the contents of the directory is listed.
Since
Number of previous days. If the images were posted online the same day, type 1 to speed up the research.
Image extensions
List of recognized extensions, separated by a comma (no spaces). You can add or delete extensions here.
Image only
By default only image files, identified by the extensions, are taken into account. If you have your reasons to display other files, uncheck the box.
Get Images
Command to start the building of the list.
Interface Definition Gallery
Title
Provide a title to the page and the H1 tag.
File to create
Name of the HTML file to create for displaying the images. If empty, or if "/", no file is created, the gallery will be displayed immediately, allowing you to see the how it looks.
Note that the file can not overwrite an existing file. If you do so many tests, the hosting will be filled with many files to delete!
Columns
Number of images juxtaposed on the same row.
You have to set the page width based on the total width.
Generate Gallery
Launches the generation. In all cases, the gallery will be displayed, even if a file is created.
Example of stylesheet
A minimal gallery.css file might look like this:
body {
width: 3000px;
}
.thumb {
margin:2px;
border:3px solid #ccc;
}
The width of the page defined in the body depends on the sum of the width of the images on a same row.
Download from the Bioloide page.
Gallery generator: command line version
This script generates a web page with an image gallery built with all images in a directory.
To see the options and the version, type:
php galgen.php
To create a gallery, open a command line window, type:
php galgen.php [parameters] name-of-the-page
This generates a web page with images according to your options.
The presentation depends on both options from the command and the stylesheet gallery.css.
The content of the latter is defined by yourself.
The page can be put online directly, or into a iframe, or you can copy and paste the contents into another page. In the latter case we must do the same with the style sheet.
Options:
- -t followed by the title
- Title for the page, optional. Put in quotes if there are several words.
- -c followed by a number
- The number of images juxtaposed on the same row.
- -d followed by the name of the directory where are the images
- If the option is omitted, the images are taken in the current directory
- -w followed by a URL
- The path on the web where will be stored the images. If the option is omitted, the images are read in the directory of the page.
- The name of the page
- With the extension of your choice.

