Experimental fast photo viewer.
Demo
·
Report Bug
·
Request Feature
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.
Seamless zoomable interface. Thanks to tiled image loading supported by OpenLayers and the API implementing tile rendering, you can switch between levels of detail seamlessly without loading a special detailed or fullscreen view.
Progressive multi-resolution loading. Not only are thumbnails used to show a single photo quicker, the whole layout is progressively loaded, so even if you move through photos quickly or zoom around, you will almost always have some form of feedback to not lose track.
Different layouts. Collections of photos can be displayed with different
layouts.
Semantic search using photofield-ai (alpha). If you set up an AI server
and configure it in the ai
section of the configuration, you should be
able to search for photo contents using words like "beach sunset", "a couple
kissing", or "cat eyes".
Tagging (alpha). You can tag photos with arbitrary tags. Currently tags
are only stored in the database and not in the photos themselves. You need to
enable them in the tags
section of the configuration and restart the
server. This forms a foundation for many other features, see below (checked -
implemented).
#family
or
#vacation
. Batch tagging not supported yet, but should be relatively easy
to add considering the selections (above) are already tags.exif:make:sony
or exif:model:sm-g950f
. You need to enable this in the
exif
section of the configuration. Only make
and model
are currently
supported (hardcoded).tag:TAG
.
For example, you can search for tag:fav
to only show favorited photos, or
tag:hello tag:world
to only show photos with both hello
and world
tags. This is an early version of filtering and should be more user-friendly
in the future.city:berlin
or country:germany
. See #59.Flexible media/thumbnail system. Do you have hundreds of gigabytes of existing thumbnails from an existing system? Me too! Let's reuse those. Don't have any? No worries, they will be generated automatically to speed up display. Here are the currently supported thumbnail sources:
photofield.thumbs.db
.@eaDir
.ThumbnailImage
Exif tag.sources
section of the Configuration.Single file binary. Thanks to Go and GoReleaser, all the dependencies are packed into a single binary file for most major OSes.
Read-only file system based collections. Photofield never changes your photos, thumbnails or directories. You are encouraged to even mount your photos as read-only to ensure this. The file system is the source of truth, everything else is just a more or less stale cache.
Fast indexing. Thanks to godirwalk, file indexing practically runs at the speed of the file system 1000-10000 files/sec on fast SSD and hot cache. EXIF metadata and prominent color are extracted as separate follow-up operations and run at up to ~200 files/sec and ~1000 files/sec on a fast system.
Basic video support. Videos are supported, however the user experience is not great yet as there are some usability quirks. Different resolutions are supported if they have been previously transcoded, but there is no on-the-fly transcoding supported right now.
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./photofield
or double-click on photofield.exe
to start the server.configuration.yaml
in the working dir to configure the appPHOTOFIELD_DATA_DIR
environment variable to change the path where
the app looks for the configuration.yaml
and cache databaseYou 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
This section will cover some obvious uses, but also some possibly unintuitive UI quirks that exist in the current version.
Escape
or pinch out to get back to the list of photosCtrl/Cmd
+Wheel
Arrow Left
or Arrow Right
to quickly switch between photosRight-click or long-tap as usual to open a custom context menu allowing you to copy or download original photos or thumbnails.
You can open/copy/copy link the original or access any existing thumbnails that already exist for it with the bottom list of thumbnails by pixel width.
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
just
Scoop (Windows): scoop install busybox just exiftool watchexec
git clone https://github.com/smilyorg/photofield.git
go get
cd ui
npm install
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.
just watch
the source files and auto-reload the server using watchexecjust run
the serverjust ui
to start a hot-reloading development serverui
folder
cd ui
npm run dev
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Distributed under the MIT License. See LICENSE
for more information.