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
refactor(mobile): Use ImmichThumbnail and local thumbnail image provider #7279
Conversation
Deploying with Cloudflare Pages
|
f8e74e2
to
a845d99
Compare
linter errors linter
a845d99
to
84cd91b
Compare
format
6e934a5
to
b05d4fa
Compare
That blur is a bit aggressive, maybe it could be taken down a bit? It's difficult to find the "right value" which reduces the sharpness of the pixelated version without making it look blurry. |
children: [ | ||
placeholder, | ||
FadeInImage( | ||
fadeInDuration: const Duration(milliseconds: 100), |
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.
fadeInDuration: const Duration(milliseconds: 100), | |
fadeInDuration: duration, |
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.
Thank you, I missed this!
base64Decode(asset!.thumbhash!), | ||
); | ||
|
||
return useState(thumbhash.rgbaToBmp(rbga)); |
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.
Why do we need this to be a state? Can we use useRef
instead?
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.
Didn't know the difference! Thanks for the suggestion. I've made the change, and I think it'll be very helpful.
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.
LGTM! Love the ImageProvider related PRs <3
Hi @martyfuhry, I just tested this PR, and here are a few thoughts.
I think my point is to try to keep the complexity down if we can when the trade-off is minimal. Let me know what you think |
we can't show the blurhash while drag scrolling because we don't load the asset information. We only fetch this information from the database once drag scrolling stops. The transition is indeed very fast for cached thumbnails. For non-cached images it makes a lot of sense, though. We can probably improve this in the future to only use the blurhash if the image is not cashed |
Google photos doesn't show a blurhash at all on my device. I agree it is very very fast and may appear too busy. We could replace the placeholders entirely with blurhashes if we can query the assets while scrubbing quickly enough to read their blurhash. |
…quests are made simultaenously
ImmichThumbnail
with image providersImmichLocalThumbnailProvider
for showing local thumbnailsBlurhash
Thumbnail preview
Without blur / With blur
Also might add in cache for remote images in this one.