bevy/crates
Miguel Medina Ballesteros e64c8f8b7a
Parse missing mime types (#12028)
# Objective

This PR adds some missing mime types to the
`ImageFormat::from_mime_type` method. As discussed [in this comment on
the Discord Bevy
community](https://discord.com/channels/691052431525675048/691052431974465548/1209904290227949729):

> It's strange that Bevy supports parsing `ImageFormat::WebP` from a
.webp str extension in the method below, but not from the mime type.
> 
> In comparison, the image crate does parse it:
https://github.com/image-rs/image/blob/master/src/image.rs#L170

# Solution

For each of the missing mime types, I added them based on the
`ImageFormat::from_mime_type` of the image crate:
https://github.com/image-rs/image/blob/master/src/image.rs#L209, except
for `ImageFormat::Basis` and `ImageFormat::Ktx2` which are not present
in the image crate, and I ignore if they have a mime type or not*

\* apparently nowadays there is an official mime type: `image/ktx2`
https://www.iana.org/assignments/media-types/image/ktx2

Any feedback is welcome! I thought of refactoring a bit more and
delegating the mime type parsing to the image crate (and possibly the
same for extensions), let me know if that's desired 🙂
2024-02-21 21:56:59 +00:00
..
bevy_a11y Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_animation Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_app Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_asset Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_audio Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_core Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_core_pipeline Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_diagnostic Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_dylib Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_dynamic_plugin Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_ecs Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_ecs_compile_fail_tests Remove APIs deprecated in 0.13 (#11974) 2024-02-19 19:04:47 +00:00
bevy_encase_derive Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_gilrs Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_gizmos Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_gltf Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_hierarchy Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_input Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_internal Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_log Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_macro_utils Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_macros_compile_fail_tests Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00
bevy_math Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_mikktspace Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_pbr Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_ptr Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_reflect Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_reflect_compile_fail_tests bevy_reflect_derive: Clean up attribute logic (#11777) 2024-02-12 15:16:27 +00:00
bevy_render Parse missing mime types (#12028) 2024-02-21 21:56:59 +00:00
bevy_scene Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_sprite Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_tasks Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_text Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_time Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_transform Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_ui Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_utils Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_window Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00
bevy_winit Bump Version after Release (#12020) 2024-02-21 20:58:59 +00:00