GNOME Bugzilla – Bug 524363
thumbnails jump around while being generated or loaded
Last modified: 2021-06-18 15:56:03 UTC
in some cases with existing thumbnails in a folder, nautilus jumps around frantically while generating or displaying thumbnails. Did something change regarding thumbnails between 2.20 and 2.22? This happens even if the listing is sorted by Name, as shown in the attached videos: @ 30 seconds: http://jeff.ecchi.ca/public/nautilus%202.22%20thumbnails%20jumping%201.ogg @ 1 minute: http://jeff.ecchi.ca/public/nautilus%202.22%20thumbnails%20jumping%202.ogg
Created attachment 108095 [details] demonstration screencast here is a shorter screencast that exhibits the behavior. Images appear out of nowhere in front of one another, even though they are supposed to be sorted by name. Please confirm?
What's going on here isn't that they're jumping around while generating, it's that when we enumerate a directory with a lot of files, Nautilus only gets about a hundred of them at a time, and Nautilus displays them as soon as possible. The underlying system gives us no guarantee that they'll all be loaded in the order that we want to sort them in, so between the rounds of loading, it may have an item that needs to be sorted higher up in the container, which causes things to "jump around". I'm not sure really how we're going to be able to fix it, or even if it's really a bug and not "just the way it works". The only other thing I can think of is just waiting until the load is finished to sort all of the items in the icon container, but that might just trigger the opposite bug ("hey, all of the items are loading but they're not in order until the load is finished!"), and I'm not sure it's any better behavior-wise. Maybe we can make this less noticeable with some tweaking?
but... this used to work fine before 2.22 (or I would have not noticed that there was a change), so it is possible, I would think. Anyway, especially in this case where the sorting is by file name, I would say that something is wrong. Surely nautilus does not pick 100 files at a time using a random technique? I mean, why can't it do something like os.listdir and then sort those names before displaying? At least it seems like it did in 2.20?
*** Bug 562114 has been marked as a duplicate of this bug. ***
It's not random, it's the order that the filesystem stores the files. Do an `ls -lf somedir` and you'll see that the filesystem doesn't return the files in any particularly sorted order. There are two issues here: 1) It can take a long time to list a large directory, particularly over a network. If no files are shown until it completes then the user may get frustrated. It is better to start displaying a partial listing after a short delay. The current behaviour is correct in this regard. 2) Nautilus looks up thumbnail indexes while reading the folder contents. This means that for almost every file, nautilus pauses while checking to see if it has a thumbnail, and displays it if it does. This makes loading a large directory of photos painfully slow. This is the bug. Instead of finishing the read of the directory contents, it keeps asking the disk to spin to random places and read thumbnail pngs. Nautilus should finish loading the directory completely, just showing placeholders for thumbnails until it finishes. When done, it should begin to check for and generate thumbnails, starting with the files currently being displayed in the window. This is what gthumb does, and it is blazingly faster than nautilus at displaying a directory with 100 photos. This is summarised nicely by the suggestion in bug 562114 : When a folder is opened, display placeholder thumbnails _before_ attempting to look up pre-generated thumbnails.
I agree with Kieran: when a folder is opened, placeholder thumbnails should be displayed before attempting to look up pre-generated thumbnails. This new behaviour would solve the problems pointed out by A.Walton and would provide more efficiency (less not needed disk accesses).
I gave a look at the code. It looks like that such a modification is not really simple, at least for me ;-)
*** Bug 711044 has been marked as a duplicate of this bug. ***
*** Bug 780551 has been marked as a duplicate of this bug. ***
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Files (nautilus), then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/nautilus/-/issues/ Thank you for your understanding and your help.