An all-in-one php photo gallery script, designed to just be dropped into a folder of photos. It outputs a simple, but beautiful photo gallery that's optimized for use on mobile devices.
A simple all-in-one php photo gallery script intended to be simply dropped into a directory of photos. It displays all the photos (jpg/jpeg only) in a simple visual interface, generating thumbnails on the fly to make the gallery load fast. It now also includes jQuery and the Magnific Lightbox (styles and js both from CDNs), so that the links to images will open in a lightbox instead of directly linking to them - this helps with usability.
150 lines of clean, well-commented php/html/css/js. Enjoy!

Live demo: http://gallery.jpederson.com
To quickly install the script from the command line, navigate to the directory you’d like to install this script to (inside a folder of photos), and execute the following command.
curl -O https://raw.githubusercontent.com/jpederson/photo-gallery/master/index.php
And then, while you’re in the command line, run the index.php file to pre-generate all the thumbnails for this gallery. See notes below in the ‘Generating Thumbnails’ section to see why it’s better to pre-generate your thumbnails via the command line.
php index.php
There are two methods of generating thumbnails:
The only important thing to note is that any photos whose filenames begin with an underscore (_) are ignored by the script - when thumbnails are generated, they’re saved to filenames beginning with an underscore, so you can manually override your thumbnails by saving versions of your photos with an underscore in front of their filename. Equally, if you’d like to regenerate the thumbnials, just delete the _ version of the photo, and the script will detect that the thumbnail was deleted (on the next pageload or script execution) and regenerate the thumbnail for that photo.
Developed with love by James Pederson.