Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Enable loading textures of unlimited size #5305

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/bevy_render/src/texture/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ impl Image {
let image_crate_format = format.as_image_crate_format().ok_or_else(|| {
TextureError::UnsupportedTextureFormat(format!("{:?}", format))
})?;
let dyn_img = image::load_from_memory_with_format(buffer, image_crate_format)?;
let mut reader = image::io::Reader::new(std::io::Cursor::new(buffer));
reader.set_format(image_crate_format);
reader.no_limits();
let dyn_img = reader.decode()?;
Ok(image_to_texture(dyn_img, is_srgb))
}
}
Expand Down