You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let image_bytes = include_bytes!("../data/image.bmp");letmut image_file = Cursor::new(image_bytes.as_ref());letBmp = image_crate::bmp::BmpDecoder::new(&mut image_file).unwrap();let logo = Image::try_from(Bmp).unwrap();
But with the new version I get the following error message when using the try_from:
the trait bound `printpdf::Image: std::convert::From<exporter::document::image_crate::bmp::BmpDecoder<&mut std::io::Cursor<&[u8]>>>` is not satisfied
the following implementations were found:
<printpdf::Image as std::convert::From<printpdf::ImageXObject>>
required because of the requirements on the impl of `std::convert::Into<printpdf::Image>` for `exporter::document::image_crate::bmp::BmpDecoder<&mut std::io::Cursor<&[u8]>>`
required because of the requirements on the impl of `std::convert::TryFrom<exporter::document::image_crate::bmp::BmpDecoder<&mut std::io::Cursor<&[u8]>>>` for `printpdf::Image`rustcE0277
mod.rs(479, 5): required by `std::convert::TryFrom::try_from`
Anything special I need to do now?
The text was updated successfully, but these errors were encountered:
tronta
changed the title
Cannot convert from
Cannot convert from BmpDecoder
Jan 4, 2022
In the 0.8 API, the image crate will always be enabled (should solve this issue), but image formats will not be enabled by default. So this should solve this issue.
I used to embed an image like this:
But with the new version I get the following error message when using the
try_from
:Anything special I need to do now?
The text was updated successfully, but these errors were encountered: