Gallery icon indicating copy to clipboard operation
Gallery copied to clipboard

Allow disable fade-in of thumbnails when scrolling

Open CurbedLarry opened this issue 1 year ago • 7 comments

Checklist

  • [X] I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • [X] I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • [X] I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • [X] I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • [X] This issue contains only one feature request.
  • [X] I have read and understood the contribution guidelines.
  • [ ] I optionally donated to support the Fossify mission.

Feature description

Allow disable fade-in of thumbnails to increase scrolling speed, reduce CPU/GPU use

Why do you want this feature?

Main issue stopping me moving on from QuickPic is sluggish scrolling of thumbnails, especially on older/slower devices. This appears to be because thumbnails fade into view from black. I assume this was an aesthetic choice and not for some other technical reason? On faster/recent devices the fade-in effect isn't that noticeable so I think it adds little value.

My hope is the effect could be made optional in the settings?

Additional information

No response

CurbedLarry avatar Feb 17 '24 16:02 CurbedLarry

Related: https://github.com/SimpleMobileTools/Simple-Gallery/issues/2796 My impression is that loading is actually slow, it is more apparent without the fade-in.

gmasil avatar Feb 18 '24 09:02 gmasil

@gmasil Thanks for linking to the previous request.

Have noticed QuickPic is creating smaller thumbnails which surely helps. For the same ~3,000 images QuickPic has a cache of 93MB and Gallery 229MB. You really have to look closely at thumbnails with text to notice the difference on screen.

Cache size has been raised before I don't think anyone suggested a thumbnail quality setting or just reducing size/quality to benefit performance?

QuickPic QuickPic-Thumbnail Gallery Fossify-Gallery-Thumbnail

CurbedLarry avatar Feb 18 '24 14:02 CurbedLarry

Hi, that's a good point. I turned down the thumbnail resolution, but it didn't seem to have an impact. I started a branch here to investigate: https://github.com/gmasil/Fossify-Gallery/tree/investigate-slow-image-scrolling There is some lazy loading mechanism that I turned off and increased the prefetching of images during scrolling. Sadly this is running on the UI thread and thus introduces a stuttering UI during the eager thumbnail loading. Once all images are loaded the scrolling is very fast and smooth.

gmasil avatar Feb 18 '24 22:02 gmasil

I can't help with coding but happy to test APKs.

I've tested a couple of other galleries including Aves (https://github.com/deckerst/aves/). The UI is awful and it's very slow creating thumbnails but after that it has fast pop-up of thumbnails when scrolling. It's hard to make the screen go entirely black, even when throwing the scroll bar up/down.

Can anything be learned from their code?

CurbedLarry avatar Feb 20 '24 15:02 CurbedLarry

I have reduced the fade-in duration from 300ms to 150ms in version 1.1.3 but as @gmasil pointed out above, it is the image loader that needs to be optimized. Running the code on the main thread isn't helping either.

naveensingh avatar Apr 16 '24 15:04 naveensingh

@naveensingh Thanks, I've tested the change on 4 devices and think there's a small improvement on most. On the oldest/slowest device (2015 mid-spec tablet) there's more stuttering compared to an old version of SMT Gallery.

So I can see why the delay was set quite high to help older devices. My other high-end devices from 2016-2019 are OK so hopefully most users today won't see any stuttering.

Is the image loader something that can be optimised? Do you think there's any potential boost from a smaller thumbnail size?

CurbedLarry avatar Apr 17 '24 14:04 CurbedLarry

@naveensingh thank you for the improvement! But could you please add a setting to disable the fade-in duration completely? Thx :)

BluePixel4k avatar Jul 30 '24 15:07 BluePixel4k

sluggish scrolling of thumbnails

This should be fixed in the next update. There was a (unnecessary) lazy loading mechanism that delayed loading by 100 milliseconds.

I have also conditionally disabled fade-in animation when loading from cache because it usually is instantaneous on most devices.

naveensingh avatar Sep 24 '24 16:09 naveensingh

Just tested v1.2.1 and loading/scrolling is so fast now! As fast as any gallery I've tested, great work!

CurbedLarry avatar Oct 05 '24 13:10 CurbedLarry