-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Web reader doesn't full load images until they are shown despite preloading #1323
Comments
I don't quite understand what the symptom is, can you share a video that shows what's the problem? |
Sure! Here's an example: https://www.youtube.com/watch?v=CXAa-pcYABk For this example I used very high resolution images (6000x10000) to make it really prominent, but I can see it with normal manga too. |
And that symptom only happens on Firefox, is that right? |
Could you share that test cbz you're using? That would save me some time finding / building one for testing. |
The black image can only be seen on Firefox, yes. On Chromium browsers it lags the browser instead. Here is the cbz: https://drive.google.com/file/d/1HXYs7N0e3lK_V9PYOnvy8DUFOXttoRgm/view?usp=drivesdk |
Thanks for the file. I can reproduce on both Chrome and Firefox. Most of the development of Komga was done on Chrome, until a few weeks ago, which explains why this was never spotted. Chrome handles this slightly better than Firefox in my opinion. We don't use |
I've done a few tests on Chrome, Firefox and Safari. Chrome: seems to have some optimization to not render images that have a size but are not in the viewport. No luck there. It's also quite awful at managing page transitions with high definition images. It's always laggy, even after the images have been rendered. Firefox: I managed to setup some CSS classes to move the images offscreen with a Safari: the most atrocious browser in this test. It doesn't pre-render (like Chrome), and even after the components have been rendered and you go back to previously read pages, it stalls (like Chrome). I think it's agressively disposing of elements that are not displayed anymore, and need to re-render. |
Thanks a lot for your effort in solving this! 🥳 I will give it a try after work. |
Well it hasn't been released yet. Wait for the comment on that ticket once released. |
I tested it locally on the |
🎉 This issue has been resolved in |
Steps to reproduce
This is most noticeable in Firefox, especially with high resolution images (or spreads).
A spread where the issue was very prominent had the resolution of 3620x2560 for example.
To reproduce, open the reader and switch to a high resolution image.
After the image has been shown once, it will remain cached in the browser and you need to either Ctrl+F5 or fully close the browser to be able to reproduce the issue for that image again.
Expected behavior
Displays the image instantly.
Actual behavior
What happens in Firefox is that images are shown as complete black until they have been rendered.
In Chromium, it seems to instead "freeze" the browser page until the image has rendered, resulting in some delay but an overall better experience.
With the example spread mentioned above, it would result in a black image for ~0.5s in Firefox, and a delay of ~0.5s in Chromium.
This caused me to first believe that Komga didn't have preloading at all. On inspection though, I can see that the image has been loaded through a network request, but when switching to said image (same page numbers), I still see the loading lag.
Logs
No response
Komga version
v1.8.3-master
Operating system
Debian 12
Installation method
Docker
Other details
Looking at the code and network inspector, it caches the image properly with
:eager="eagerLoad(i)"
, but because the item still hasdisplay:none;
it doesn't actually get loaded for rendering.As an example, applying the following userstyle which overrides the
display:none;
style, while completely breaking the reader, also fixes the preloading issue for the first few images before breaking.One person on StackOverflow claims that using
eager
for thev-carousel
is not enough and that it might also require having av-img
witheager
.While I don't have a Komga development setup right now, I would be willing to help solve this issue.
Acknowledgements
The text was updated successfully, but these errors were encountered: