emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
22.51k stars 1.61k forks source link

image loader for `file://` is blocking, while image loader for `http://` runs fine. #5375

Open hacknus opened 1 week ago

hacknus commented 1 week ago

Describe the bug When using

ui.image("file://image.png");

it is blocking until the image is loaded.

But

ui.image("https://web.site.com/image.png");

will run fine and updates the GUI while the image is loading.

Expected behavior All loaders should be non-blocking.

Desktop (please complete the following information):

lucasmerlin commented 6 days ago

This should definitely be improved, I think it would be fine to just spawn a thread to load and decode the image? Seems like someone already opened a PR: https://github.com/emilk/egui/pull/4069 But it's stale and needs some more work before it's ready.