From 00da9018cfd849e444607bd79cffd2eea6c61df9 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Tue, 30 Jun 2026 13:01:54 +1200 Subject: [PATCH] #162 #258 Serve fullsize image on zoom (configurable) --- app/config.json | 5 +- app/package-lock.json | 4 +- app/src/client/lightbox.ts | 104 ++++++++++++++++- app/src/config/migrations.ts | 40 ++++++- app/src/gallery/builder.ts | 29 ++--- app/src/gallery/filename.ts | 10 ++ app/src/gallery/metadata.ts | 13 +-- app/src/gallery/sizing.ts | 146 ++++++++++++++++++++++++ app/src/immich.ts | 63 ++++------ app/src/share.ts | 10 +- app/src/shared/types.ts | 1 + app/src/stream/asset.ts | 64 +++-------- app/src/stream/download.ts | 13 +-- app/src/types.ts | 1 + app/tests/migrations.test.ts | 56 +++++++++ app/tests/sizing.test.ts | 124 ++++++++++++++++++++ app/tests/sweepStaleStagingDirs.test.ts | 2 +- docs/configuration.md | 11 +- 18 files changed, 561 insertions(+), 135 deletions(-) create mode 100644 app/src/gallery/sizing.ts create mode 100644 app/tests/sizing.test.ts diff --git a/app/config.json b/app/config.json index 2c4e12c..2bc0302 100644 --- a/app/config.json +++ b/app/config.json @@ -4,9 +4,10 @@ "Cache-Control": "public, max-age=2592000", "Access-Control-Allow-Origin": "*" }, - "downloadOriginalPhoto": true, + "maxDownloadQuality": "original", + "maxZoomQuality": "preview", "downloadedFilename": 0, - "allowDownloadAll": 0, + "allowDownload": 0, "downloadFromImmichConcurrencyLimit": 20, "allowSlugLinks": true, "showHomePage": true, diff --git a/app/package-lock.json b/app/package-lock.json index a4fbb93..1bbaacb 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "immich-public-proxy", - "version": "2.5.0", + "version": "3.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "immich-public-proxy", - "version": "2.5.0", + "version": "3.0.0", "license": "AGPL-3.0", "dependencies": { "archiver": "^7.0.1", diff --git a/app/src/client/lightbox.ts b/app/src/client/lightbox.ts index ec54e23..c3a2b81 100644 --- a/app/src/client/lightbox.ts +++ b/app/src/client/lightbox.ts @@ -47,13 +47,19 @@ function escapeAttr (s: string): string { return String(s).replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>') } +// Per-slide bookkeeping for the zoom-to-upgrade + native-resolution cap, keyed +// by the gallery item index (stamped on each dataSource entry as `_ippIndex`). +// Reset on every lightbox open. +const loadedBitmapWidth = new Map() // index -> naturalWidth of the bitmap now in the +const upgradedSlides = new Set() // indices already swapped to fullUrl + /** * Translate `state.items` into PhotoSwipe's dataSource array. Images use * `src`/`width`/`height`; videos use the `html` slide with a `