Skip to content

Commit

Permalink
use current DynamicImage
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Oct 24, 2023
1 parent b304e95 commit 6649d05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tiny_skia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ impl Renderer for TinySkiaRenderer {
return;
}

let rgba_image = try_ret!(image::load_from_memory(img.data).ok()).into_rgba8();
let rgba_image = img.img.clone().into_rgba8();
let mut pixmap = try_ret!(Pixmap::new(rgba_image.width(), rgba_image.height()));
for (a, &b) in pixmap.pixels_mut().iter_mut().zip(rgba_image.pixels()) {
*a = tiny_skia::Color::from_rgba8(b.0[0], b.0[1], b.0[2], b.0[3])
Expand Down

0 comments on commit 6649d05

Please sign in to comment.