From 9c0bbe7fb282c671e1c2761238777ccbc7c73b69 Mon Sep 17 00:00:00 2001 From: tangaac Date: Wed, 26 Aug 2026 16:15:22 +0800 Subject: [PATCH 1/2] fix: adapt to image 0.25.10 ExtendedColorType API change image 0.25.10 changed PngEncoder::write_image to accept ExtendedColorType instead of ColorType. Add .into() conversion to maintain compatibility. Fixes compilation with --all-features (bitmap_encoder). --- plotters-svg/src/svg.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotters-svg/src/svg.rs b/plotters-svg/src/svg.rs index e24623d7..adc6a478 100644 --- a/plotters-svg/src/svg.rs +++ b/plotters-svg/src/svg.rs @@ -602,7 +602,7 @@ impl<'a> DrawingBackend for SVGBackend<'a> { let color = image::ColorType::Rgb8; - encoder.write_image(src, w, h, color).map_err(|e| { + encoder.write_image(src, w, h, color.into()).map_err(|e| { DrawingErrorKind::DrawingError(Error::new( std::io::ErrorKind::Other, format!("Image error: {}", e), From 82e20ecf22c55b22b8ade831b30c6f2c7c141782 Mon Sep 17 00:00:00 2001 From: tangaac Date: Wed, 26 Aug 2026 16:25:59 +0800 Subject: [PATCH 2/2] fix: pin image dependency to 0.25.10 Make the version requirement explicit to match Cargo.lock and the ExtendedColorType API used in svg.rs. --- plotters-svg/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotters-svg/Cargo.toml b/plotters-svg/Cargo.toml index 4075b2e7..d1c65cc1 100644 --- a/plotters-svg/Cargo.toml +++ b/plotters-svg/Cargo.toml @@ -16,7 +16,7 @@ version = "0.3.6" path = "../plotters-backend" [dependencies.image] -version = "0.25.9" +version = "0.25.10" optional = true default-features = false features = ["jpeg", "png", "bmp"]