Giter Site home page Giter Site logo

mitle / photo-gallery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jpederson/photo-gallery

0.0 0.0 0.0 29.18 MB

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.

Home Page: http://gallery.jpederson.com

PHP 100.00%

photo-gallery's Introduction

Photo Gallery

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!

Preview

Live demo: http://gallery.jpederson.com


Quick Install (cli)

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/mitle/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

Generating Thumbnails

There are two methods of generating thumbnails:

  1. Run the script in the command line. (preferred) This method usually bypasses any script execution time limits in your PHP installation. The script is developed to detect when you're in the command line (CLI), and not output HTML, instead creating a log as it goes through and generates thumbnails of each image. This method is quicker, and will pre-generate all your thumbnails at once, so that when you view the gallery in a browser, it just works right away.
  2. Refresh the page several times in a browser to generate thumbnails for a large number of images. This method is slower, and may take several refreshes, because the script may exceed the maximum execution time. Not to worry though, it skips images for which it has already created thumbnails, so each refresh, it just starts from the next image that needs a thumbnail, and will eventually make it through all the images.

Notes

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.

photo-gallery's People

Contributors

dev avatar jpederson avatar mitle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.