mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
pixels: Extend Image to allow for multiple frames (#36058)
Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
parent
584b37a1f3
commit
ec20d9a3d7
6 changed files with 119 additions and 28 deletions
|
@ -1677,7 +1677,7 @@ impl Handler {
|
|||
"Unexpected screenshot pixel format"
|
||||
);
|
||||
|
||||
let rgb = RgbaImage::from_raw(img.width, img.height, img.bytes.to_vec()).unwrap();
|
||||
let rgb = RgbaImage::from_raw(img.width, img.height, img.bytes().to_vec()).unwrap();
|
||||
let mut png_data = Cursor::new(Vec::new());
|
||||
DynamicImage::ImageRgba8(rgb)
|
||||
.write_to(&mut png_data, ImageFormat::Png)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue