Inlyne-Project/inlyne

Image loading regression

Closed this issue ยท 3 comments

It looks like #71 regressed image loading

I had a bit of time to poke around, but probably won't have any more for the rest of the weekend. Just jotting down what I noticed in case it saves some time

Rendering now seems to block on image loading when before it would render the rest and lazily load images instead. It looks like this is down to using .get() instead of .try_get() in this snippet

https://github.com/trimental/inlyne/blob/7dceea8d398fde6e68209011e9b4a26c9b7e43e3/src/image.rs#L95

Images no longer block rendering after changing that, but the size for positioning seemed to regress too. Before a blank section would be loaded which would later be replaced by the image. It seems like the following section

https://github.com/trimental/inlyne/blob/7dceea8d398fde6e68209011e9b4a26c9b7e43e3/src/positioner.rs#L96-L101

used to report

[src/positioner.rs:102] size = (
    0.0,
    255.0,
)
[src/image.rs:216] "Loaded image" = "Loaded image"
[src/positioner.rs:102] size = (
    291.0,
    255.0,
)

for bun's logo, but now it reports

[src/positioner.rs:102] size = (
    0.0,
    0.0,
)
[src/image.rs:216] "Loaded image" = "Loaded image"
[src/positioner.rs:102] size = (
    291.0,
    255.0,
)

That's all I've got time for right now

@CosmicHorrorDev no worries, I actually was just investigating the same things. I think hopefully d4aad15 at least helps this issue quite a bit. I think a large part of that is due to the Tokio thread previously running on the main thread along with the winit event loop. Meaning when the Tokio thread would block on images, it would block the rest of the program.

@CosmicHorrorDev No worries, thank you investigating. Your time is worth a lot more than any open source hobby project.

Alright now the revert is merged I'm going to close this. Our async days are over ๐Ÿ˜„