From 8131b7b898df44b8d04227c3f30ca30bc1a003fd Mon Sep 17 00:00:00 2001 From: Ryan Bluth Date: Sat, 28 Dec 2024 10:01:30 -0500 Subject: [PATCH] Make image extension lowercase before checking if it is supported (#5501) * Images with capitalized extensions do not load because the list of extensions they are checked against is lowercase. The image extension is now converted to lowercase before comparing * [x ] I have followed the instructions in the PR template --- crates/egui_extras/src/loaders/image_loader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/egui_extras/src/loaders/image_loader.rs b/crates/egui_extras/src/loaders/image_loader.rs index 4c1a846e..171e5617 100644 --- a/crates/egui_extras/src/loaders/image_loader.rs +++ b/crates/egui_extras/src/loaders/image_loader.rs @@ -19,7 +19,10 @@ impl ImageCrateLoader { } fn is_supported_uri(uri: &str) -> bool { - let Some(ext) = Path::new(uri).extension().and_then(|ext| ext.to_str()) else { + let Some(ext) = Path::new(uri) + .extension() + .and_then(|ext| ext.to_str().map(|ext| ext.to_lowercase())) + else { // `true` because if there's no extension, assume that we support it return true; };