robrix icon indicating copy to clipboard operation
robrix copied to clipboard

2mb Png image in RoomScreen hangs

Open alanpoon opened this issue 7 months ago • 1 comments

20mb Jpeg can loaded in the room screen's timeline but 2mb png will hang.

alanpoon avatar Apr 30 '25 08:04 alanpoon

Weird, thanks for the report!

We have previously discussed moving image decoding steps to a background thread, and I agree that we should do that. Perhaps that will help with this issue.

However, it's hard to know for sure if that's the problem since you haven't provided any other details. Maybe that specific PNG file that you encountered is buggy or not a real PNG? (either way it shouldn't cause anything to hang...). Can you provide the faulty PNG?

I've encountered 10MB+ PNG files and they loaded and displayed properly, so it's probably not a widespread problem with all large PNG files.

kevinaboos avatar Apr 30 '25 18:04 kevinaboos

Weird, thanks for the report!

We have previously discussed moving image decoding steps to a background thread, and I agree that we should do that. Perhaps that will help with this issue.

However, it's hard to know for sure if that's the problem since you haven't provided any other details. Maybe that specific PNG file that you encountered is buggy or not a real PNG? (either way it shouldn't cause anything to hang...). Can you provide the faulty PNG?

I've encountered 10MB+ PNG files and they loaded and displayed properly, so it's probably not a widespread problem with all large PNG files.

We've tried, it is indeed slow when first opening the room. Image

alanpoon avatar Jun 11 '25 04:06 alanpoon

I see, so it's particularly a problem when the big image is shown immediately in the timeline of a newly-opened room? Does it hang indefinitely, or just take a few seconds?

I think the solution is just to move image decoding off the main thread, which has been on my to-do list for a while. Will work on it next week.

kevinaboos avatar Jun 11 '25 07:06 kevinaboos

There shouldn't be any image decoding when opening a room screen. Otherwise there is no use for Blur image hash logic.

alanpoon avatar Jun 11 '25 12:06 alanpoon

There shouldn't be any image decoding when opening a room screen. Otherwise there is no use for Blur image hash logic.

Is that true? I don't think that's guaranteed, since if you open a room and it's showing an image that is already fetched in the media cache, then it will immediately decode and render it.

Blur hash logic is still very useful while we're waiting for the full image to be fetched.

kevinaboos avatar Jun 11 '25 14:06 kevinaboos