From 6649d05e9c4b62b59e09fe5cbc63d47a3044fbce Mon Sep 17 00:00:00 2001 From: Dongdong Zhou Date: Tue, 24 Oct 2023 21:16:27 +0100 Subject: [PATCH] use current DynamicImage --- tiny_skia/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_skia/src/lib.rs b/tiny_skia/src/lib.rs index 4c6f3384..32d69c1e 100644 --- a/tiny_skia/src/lib.rs +++ b/tiny_skia/src/lib.rs @@ -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])