[Attached feature] Crash when handling large images (beta)
dev-zzo opened this issue · 6 comments
Describe the bug
Degate seems to be unable to handle large images in the latest version with the 'attached' project type.
To Reproduce
Steps to reproduce the behavior:
- Create a JPEG of 53675x24205 pixels
- Create a new 'attached' project
- Use that JPEG as one of the layers
- Zoom in on the image several times (I counted about 21 click on the + button), at some point the program hangs and crashes
I also tested the half-sized image with the same result.
Expected behavior
There should be no crashing.
Desktop (please complete the following information):
- OS: Windows
- Version: 2.1.0-1
Hi! Thanks for this bug report. I think the issue comes from thread count exhaustion since Degate will try to load image chunks around each position, and at each zoom level. With a big image this might lag behind since loading takes time, and thread count might just explode and make Degate hang/crash.
I'll try to address the issue by changing a bit the loading system, but that might take some time. A possible workaround before landing a fix could be to reduce some parameters to lower values in preferences. I'll try to add some status update soon.
@dev-zzo Could you confirm that Degate was initially loading the image (you were able to see it), but after zooming multiple time it freezes and crash?
With the 'attached' project type, that is the observed behaviour indeed.
A small update on the issue: I might have found an algorithm that'll fix the problem. However it might take some time to experiment and find the best variant. I'll also add a visual indicator when a tile is loading, and make sure even under heavy load Degate will not crash/freeze (in worse case loading will just be very slow). I'm really busy for the end of the year, but I hope I'll land a fix (and new beta version) before the new year.
I should have fixed the issue with 77631e1. I'll do more tests and a bit of cleanup before creating & merging a PR. I regret not having had more time before to tackle the issue (which did not take long to resolve).