mirror of
https://gitlab.com/marcandre.lureau/qemu-display.git
synced 2024-12-22 05:35:20 +00:00
qemu-vnc: eprintln! why image conversion failed
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
9bb790584e
commit
948f792593
@ -464,7 +464,8 @@ fn image_from_vec(format: u32, width: u32, height: u32, stride: u32, data: Vec<u
|
||||
};
|
||||
samples
|
||||
.try_into_buffer::<image::Bgra<u8>>()
|
||||
.or_else::<&str, _>(|(_err, samples)| {
|
||||
.or_else::<&str, _>(|(err, samples)| {
|
||||
eprintln!("failed to convert image: {}", err);
|
||||
let view = samples.as_view::<image::Bgra<u8>>().unwrap();
|
||||
let mut img = BgraImage::new(width, height);
|
||||
img.copy_from(&view, 0, 0).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user