fix(thumbnails): use matched resolution for thumbnail cache keys#2727
Closed
MrCodeEU wants to merge 2 commits intoopencloud-eu:mainfrom
Closed
fix(thumbnails): use matched resolution for thumbnail cache keys#2727MrCodeEU wants to merge 2 commits intoopencloud-eu:mainfrom
MrCodeEU wants to merge 2 commits intoopencloud-eu:mainfrom
Conversation
Signed-off-by: MrCodeEU <reinemic2.0@gmail.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
I noticed that in folders with many large images the previews loaded quite slow compared to Nextcloud or Immich.
Because of that i did some investigations and found that the images that the web interface loads are not actually the preview images. After some digging i found this bug and created a fix for it:
Fix thumbnail cache key generation so configured thumbnail resolutions are honored consistently.
When
THUMBNAILS_RESOLUTIONSis configured, arbitrary client-requested preview sizes should be mapped to the closestconfigured resolution. The thumbnail manager already calculated that closest match, but the storage key was still
built from the raw requested dimensions.
This caused requests such as
1000x1000and1920x1920to create separate cache files even when both resolved to thesame configured thumbnail size.
Root Cause
SimpleManager.Generatecalculated the closest configured resolution: