mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
e64c8f8b7a
# 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 🙂 |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_ecs_compile_fail_tests | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_macros_compile_fail_tests | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_reflect_compile_fail_tests | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |