egui/crates
Braden Steffaniak 770c976ed7
Fix image_loader for animated image types (#5688)
Hi, after upgrading to 0.31.0 all of my beautiful static webp images
started failing to load. I use the image_loader to load those via the
`image` crate.

I noticed that with 0.31.0 there are additions to how animated image
types are handled with frames and such. And with those changes the frame
index is attached to the uri at the end. This was problematic for the
image_loader, because it wasn't updated to handle that frame tag at the
end of the uri, so when looking up the bytes, it would fail to match the
uri in the bytes cache (the bytes were being saved without the frame
index, but attempting to be fetched _with_ the frame index).

This fixes the image_loader for me with webp & gif. They don't load the
animations, but I think that is because I don't have the custom
image_loader set up so I'm not worried about that for myself. I'm not
sure if that part is problematic in general, or if its just the way I
have my features set up.

You can recreate the issue on master by swapping out the dependency
features in the `images` example like this:
```
# egui_extras = { workspace = true, features = ["default", "all_loaders"] }
# env_logger = { version = "0.10", default-features = false, features = [
#   "auto-color",
#   "humantime",
# ] }
# image = { workspace = true, features = ["jpeg", "png"] }
egui_extras = { workspace = true, features = ["image", "svg"] }
env_logger = { version = "0.10", default-features = false, features = [
  "auto-color",
  "humantime",
] }
image = { workspace = true, features = ["jpeg", "png", "webp", "gif"] }
```

* [x] I have followed the instructions in the PR template

---------

Co-authored-by: lucasmerlin <lucasmeurer96@gmail.com>
2025-02-18 17:30:50 +01:00
..
ecolor Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
eframe Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
egui Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
egui-wgpu Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
egui-winit Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
egui_demo_app Make the ends of vline/hline sharper (#5676) 2025-02-04 15:31:51 +01:00
egui_demo_lib Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
egui_extras Fix image_loader for animated image types (#5688) 2025-02-18 17:30:50 +01:00
egui_glow Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00
egui_kittest Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
egui_plot Move `egui_plot` to its own repo (#4828) 2024-07-15 18:45:19 +02:00
egui_web Fix typos (#2866) 2023-04-18 15:52:45 +02:00
emath Add `Popup` and `Tooltip`, unifying the previous behaviours (#5713) 2025-02-18 15:53:07 +01:00
epaint Rename `Marginf` to `MarginF32` for consistency with `CornerRadiusF32` (#5677) 2025-02-11 11:23:59 +01:00
epaint_default_fonts Release 0.31.0 - Scene container, improved rendering quality 2025-02-04 16:47:56 +01:00