mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Fix pixel format conversion in bevy_gltf (#897)
* Fix pixel format conversion in bevy_gltf * Update renamed image::DynamicImage method calls * Remove unused GltfError variant
This commit is contained in:
parent
3a9a5b4e07
commit
1e9a0544bd
2 changed files with 2 additions and 6 deletions
|
@ -26,7 +26,7 @@ bevy_type_registry = { path = "../bevy_type_registry", version = "0.3.0" }
|
|||
|
||||
# other
|
||||
gltf = { version = "0.15.2", default-features = false, features = ["utils"] }
|
||||
image = { version = "0.23", default-features = false }
|
||||
image = { version = "0.23.12", default-features = false }
|
||||
thiserror = "1.0"
|
||||
anyhow = "1.0"
|
||||
base64 = "0.12.3"
|
||||
|
|
|
@ -44,8 +44,6 @@ pub enum GltfError {
|
|||
BufferFormatUnsupported,
|
||||
#[error("Invalid image mime type.")]
|
||||
InvalidImageMimeType(String),
|
||||
#[error("Failed to convert image to rgb8.")]
|
||||
ImageRgb8ConversionFailure,
|
||||
#[error("Failed to load an image.")]
|
||||
ImageError(#[from] image::ImageError),
|
||||
#[error("Failed to load an asset path.")]
|
||||
|
@ -131,9 +129,7 @@ async fn load_gltf<'a, 'b>(
|
|||
}?;
|
||||
let image = image::load_from_memory_with_format(buffer, format)?;
|
||||
let size = image.dimensions();
|
||||
let image = image
|
||||
.as_rgba8()
|
||||
.ok_or(GltfError::ImageRgb8ConversionFailure)?;
|
||||
let image = image.into_rgba8();
|
||||
|
||||
let texture_label = texture_label(&texture);
|
||||
load_context.set_labeled_asset(
|
||||
|
|
Loading…
Reference in a new issue