Skip to content

jgc777/FamilyAlbum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Family Album

Simple static photo gallery that groups images by year and person. Demo

Files included

  • index.html — the web UI that reads photos.json and displays the gallery.
  • createjson.js — Node.js script to generate photos.json from a folder tree of photos.

What it does

createjson.js scans a root folder that contains subfolders named by year (for example 2020, 2021) and builds a photos.json file. index.html loads that JSON to render a browsable gallery.

Generate photos.json

Requirements: Node.js (v14+ recommended).

Examples:

# Default: embed images as base64 in the JSON
node createjson.js --root "C:\path\to\photos-root" --out photos.json

# Embed image data
node createjson.js --root "C:\path\to\photos-root" --out photos.json --embed

# Produce a compact JSON (no pretty formatting)
node createjson.js --root "C:\path\to\photos-root" --out photos.json --compact

Main options

  • --root / -r: root folder containing year subfolders.
  • --out / -o: output JSON file path.
  • --embed / -e: embed images as base64 urls.
  • --compact / -c: write compact JSON.

The script also tries to extract person names from filenames (e.g. maria_dad.jpg['Maria','Dad']). If no names are found it uses Unknown.

Notes

  • Opening index.html directly may work in some browsers, but a simple static server is recommended.
  • You may replace json = await fetch('photos.json').then(r=>r.json()); in your html to include your image data in your html.
  • This project does NOT provide encryption, authentication, or password protection. If you serve it on a public server or share the files, anyone who can access the server or the JSON can view the images.