We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dded16b commit fa8d1caCopy full SHA for fa8d1ca
1 file changed
crates/maps_io_ros/src/image.rs
@@ -25,11 +25,12 @@ pub fn load_image(path: &Path) -> Result<image::DynamicImage> {
25
/// Load an image from a bytes stream (e.g. in wasm applications).
26
/// The image format is guessed automatically.
27
pub fn load_image_from_bytes(bytes: &[u8]) -> Result<image::DynamicImage> {
28
- let img_io = ImageReader::new(std::io::Cursor::new(bytes))
+ let mut reader = ImageReader::new(std::io::Cursor::new(bytes))
29
.with_guessed_format()
30
.map_err(|e| Error::io("Cannot create image reader from bytes", e))?;
31
32
- let img = img_io
+ reader.no_limits();
33
+ let img = reader
34
.decode()
35
.map_err(|e| Error::image("Cannot decode image from bytes", e))?;
36
0 commit comments