From 4e85772b475d0502f57af9d93c86c19cabdc37a2 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 20 Oct 2026 16:56:28 +0200 Subject: [PATCH] fix(webdav): stop the resolution ladder at 2048 The largest rung is the largest box a generator is asked for, and fill and stretch enlarge a small source to fill it, so the rungs above 2048 let a tiny image cost whatever 8K costs. Web asks for 1200 at most. --- services/webdav/README.md | 4 ++-- services/webdav/pkg/config/defaults/defaultconfig.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/webdav/README.md b/services/webdav/README.md index 22ac474844..bdae2b93a3 100644 --- a/services/webdav/README.md +++ b/services/webdav/README.md @@ -30,9 +30,9 @@ The following query parameters are supported: #### Thumbnail Resolution -`WEBDAV_THUMBNAIL_RESOLUTIONS` is a ladder of edge lengths, not a list of boxes. Each axis of a request is rounded up to the next length on the ladder, on its own, so a thumbnail never comes back in a different orientation than it was asked for. The largest length is the cap: a request above it, and an axis left unconstrained, get that one. +`WEBDAV_THUMBNAIL_RESOLUTIONS` is a ladder of edge lengths, not a list of boxes. Its largest entry is also the largest thumbnail this service asks a generator for, which is why it tops out at 2048: `fill` and `stretch` enlarge a small source to fill the box, so a higher rung lets a tiny image cost whatever that box costs. Each axis of a request is rounded up to the next length on the ladder, on its own, so a thumbnail never comes back in a different orientation than it was asked for. The largest length is the cap: a request above it, and an axis left unconstrained, get that one. -Example with the default ladder (16, 32, 64, 128, 192, 256, 320, 384, 448, 512, 640, 768, 1024, 1280, 1920, 2560, 3840, 7680): +Example with the default ladder (16, 32, 64, 128, 192, 256, 320, 384, 448, 512, 640, 768, 1024, 1280, 1920, 2048): Requested: 18x12\ Returned: 32x16 diff --git a/services/webdav/pkg/config/defaults/defaultconfig.go b/services/webdav/pkg/config/defaults/defaultconfig.go index 783419590d..04e385806f 100644 --- a/services/webdav/pkg/config/defaults/defaultconfig.go +++ b/services/webdav/pkg/config/defaults/defaultconfig.go @@ -49,7 +49,7 @@ func DefaultConfig() *config.Config { ThumbnailCacheBackend: "file", ThumbnailResolutions: []string{ "16", "32", "64", "128", "192", "256", "320", "384", "448", - "512", "640", "768", "1024", "1280", "1920", "2560", "3840", "7680", + "512", "640", "768", "1024", "1280", "1920", "2048", }, } }