egui/crates/egui_extras/src
Nicolas Gomez 1545dec7a8
[egui_extra] Allow loading multi-mime formats using the image_loader (#5769)
Hi ! 

I'm using egui and egui_extra to build a demo tool for a crate I'm
building. In this crate I load favicons from a lot of websites, and I
have some failures on some .ico files. After tracking this thing down, I
guess there is two issues (kinda), in the image crate,
'image/vnd.microsoft.icon' isn't recognized as the valid mime for an ico
image (I created a [PR](https://github.com/image-rs/image/pull/2434)),
and the code to detect if a given mime type is compatible with the image
crate decoders in this crate do not support multi-mime type formats.


[ImageFormat::to_mime_type](85f2412d55/src/image.rs (L216C12-L216C24))
is only returning one mime for a given format (which is fine), we
compare the result of this method to guess if the format is
valid/enabled. Retriveing the correct format using
[ImageFormat::from_mime_type](85f2412d55/src/image.rs (L166))
would allow more mime to be considered valid since multiple mime can
match the same format.

The same applies to the extension detection, which I also modified to
stay consistent

Thanks
2025-03-20 11:02:24 +01:00
..
datepicker Fix some clippy issues found by 1.84.0 (#5603) 2025-01-13 08:29:13 +01:00
loaders [egui_extra] Allow loading multi-mime formats using the image_loader (#5769) 2025-03-20 11:02:24 +01:00
image.rs Use `profiling` crate to support more profiler backends (#5150) 2024-12-16 09:15:54 +01:00
layout.rs ⚠️ Rename `Rounding` to `CornerRadius` (#5673) 2025-02-04 12:53:18 +01:00
lib.rs Use `profiling` crate to support more profiler backends (#5150) 2024-12-16 09:15:54 +01:00
loaders.rs Animated WebP support (#5470) 2024-12-29 11:46:08 +01:00
sizing.rs Improve `egui_extras::Table` layout (#4755) 2024-07-02 20:57:46 +02:00
strip.rs Fix some clippy issues found by 1.84.0 (#5603) 2025-01-13 08:29:13 +01:00
syntax_highlighting.rs Use `profiling` crate to support more profiler backends (#5150) 2024-12-16 09:15:54 +01:00
table.rs Fix typo in docstring for `Column::auto_size_this_frame` (#5681) 2025-02-18 18:11:48 +01:00