fix: adapt to image 0.25.10 ExtendedColorType API change - #745
Open
tangaac wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
image0.25.10 changedPngEncoder::write_imageto acceptExtendedColorTypeinstead ofColorType, breaking compilation ofplotters-svgwithbitmap_encoderfeature enabled..into()conversion to fix the type mismatchimagedependency to0.25.10explicitly (was0.25.9, resolved to0.25.10via semver)Changes
plotters-svg/src/svg.rs:plotters-svg/Cargo.toml:Verification
cargo check --all-featurespassesplotters-svgbitmap_encoder tests: 7/7 passBackground
image0.25.10 introducedExtendedColorTypeas a superset ofColorTypeand updated the encoder API accordingly.ColorTypeimplementsInto<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.