use ::image::codecs::bmp::BmpDecoder;
let PngData = include_bytes!("background.png");
let mut cursor = Cursor::new(PngData);
let decoder = BmpDecoder::new(&mut cursor).unwrap();
let backend = Image::try_from(decoder).unwrap();
Cargo.toml
[dependencies]
printpdf = { version = "0.7.0", features = [ "embedded_images" ] }
image = { version = "0.25", features = ["bmp"] }
error
--> src/main.rs:22:35
|
22 | let backend = Image::try_from(decoder).unwrap();
| --------------- ^^^^^^^ the trait `printpdf::image::ImageDecoder<'_>` is not implemented for `image::codecs::bmp::BmpDecoder<&mut std::io::Cursor<&[u8; 13660]>>`
| |
| required by a bound introduced by this call
code
Cargo.toml
error