From ff2f984aaa143d29b8b9ab65b6acb4a4d53d2f73 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 27 May 2026 12:50:21 +0700 Subject: [PATCH] Added UseFullResolutionImages setting --- ImmichFrame.Core/Interfaces/IServerSettings.cs | 1 + ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs | 6 +++++- ImmichFrame.WebApi.Tests/Resources/TestV1.json | 1 + ImmichFrame.WebApi.Tests/Resources/TestV2.json | 1 + ImmichFrame.WebApi.Tests/Resources/TestV2.yml | 1 + ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs | 2 ++ ImmichFrame.WebApi/Models/ServerSettings.cs | 1 + Install_Web.md | 1 + docker/Settings.example.json | 1 + docker/Settings.example.yml | 1 + docker/example.env | 1 + docs/docs/getting-started/configuration.md | 2 ++ docs/docs/getting-started/configurationV1.md | 1 + 13 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ImmichFrame.Core/Interfaces/IServerSettings.cs b/ImmichFrame.Core/Interfaces/IServerSettings.cs index fea6c442..eb7b05c2 100644 --- a/ImmichFrame.Core/Interfaces/IServerSettings.cs +++ b/ImmichFrame.Core/Interfaces/IServerSettings.cs @@ -42,6 +42,7 @@ public interface IGeneralSettings public double TransitionDuration { get; } public bool DownloadImages { get; } public int RenewImagesDuration { get; } + public bool UseFullResolutionImages { get; } public bool ShowClock { get; } public string? ClockFormat { get; } public string? ClockDateFormat { get; } diff --git a/ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs b/ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs index 451f839c..8600d4d5 100644 --- a/ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs +++ b/ImmichFrame.Core/Logic/PooledImmichFrameLogic.cs @@ -140,7 +140,11 @@ public async Task GetAsset(Guid id, AssetTypeEnum? assetType = nu } } - var data = await _immichApi.ViewAssetAsync(id, string.Empty, AssetMediaSize.Preview); + var mediaSize = _generalSettings.UseFullResolutionImages + ? AssetMediaSize.Fullsize + : AssetMediaSize.Preview; + + var data = await _immichApi.ViewAssetAsync(id, string.Empty, mediaSize); if (data == null) throw new AssetNotFoundException($"Asset {id} was not found!"); diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV1.json b/ImmichFrame.WebApi.Tests/Resources/TestV1.json index e6c49102..683363c4 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV1.json +++ b/ImmichFrame.WebApi.Tests/Resources/TestV1.json @@ -10,6 +10,7 @@ "PlayAudio": true, "Layout": "Layout_TEST", "DownloadImages": true, + "UseFullResolutionImages": true, "ShowMemories": true, "ShowFavorites": true, "ShowArchived": true, diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV2.json b/ImmichFrame.WebApi.Tests/Resources/TestV2.json index 4d603dc9..4c26e4ee 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV2.json +++ b/ImmichFrame.WebApi.Tests/Resources/TestV2.json @@ -2,6 +2,7 @@ "General": { "AuthenticationSecret": "AuthenticationSecret_TEST", "DownloadImages": true, + "UseFullResolutionImages": true, "RenewImagesDuration": 7, "Webcalendars": [ "Webcalendars_TEST" diff --git a/ImmichFrame.WebApi.Tests/Resources/TestV2.yml b/ImmichFrame.WebApi.Tests/Resources/TestV2.yml index 47f45947..4b5cba17 100644 --- a/ImmichFrame.WebApi.Tests/Resources/TestV2.yml +++ b/ImmichFrame.WebApi.Tests/Resources/TestV2.yml @@ -2,6 +2,7 @@ General: AuthenticationSecret: AuthenticationSecret_TEST DownloadImages: true + UseFullResolutionImages: true RenewImagesDuration: 7 Webcalendars: - Webcalendars_TEST diff --git a/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs b/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs index 076f36da..7a6ce3dc 100644 --- a/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs +++ b/ImmichFrame.WebApi/Helpers/Config/ServerSettingsV1.cs @@ -14,6 +14,7 @@ public class ServerSettingsV1 : IConfigSettable public bool ShowArchived { get; set; } = false; public bool ShowVideos { get; set; } = false; public bool DownloadImages { get; set; } = false; + public bool UseFullResolutionImages { get; set; } = false; public int RenewImagesDuration { get; set; } = 30; public int? ImagesFromDays { get; set; } public DateTime? ImagesFromDate { get; set; } @@ -110,6 +111,7 @@ class GeneralSettingsV1Adapter(ServerSettingsV1 _delegate) : IGeneralSettings public int Interval => _delegate.Interval; public double TransitionDuration => _delegate.TransitionDuration; public bool DownloadImages => _delegate.DownloadImages; + public bool UseFullResolutionImages => _delegate.UseFullResolutionImages; public int RenewImagesDuration => _delegate.RenewImagesDuration; public bool ShowClock => _delegate.ShowClock; public string? ClockFormat => _delegate.ClockFormat; diff --git a/ImmichFrame.WebApi/Models/ServerSettings.cs b/ImmichFrame.WebApi/Models/ServerSettings.cs index 74d0fb8e..4a8e5a00 100644 --- a/ImmichFrame.WebApi/Models/ServerSettings.cs +++ b/ImmichFrame.WebApi/Models/ServerSettings.cs @@ -38,6 +38,7 @@ public void Validate() public class GeneralSettings : IGeneralSettings, IConfigSettable { public bool DownloadImages { get; set; } = false; + public bool UseFullResolutionImages { get; set; } = false; public string Language { get; set; } = "en"; public string? ImageLocationFormat { get; set; } = "City,State,Country"; public string? PhotoDateFormat { get; set; } = "MM/dd/yyyy"; diff --git a/Install_Web.md b/Install_Web.md index 5cf3f94c..1bae6941 100644 --- a/Install_Web.md +++ b/Install_Web.md @@ -46,6 +46,7 @@ services: # ImageFill: "false" # Layout: "splitview" # DownloadImages: "false" + # UseFullResolutionImages: "false" # ShowMemories: "false" # ShowFavorites: "false" # ShowArchived: "false" diff --git a/docker/Settings.example.json b/docker/Settings.example.json index a86a4d00..caeb0b97 100644 --- a/docker/Settings.example.json +++ b/docker/Settings.example.json @@ -2,6 +2,7 @@ "General": { "AuthenticationSecret": null, "DownloadImages": false, + "UseFullResolutionImages": false, "RenewImagesDuration": 30, "Webcalendars": [ "calendarurl" diff --git a/docker/Settings.example.yml b/docker/Settings.example.yml index 173b31a5..5c90df69 100644 --- a/docker/Settings.example.yml +++ b/docker/Settings.example.yml @@ -1,6 +1,7 @@ General: AuthenticationSecret: null DownloadImages: false + UseFullResolutionImages: false RenewImagesDuration: 30 Webcalendars: - calendarurl diff --git a/docker/example.env b/docker/example.env index 51d80ed5..1d2919be 100644 --- a/docker/example.env +++ b/docker/example.env @@ -12,6 +12,7 @@ ApiKey=KEY # PlayAudio: false # Layout=splitview # DownloadImages=false +# UseFullResolutionImages=false # ShowMemories=false # ShowFavorites=false # ShowArchived=false diff --git a/docs/docs/getting-started/configuration.md b/docs/docs/getting-started/configuration.md index 7378c7d1..5643a513 100644 --- a/docs/docs/getting-started/configuration.md +++ b/docs/docs/getting-started/configuration.md @@ -36,6 +36,8 @@ General: AuthenticationSecret: null # string, no default # whether to download images to the server DownloadImages: false # boolean + # load image assets in full resolution instead of preview size + UseFullResolutionImages: false # boolean # if images are downloaded, re-download if age (in days) is more than this RenewImagesDuration: 30 # int # A list of webcalendar URIs in the .ics format. Supports basic auth via standard URL format. diff --git a/docs/docs/getting-started/configurationV1.md b/docs/docs/getting-started/configurationV1.md index bf9ca932..682c4e2c 100644 --- a/docs/docs/getting-started/configurationV1.md +++ b/docs/docs/getting-started/configurationV1.md @@ -23,6 +23,7 @@ sidebar_position: 4 | [Filtering](#filtering) | ImagesUntilDate | Date | | Show images before date. | | Caching | RenewImagesDuration | int | 30 | Interval in days. | | Caching | DownloadImages | boolean | false | \*Client only. | +| Caching | UseFullResolutionImages | boolean | false | Loads images in full resolution instead of preview size. | | Caching | RefreshAlbumPeopleInterval | int | 12 | Interval in hours. Determines how often images are pulled from a person in immich. | | Image | ImageZoom | boolean | true | Zooms into or out of an image and gives it a touch of life. | | Image | ImagePan | boolean | false | Pans an image in a random direction and gives it a touch of life. |