You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When adding images to a new app, any misconfiguration, like missing egui_extras and images crates or features, not calling egui_extras::install_image_loaders(), shows only an inscrutable red warning icon in the GUI, and only if your app happens to be in a state that shows images.
Describe the solution you'd like
An error message indicating (a) that the image wasn't rendered, (b) which image wasn't rendered, and (c) why. A panic would be fine, though a crate feature converting the panic to an error message would probable help some people be more comfortable with this feature.
A runtime error would be very helpful, it requires you to visit every state of the app that renders an image to make sure they all display, ideally this would be a compile time error. However, not letting a detectably incorrect app run is why we're using rust in the first place :).
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
I think in order for this to be a compile time error egui would need to be generic over the image loaders, I don't think that's feasible.
I think we could add a debug_assertion if we try to show an image and absolutely no image loader is installed, so it would panic in debug builds but not in release builds.
But we'd need to be careful which other errors we panic on, since image loading might fail for many different reasons which shouldn't cause the app to crash. I wouldn't want my app to crash if e.g. a network request fails or the user tries to open a file that doesn't exist, or a file format that isn't supported.
I think we could add a log::warn for all these cases though, which would help debugging the issue.
Finally, if you really want your app to panic if image loading fails, you could use Image::load_for_size to check the result before showing the image, and panic if there is an error. You could add a utility method like show_image(ui: &mut Ui, image: Image) that does this to get this behavior everywhere in your app.
Is your feature request related to a problem? Please describe.
When adding images to a new app, any misconfiguration, like missing
egui_extras
andimages
crates or features, not callingegui_extras::install_image_loaders()
, shows only an inscrutable red warning icon in the GUI, and only if your app happens to be in a state that shows images.Describe the solution you'd like
An error message indicating (a) that the image wasn't rendered, (b) which image wasn't rendered, and (c) why. A panic would be fine, though a crate feature converting the panic to an error message would probable help some people be more comfortable with this feature.
A runtime error would be very helpful, it requires you to visit every state of the app that renders an image to make sure they all display, ideally this would be a compile time error. However, not letting a detectably incorrect app run is why we're using rust in the first place :).
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: