-
Notifications
You must be signed in to change notification settings - Fork 611
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
Cannot decode a specific WebP image #1712
Comments
Hello.
|
Attempting to open the image that @bradms linked results in this error (0.24.2): |
I have the image and code use std::{vec, io::{Read, Cursor}, fs::File};
fn main() {
let args = std::env::args().collect::<Vec<_>>();
if args.len() == 1 {
println!("file path unrepresented");
return;
}
let file_path = &args[1];
let mut rdr = File::open(file_path).unwrap();
let mut raw= vec![];
rdr.read_to_end(&mut raw).unwrap();
let image_opt = image::io::Reader::new(Cursor::new(&raw))
.with_guessed_format()
.map_err(image::ImageError::IoError)
.and_then(|rdr| {
rdr.format()
.map(|format| rdr.decode().map(|img| (format, img)))
.transpose()
}).unwrap();
if let Some((format, _img)) = image_opt {
println!("image format: {:?}", format);
} else {
print!("Unknown image format");
}
} output
|
Image can't handle odd-sized images. #1647 Webp worked perfectly with libwebp-image that uses non-rust impl. |
It seems that there are two separate issues being described here.
edit: my particular reproducer was fixed by #1806. |
While my reproducer for the "slice length" panic and the one from #1799 were both seemingly fixed by #1806, #1712 (comment) seems to be a separate issue that is still present in the latest commit. |
I can confirm that the problem reported by @ava57r persists Using this https://cdn.7tv.app/emote/638767f24cc489ef45239272/4x.webp image results in |
This is now fixed, I believe thanks to #1959 |
This happens when decoding the WebP image from https://httpbin.org/image/webp
Expected
It decodes the image successfully
Actual behaviour
Format error decoding WebP: Invalid Chunk header: [0x92, 0x9F, 0x00, 0x9D]
Reproduction steps
Try loading the image from memory like so:
The text was updated successfully, but these errors were encountered: