SmilyOrg / photofield

Experimental fast photo viewer.
MIT License
398 stars 7 forks source link
gallery golang photos photoviewer self-hosted vue3


Logo

Photofield

Experimental fast photo viewer.

Demo · Report Bug · Request Feature

Table of Contents
  1. About
  2. Getting Started
  3. Configuration
  4. Usage
  5. Maintenance
  6. Development Setup
  7. Contributing
  8. License
  9. Acknowledgements

About

Zoom to logo within a 43k images

Zoom to logo within a sample of 43k images from open-images-dataset, i7-5820K 6-Core CPU, NVMe SSD

Photofield is a photo viewer built to mainly push the limits of what is possible in terms of the number of photos visible at the same time and at the speed at which they are displayed. The goal is to be as fast or faster than Google Photos on commodity hardware while displaying more photos at the same time. It is non-invasive and can be used either completely standalone or complementing other photo gallery software.

Features

Limitations

Built With

Getting Started

Docker

Make sure you create an empty data directory in the working directory and that you put some photos in a photos directory.

docker run -p 8080:8080 -v "$PWD/data:/app/data" -v "$PWD/photos:/app/photos:ro" ghcr.io/smilyorg/photofield

The cache database will be persisted to the data dir and the app should be accessible at http://localhost:8080. It should show the photos collection by default. For further configuration, create a configuration.yaml in the data dir.

docker-compose.yaml example This example binds the usual Synology Moments photo directories and assumes a certain path structure, modify to your needs graciously. It also assumes you have configured the `/photo` and `/user` directories as collections in the `configuration.yaml`. ```yaml version: '3.3' services: photofield: image: ghcr.io/smilyorg/photofield:latest ports: - 8080:8080 volumes: - /volume1/docker/photofield/data:/app/data - /volume1/photo/:/photo:ro - /volume1/homes/ExampleUser/Drive/Moments:/exampleuser:ro ```

Binaries

  1. Download and unpack a release.
  2. Run ./photofield or double-click on photofield.exe to start the server.
  3. Open http://localhost:8080, folders in the working directory will be displayed as collections. 🎉

Configuration

You can configure the app via configuration.yaml.

The location of the file depends on the installation method, see Getting Started.

The following is a minimal configuration.yaml example, see defaults.yaml for all options.

collections:
  # Normal Album-type collection
  - name: Vacation Photos
    dirs:
      - /photo/vacation-photos

  # Timeline collection (similar to Google Photos)
  - name: My Timeline
    layout: timeline
    dirs:
      - /photo/myphotos
      - /exampleuser

  # Create collections from sub-directories based on their name
  - expand_subdirs: true
    expand_sort: desc
    dirs:
      - /photo

Usage

This section will cover some obvious uses, but also some possibly unintuitive UI quirks that exist in the current version.

App Bar

App bar explanation

Photo Viewer

Maintenance

Over time the cache database can grow in size due to version upgrades and so on. To shrink the database to its minimum size, you can vacuum it. Multiple vacuums in a row have no effect as the vacuum itself rewrites the database from the ground up.

While the vacuum is in progress, it will take twice the database size and may take several minutes if you have lots of photos and a low-power system.

As an example it took around 5 minutes to vacuum a 260 MiB database containing around 500k photos on a DS418play. The size after vacuuming was 61 MiB as all the leftover data from database upgrades was cleaned up.

# CLI
./photofield -vacuum

# Docker
docker exec -it photofield ./photofield -vacuum

Development Setup

Prerequisites

Scoop (Windows): scoop install busybox just exiftool watchexec

Installation

  1. Clone the repo
    git clone https://github.com/smilyorg/photofield.git
  2. Install Go dependencies
    go get
  3. Install NPM packages
    cd ui
    npm install

Running

Run both the API server and the UI server in separate terminals. They are set up to work with each other by default with the API server running at port 8080 and the UI server on port 3000.

just is just as defined in the prerequisites.

API

UI

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements