Skip to content

Commit

Permalink
Merge pull request #49 from SmilyOrg/io
Browse files Browse the repository at this point in the history
Refactor fixes
  • Loading branch information
SmilyOrg authored Apr 10, 2023
2 parents f0a1ec1 + 062ed26 commit 8143216
Show file tree
Hide file tree
Showing 33 changed files with 1,360 additions and 316 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,29 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: 1.19

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ 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 at this point meant to be used to complement other photo
gallery software.
non-invasive and can be used either completely standalone or complementing other
photo gallery software.


### Features
Expand Down Expand Up @@ -86,13 +86,16 @@ layouts.
able to search for photo contents using words like "beach sunset", "a couple
kissing", or "cat eyes".
![semantic search for "cat eyes"](docs/assets/semantic-search.jpg)
* **Reuse of existing thumbnails**. Do you have hundreds of gigabytes of
existing thumbnails from an existing system? Me too! Let's just reuse those.
Here are the currently supported thumbnail sources:
* **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:
* Bespoke SQLite thumbnail database - `photofield.thumbs.db`.
* Synology Moments / Photo Station auto-generated thumbnails in `@eaDir`.
* Embedded JPEG thumbnails (`ThumbnailImage` Exif tag).
* Limited support for extension via `thumbnails` section of
the [Configuration].
* Embedded JPEG thumbnails - `ThumbnailImage` Exif tag.
* Native Go [image](https://pkg.go.dev/image) package.
* FFmpeg on-the-fly conversion - thumbnails and full sized variants.
* Configurable via the `sources` section of the [Configuration].
* Please [open an issue] for other systems, bonus points for an idea on how to
integrate!
* **Single file binary**. Thanks to [Go] and [GoReleaser], all the dependencies
Expand All @@ -112,7 +115,6 @@ transcoding supported right now.

### Limitations

* **No thumbnail generation**. Only pre-generated thumbnails are supported.
* **No photo details (yet)**. There is no way to show metadata of a photo in the
UI at this point.
* **Not optimized for many clients**. As a lot of the normally client-side
Expand Down Expand Up @@ -172,7 +174,7 @@ default. For further configuration, create a `configuration.yaml` in the
services:

photofield:
image: ghcr.io/smilyorg/photofield
image: ghcr.io/smilyorg/photofield:latest
ports:
- 8080:8080
volumes:
Expand Down
23 changes: 23 additions & 0 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ paths:
schema:
$ref: "#/components/schemas/LayoutType"

- name: sort
in: query
schema:
$ref: "#/components/schemas/Sort"

- name: search
in: query
schema:
Expand Down Expand Up @@ -189,6 +194,15 @@ paths:
required: true
schema:
$ref: "#/components/schemas/TileCoord"

- name: sources
in: query
schema:
type: array
items:
type: string
style: form
explode: false

- name: debug_overdraw
in: query
Expand Down Expand Up @@ -620,6 +634,8 @@ components:
$ref: "#/components/schemas/LayoutType"
search:
$ref: "#/components/schemas/Search"
sort:
$ref: "#/components/schemas/Sort"

TaskType:
type: string
Expand Down Expand Up @@ -675,6 +691,10 @@ components:
minimum: 0
example: 0

Sources:
type: array


Bounds:
type: object
properties:
Expand All @@ -694,6 +714,9 @@ components:
Search:
type: string

Sort:
type: string

LayoutType:
type: string
enum:
Expand Down
49 changes: 34 additions & 15 deletions defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,26 +155,52 @@ media:
# fit: The aspect ratio fit to use while resizing
# path: Path to the FFmpeg binary, uses the one in PATH if not set
#
source_types:
sqlite:
path: photofield.thumbs.db
cost:
time: 5ms

goexif:
extensions: [".jpg", ".jpeg"]
width: 256
height: 256
fit: "INSIDE"
cost:
time: 30ms # 15ms + extra cost

image:
extensions: [".jpg", ".jpeg", ".png"]
cost:
time_per_original_megapixel: 90ms

thumb:
fit: "INSIDE"
cost:
time_per_resized_megapixel: 140ms

ffmpeg:
fit: "INSIDE"
cost:
time_per_original_megapixel: 220ms


sources:

# Internal thumbnail database
- type: sqlite
path: photofield.thumbs.db


# Embedded JPEG thumbnails
- type: goexif
extensions: [".jpg", ".jpeg"]
width: 256
height: 256
fit: "INSIDE"

# Native image decoding
- type: image
extensions: [".jpg", ".jpeg", ".png"]

#

#
# Synology Moments / Photo Station thumbnails
#
#
- name: S
type: thumb
path: "{{.Dir}}@eaDir/{{.Filename}}/SYNOPHOTO_THUMB_S.jpg"
Expand Down Expand Up @@ -264,7 +290,6 @@ media:
sources:
# Internal thumbnail database
- type: sqlite
path: photofield.thumbs.db

# Synology Moments / Photo Station thumbnail
- name: SM
Expand All @@ -277,10 +302,6 @@ media:

# Embedded JPEG thumbnails
- type: goexif
extensions: [".jpg", ".jpeg"]
width: 256
height: 256
fit: "INSIDE"

# Synology Moments / Photo Station thumbnail
- name: S
Expand All @@ -304,12 +325,10 @@ media:

# Native decoding (resized to 256px x 256px)
- type: image
extensions: [".jpg", ".jpeg", ".png"]
width: 256
height: 256

# The sink is used to save the generated thumbnail above
# so that it persists and can be reused while rendering.
sink:
type: sqlite
path: photofield.thumbs.db
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ services:
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml

pyroscope:
image: "pyroscope/pyroscope:latest"
ports:
- "4040:4040"
command:
- "server"

grafana:
build: ./docker/grafana/
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM grafana/grafana:8.0.6
FROM grafana/grafana:9.4.7
COPY provisioning /provisioning
COPY dashboards /var/lib/grafana/dashboards
Loading

0 comments on commit 8143216

Please sign in to comment.