Skip to content

Gallery for listing images by folder and displaying relevant meta data

License

Notifications You must be signed in to change notification settings

Clicketyclick/SimpleImageGallery

Repository files navigation

SIG

Simple Image Gallery lists and display images by folder showing metadata like EXIF and IPTC from images.

All functionallity is build in PHP, JavaScript and SQL on top of a SQLite database.

This is heavyly inspired by Single File PHP Gallery, but build from scratch. Single File PHP Gallery is a nice out-of-the-box gallery app. But has it's issues with handling larger collection of images (YES! I'm impatient).

My own collection holds more than 250,000 images. And I do NOT want to load that onto a webserver.

Pros and cons of Simple Image Gallery

Warning

Do NOT any personal/private images online!!! This is not a security system - and you "share with the world" online!

Pros cons
Fast loading Manual rebuil and database load
Keeps you originals away from the net Max display width and height defined by database
Watermarking in database Requires resizing of ALL images

Tip

If you put a watermark into your display images, the original are unaffected.

Demo

Take a look at the latest demo

Directory list.

List of subdirectories and individual images

Image view.

Display an individual image

IPTC and EXIF metadata.

List IPTC and EXIF metadata

Tip

And it is up to YOU to enrich you images with metadata in IPTC format. Use Photoshop, Gimp, XnView, Geosetter, ExifTool .. or whatever tool you like. Check IPTC's list of software

EXIF array view.

List EXIF technical data as array


Setup

index.php *     The Gallery
version.txt *   Version identification
LICENSE         License 
.
├───config *    Configuration files.
├───css*        Style Sheets.
├───database*   Database file(s).
├───doc         Documentation.
│   └───HTML    Doxygen doc.
├───examples    Examples for test run
├───icons*      Icons for display.
│   └───.flags* National flags (in SVG).
├───js*         JavaScripts.
├───lib*        Function libraries.
├───sql         SQLscript for administration.
└───util        Utilities: rebuild, reindex.
  • Files and directories needed on web. If you only run it locally, just ignore.

Caution

The directories marked * will include a default .htaccess file for Apache servers to prevent users from poking in your data file.

Startup

Prepare you images in a folder structure (See: ./examples) like this:

.
├───2023
│   ├───Giza
│   ├───Odense
│   └───Öland
│       ├───Borgholm1
│       └───Borgholm2
└───Externals
    ├───DanmarkSetFraLuften
    └───OdenseBilleder
        └───1943-08-19_Asylgade
  1. Run the PHP webserver:
php -S localhost:8083
  1. Opening a browser window with the address: http://localhost:8083/build.php
  1. On the form press Create database and the database will be created and populated:

You can now test the gallery by:

  1. Opening a new browser window/tab with the address: http://localhost:8083/index.php OR simply press the Test button
  2. Et voila! The Gallery is up and running.

Configuration

Suppose that you want to build your own database ./database/xyz with your own images from W:/gallery_test/ try setting the arguments to rebuild:

php util/rebuild.php -config:data:data_root="W:/gallery_test/" -config:database:file_name=./database/xyz.db

config:data:data_root and config:database:file_name are the paths to data in the configuration file ./config/config.json

So you can either set the arguments on the command line - OR edit the configuration file.

(Snap from the configuration file)

{
	"data": {
		"virtual_root": "./",
		"data_root": "W:/gallery_test/",
		"image_ext": [
			"jpg",
			"JPEG"
		]
	},
	"database": {
		"file_name": "database/data.db",
		"image_ext": [
			"jpg",
			"JPEG"
		]
	}
}

🐛Bugs, quirks 💀 👿 etc. 💣

Persons
Due to the lack of support of IPTC field "Person Shown" the field "Suplemental Categories" is used.

About

Gallery for listing images by folder and displaying relevant meta data

Resources

License

Stars

Watchers

Forks

Packages

No packages published