Skip to content

fix: adapt to image 0.25.10 ExtendedColorType API change - #745

Open
tangaac wants to merge 2 commits into
plotters-rs:masterfrom
tangaac:fix/image-0.25.10-compatibility
Open

fix: adapt to image 0.25.10 ExtendedColorType API change#745
tangaac wants to merge 2 commits into
plotters-rs:masterfrom
tangaac:fix/image-0.25.10-compatibility

Conversation

@tangaac

@tangaac tangaac commented Aug 26, 2026

Copy link
Copy Markdown

Summary

image 0.25.10 changed PngEncoder::write_image to accept ExtendedColorType instead of ColorType, breaking compilation of plotters-svg with bitmap_encoder feature enabled.

  • Add .into() conversion to fix the type mismatch
  • Pin image dependency to 0.25.10 explicitly (was 0.25.9, resolved to 0.25.10 via semver)

Changes

plotters-svg/src/svg.rs:

- encoder.write_image(src, w, h, color)
+ encoder.write_image(src, w, h, color.into())

plotters-svg/Cargo.toml:

- version = "0.25.9"
+ version = "0.25.10"

Verification

  • cargo check --all-features passes
  • plotters-svg bitmap_encoder tests: 7/7 pass
  • Default tests unaffected

Background

image 0.25.10 introduced ExtendedColorType as a superset of ColorType and updated the encoder API accordingly. ColorType implements Into<ExtendedColorType>, so the code change is a minimal one-line fix. The Cargo.toml bump makes the version requirement explicit to match what Cargo.lock already resolves to.

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).
Make the version requirement explicit to match Cargo.lock and
the ExtendedColorType API used in svg.rs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant