nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.15k stars 1.75k forks source link

pre-cache picture thumbnails #4496

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi.

I would like the option that NC android client can pre cache the thumbnails for certain folders. This would make the user experience much better.

In my work flow I import many photos from my DSLR camera on the desktop, but I would like to view and share them on the phone. Even if I to occ preview:generate-all, the download speed of thumbnails is too slow to do on-demand only. Specifying folders to keep thumbnails in sync (but not the data!) would greatly improve the situation.

tobiasKaminsky commented 4 years ago

I had something similar in mind, but having an option for that is too techy, in my opinion. Better would be something like:

This would then also require that cache might increase beyond 200mb (which is currently hard limited, but I guess in modern devices we can use a better max value, eg. based on free disk space, etc.)

tobiasKaminsky commented 4 years ago

Same would also be true for entire file structure, when assuming that ~80% of files are changed very very rarely on private instances.

ghost commented 4 years ago

Yes. Of course. But syncing all thumbs by default might take to much storage space on the phone if the user has many files. But having this as an option would be very valuable.

With a low jpeg quality, 200MB could store 20.000 thumbs. Pretty much I suppose. Though myself have 100k photos and many more document type files.

AndyScherzinger commented 4 years ago

If we simply pre-fecth based on the loader logic of the photos-view we could do such a thing which basically translates to loading the latest n image thumbnails.

ghost commented 4 years ago

Not sure I follow. "latest n image thumbnails". Do you mean to schedule downloading small sets odd thumbs in the background?

Whisprin commented 4 years ago

Found this old issue that seems related: https://github.com/nextcloud/android/issues/177

I think photos and videos are one of the main use cases for people on their phones. Maybe it makes sense to give a bit more control to the user about keeping smaller versions(/thumbnails) of their media on the phone as suggested here: https://github.com/nextcloud/android/issues/1490

The logic for the use cases may be very similar.

acloudadmin commented 4 years ago

Hi. Great app -- very useful.

Like to add my support for improving the thumbnail cache. I have 15k photos and lots and lots of room on my phone - more than enough room to cache thumbnails for all. This would make the app SOOO much more useful to me.

If I had the option, I 'd love to be able to set my own cache-size limit, and perhaps even prot CT the cache from being cleaned out by any routine android cache-cleaning protocols (of such things exist).

Thanks again for all your work on this.

tobiasKaminsky commented 4 years ago

Regarding cache size: #596 I know it is outdated, but maybe we can research if an unlimited cache size is possible. (Android allows to clean cache, if device runs out of space, so we need not to limit it arbitrary)

FlashyDuck commented 2 years ago

This is really a missing feature that kills the experience. I've transferred a few users from icloud to my nextcloud server and this is the biggest complaint that I got. Although I have Previewgenerator installed and all, but still; the app only loads/downloads thumbnails that the user is viewing. Large folders to scroll through (1000+ pictures) is a real pain.

shaun-ba commented 2 years ago

I agree this is just stupid, give the user control of this...

I cannot even view a pretty small folder of photos, the client says 78mb used and has a red bar at the bottom. Naturally I went to settings to increase the cache and was shocked to find that isn't an option.

tobiasKaminsky commented 2 years ago

Glide, one of the most used image loading library, is also using a 250Mb fixed LRU (least-recently-used) cache. https://bumptech.github.io/glide/doc/configuration.html#disk-cache

I suspect that there is a misunderstanding between cache and and waiting for thumbnail: our cache size is set to 200Mb, so it can hold up to 4000 images (given one preview has ~50kb, or even more thubmnails).

If you browse a large folder and you have to wait for thumbnails/preview to be shown, this is because server needs to generate it, which takes time.

Thumbnails: little square images Preview: screen adjusted images when you click on an image