1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Fix broken images on egui.rs (move from git lfs to normal git) (#5480)

The images in the widget gallery on egui.rs are broken:

![image](https://github.com/user-attachments/assets/305e1041-e3e3-472d-9a52-1b90e8da053d)

~Not sure why yet, and I fail to reproduce locally.~
It's because they are on git lfs.
This commit is contained in:
Emil Ernerfeldt
2024-12-16 14:16:54 +01:00
committed by GitHub
parent 3bdb19e864
commit f0ec2f05c4
6 changed files with 25 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -28,8 +28,8 @@ default = ["glow", "persistence"]
# image_viewer adds about 0.9 MB of WASM
web_app = ["http", "persistence"]
http = ["ehttp", "image", "poll-promise", "egui_extras/image"]
image_viewer = ["image", "egui_extras/all_loaders", "rfd"]
http = ["ehttp", "image/jpeg", "poll-promise", "egui_extras/image"]
image_viewer = ["image/jpeg", "egui_extras/all_loaders", "rfd"]
persistence = [
"eframe/persistence",
"egui_extras/serde",
@@ -56,6 +56,10 @@ eframe = { workspace = true, default-features = false, features = [
egui = { workspace = true, features = ["callstack", "default", "log"] }
egui_demo_lib = { workspace = true, features = ["default", "chrono"] }
egui_extras = { workspace = true, features = ["default", "image"] }
image = { workspace = true, default-features = false, features = [
# Ensure we can display the test images
"png",
] }
log.workspace = true
profiling.workspace = true
@@ -70,7 +74,6 @@ wgpu = { workspace = true, features = ["webgpu", "webgl"], optional = true }
# feature "http":
ehttp = { version = "0.5", optional = true }
image = { workspace = true, optional = true, features = ["jpeg", "png"] }
poll-promise = { version = "0.3", optional = true, default-features = false }
# feature "persistence":

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -78,6 +78,12 @@ impl ImageLoader for ImageCrateLoader {
}
}
if bytes.starts_with(b"version https://git-lfs") {
return Err(LoadError::FormatNotSupported {
detected_format: Some("git-lfs".to_owned()),
});
}
// (3)
log::trace!("started loading {uri:?}");
let result = crate::image::load_image_bytes(&bytes).map(Arc::new);