Proportionately long image display times with larger folder sizes
System information:
-
Windows OS version: Windows 10 (Version 10.0.15063 Build 15063)
-
ImageGlass version: 6.0.12.29
To Reproduce
Steps to reproduce the behavior:
- Enter any folder with large file size (most noticeable > 1 GB) that was not recently opened.
- Right Click, Open on any image.
- ImageGlass will open and hold on a blank background for a proportionate amount of time to the size of the folder.
Tested and successfully reproduced multiple times with 1, 2, 6, and 15 GB folders composing of .jpg and .png. The 15 GB folder produced the most noticeable wait time ~1 min while the 1-2 GB folders were ~10 s at most.
Actual behavior:
On my machine, when opening any image from a folder with a large filesize (> 1 GB), there is a delay from ImageGlass opening and displaying a blank background to the image appearing. This seems to be relative to the filesize of the folder; the opening of images from larger-sized folders tends to cause proportionately longer startup times than the opening of images from smaller-sized folders.
-
If I try to reproduce the issue a second time immediately after the first reproduction, second reproduction fails without exception (image will load within 2 s).
-
If after the first reproduction, I navigate away and open some other folders and let a few minutes pass, return to the folder of the first reproduction, and attempt to reproduce, the second reproduction succeeds (image will take an extended amount of time to load).
Expected behavior:
Opening any image in any large folder is snappy and does not produce a noticeable wait time (I'd consider > 2 s)
I noticed the same problem yesterday. After some testing I think it only happens when the Thumbnail panel is enabled. Upon opening a large size image in a folder with other similar images, it can be seen that ImageGlass is trying to load the images in the Thumbnail panel, before loading the image that's showing up in the main view. Possible ways it could be improved:
- Loading the currently opened image should have the highest priority in the load order
- The rest of the images shown on the thumbnail panel should be loaded next, in the same order they are preloaded when the panel is hidden. This way the first image loaded should be the current image being displayed, followed by images that would be preloaded even when the thumbnail panel is disabled, and finally any additional images that are currently showing in the thumbnail panel but would not be preloaded with the panel disabled.
- It would be great if the number of preloaded images could be configurable, say between 4 and 10. Currently it's set at 4 without a setting to change it https://github.com/d2phap/ImageGlass/issues/447#issuecomment-436896126
I'd done some work in the past to try to optimize the folder scan; perhaps something reverted. I'll see if I can reproduce.
Should be fixed in v9. IG v9 use asynchronous loading so that loading folder does not block the main thread.