Skip to content

Photos Library Documentation

Since: 0.16.0

The photos library provides photo browsing with EXIF metadata extraction, album organization, and slideshow functionality.

Supported Formats

The photo library supports the following image formats:

FormatExtensionEXIF SupportNotes
JPEGjpg, jpeg✅ FullBest for photos; EXIF extraction via exif_read_data()
PNGpng❌ BasicDimensions only; no camera metadata
TIFFtiff, tif❌ BasicDimensions only
WebPwebp❌ BasicDimensions only
HEICheic, heif⚠️ LimitedRequires ImageMagick extension; graceful fallback if unavailable

EXIF Fields Extracted

When scanning photos, the following EXIF metadata is extracted and stored in each media item's metadata_json:

FieldTypeDescription
camera_makestringCamera manufacturer (e.g., "Canon", "Nikon")
camera_modelstringCamera model (e.g., "EOS 5D Mark IV")
lensstringLens model (if available in EXIF)
aperturestringAperture value (e.g., "f/2.8")
isointISO sensitivity
shutter_speedstringExposure time (e.g., "1/250")
focal_lengthstringFocal length (e.g., "50mm")
widthintImage width in pixels
heightintImage height in pixels
orientationintEXIF orientation code (1-8)
orientation_namestringHuman-readable orientation
date_taken_unixintUnix timestamp when photo was taken
gps_latfloatGPS latitude coordinate
gps_lngfloatGPS longitude coordinate
gps_altfloatGPS altitude in meters

Album Organization

Photos are automatically grouped into albums based on the date they were taken:

  • Date-based albums: Photos are grouped by YYYY-MM-DD of date_taken_unix
  • Albums are sorted with most recent first
  • Each album shows a cover photo and photo count

API Endpoints

Albums

MethodEndpointDescription
GET/photo/albumsList all albums (grouped by date)
GET/photo/albums/{id}Get specific album with photos

Photos

MethodEndpointDescription
GET/photo/photosList all photos
GET/photo/photos/{id}Get photo with full EXIF data
GET/photo/photos/{id}/thumbnail?w=300&h=300&fit=coverGet resized thumbnail
GET/photo/photos/{id}/fullGet full-resolution photo

Slideshow

MethodEndpointDescription
GET/photo/slideshow?album_id=xxx&interval=5Get slideshow data

Thumbnail Generation

Thumbnails are generated on-demand using PHP's GD library:

  • Default size: 300×300 pixels
  • Fit modes: cover (crop to fill) or contain (letterbox)
  • Thumbnails are served with Cache-Control: public, max-age=86400
  • Full photos use Cache-Control: public, max-age=31536000 (1 year)

Slideshow Player

The slideshow player features:

  • Auto-advance: Configurable interval (default 5 seconds)
  • Keyboard controls: Arrow keys (←/→), Space (play/pause), Escape (exit)
  • Touch/swipe: Swipe left/right on mobile devices
  • Thumbnail strip: Quick navigation at bottom
  • Caption display: Shows camera info and date

Deferred Features

The following features are planned for future releases:

  • Geotag clustering / map view: Photos with GPS coordinates will be plottable on a map
  • Thumbnail caching: Disk-based cache for generated thumbnails
  • Photo editing: Basic editing (rotate, crop)
  • Sharing: Generate shareable links for photos/albums
  • Backup integration: Export photos to cloud storage

Configuration

No special configuration is required for the photos library. The following optional settings may be added in config/server.php:

php
// Future photo library settings (not yet implemented)
'photo' => [
    'thumbnail_size' => 300,
    'slideshow_interval' => 5,
    'enable_map_view' => false, // Future: Enable geotag clustering
],

Known Limitations

  1. HEIC/HEIF support: Requires ImageMagick extension; falls back to basic metadata if unavailable
  2. No video support: Video files in photo libraries are ignored
  3. No map view: GPS coordinates are stored but no map UI exists yet
  4. No thumbnail cache: Thumbnails are regenerated on each request
  5. No face detection: People/face tagging not supported

BSD-3-Clause