Giter Site home page Giter Site logo

0x0f0f0f / thingallery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gfwilliams/thingallery

1.0 3.0 0.0 1.19 MB

A single-file web gallery. Uses EXIF thumbnails to quickly display thumbnails for a directory with no server-side code

HTML 100.00%

thingallery's Introduction

ThinGallery

https://github.com/gfwilliams/ThinGallery

Copyright 2016 Gordon Williams, [email protected] (Licensed as MPLv2)

A single-file gallery webpage. This uses EXIF thumbnails, XMLHttpRequest Range headers, and your web server's own index pages to quickly display thumbnails for a directory without having to fully load every image file, and without any server-side scripting.

Original Index Page Gallery list Gallery image

Why?

  • You have access to a web server, but no ability to upload/execute scripts on it
  • You don't want to execute scripts on your server for security/performance reasons
  • You have a NAS box - this may not support common server-side languages like PHP, and even if it does, it may be too slow to resize your images.
  • You want to serve a photo gallery off your phone with a basic web server app.

Setup

  • Put gallery.html in the folder that contains your photos.
  • Don't rename it to index.html as the web server's own index page is required in order to list the photos
  • Open gallery.html with a web browser, and enjoy.

Usage

  • Click on an image to open it
  • The thumbnail will be shown enlarged first (with an hourglass over it). When the full-size image is loaded it'll replace the thumbnail.
  • Use the left and right arrows (on screen or keyboard) to move between photos
  • Click the arrow in the bottom right to load the image in its own tab
  • Click the image, background, or scroll to close the opened image

iOS Web App

  • Visit the full URL in Safari, and include basic authentication if required: https://user:[email protected]/gallery.html?https://site.tld/
  • In Safari, choose the Add to Homescreen option to create a full-screen Web App

How it works

When there's no index.* page, the web server creates its own HTML listing of files, and the gallery loads this and scans it in order to find out what images are available.

For each JPEG image, it requests just the first 30,000 bytes, which will usually contain the image's thumbnail if it had one. If it's there, it is used - otherwise the entire image is loaded and resized (once all the other thumbnails have been scanned).

This means that in a directory of photos from a digital camera, instead of loading each ~5MB image file (and using up all your bandwidth and RAM), the gallery is loading less that a 150th of the amount of data, making it much faster to browse your files.

Future Additions

These are just some ideas - if you fancy adding them then please have a go and issue a Pull Request!

  • Find some Unicode that actually works nicely on all platforms (folders don't work on Linux)
  • Relative paths used after gallery.html? when folders are clicked on
  • Allow Delete + Rotate, and store the data in a cookie. Allow export as a shell script that would use ImageMagick to perform the operations when run on the server.

thingallery's People

Contributors

gfwilliams avatar h0dgep0dge avatar

Stargazers

Vighnesh SK avatar

Watchers

James Cloos avatar Alessandro Cheli avatar  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.