-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(web): use original image if web compatible #17347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
); | ||
const targetImageSize = $derived.by(() => { | ||
if ($alwaysLoadOriginalFile || forceUseOriginal || originalImageLoaded) { | ||
return isWebCompatibleImage(asset) ? 'original' : AssetMediaSize.Fullsize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, was just taking a quick look here, but what happens if a User has $alwaysLoadOriginalFile = true
, but they have not enabled the Fullsize
preview generation? This function would return the targetImageSize
as Fullsize
, but the user won't have that generated.
Would this then internally fallback to the Preview
image somewhere (I tried to follow the logic till the utils folder but could not find the fallback, maybe I missed something?) or can the image fetch fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The client will be redirected to request the preview instead in this case, which also means the cached preview can be used instead of fetching the preview again from a different link.
* use original image if web compatible * add e2e * fix shared link handling * handle redirect in e2e * fix size not being passed to thumbnail url * test fullsize in e2e
* use original image if web compatible * add e2e * fix shared link handling * handle redirect in e2e * fix size not being passed to thumbnail url * test fullsize in e2e
* use original image if web compatible * add e2e * fix shared link handling * handle redirect in e2e * fix size not being passed to thumbnail url * test fullsize in e2e
Description
#14446 has a regression in that original images are never displayed. This PR changes the logic to prefer the original over the fullsize image if it's web-compatible. Also reverts back to using the thumbhash as cache key, as it was changed back to checksum in that PR.
Fixes #17334
How Has This Been Tested?
Tested that an HEIC image is displayed in Safari when zooming in and continues to be displayed after zooming out. Enabling "Display original images" makes it display the HEIC image immediately.