Add ICO BMP encoder#3044
Open
RunDevelopment wants to merge 6 commits into
Open
Conversation
RunDevelopment
commented
Jun 15, 2026
Comment on lines
+91
to
+96
| pub fn as_bmp( | ||
| buf: &[u8], | ||
| width: u32, | ||
| height: u32, | ||
| color_type: ExtendedColorType, | ||
| ) -> ImageResult<Self> { |
Member
Author
There was a problem hiding this comment.
Can this be non-pub? I'm thinking we should be trying to reduce interfaces that take width, height, color, buf as separate parameters.
I mirrored as_png. I'm not against a nicer API, but I think it should be consistent for both.
Member
There was a problem hiding this comment.
Yeah, probably. I'll note it down for the review list of v1.0, it's not an absolute stopper for doing that as it's easily compatible (just a little legacy code to carry around).
RunDevelopment
commented
Jun 15, 2026
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.
Resolves #2192
This PR adds an ICO BMP encoder. It supports Rgba8 and Rgb8 image data. Rgb8 is encoded as 32-bit 0RGB as 24-bit 24-bit is not allowed.
The test currently fails because the decoder doesn't support 0RGB yet (#3012).
Since @197g reviewed most of this PR in an accidental commit in #3042, I'll recreate her comments here. I won't recreate comments I already resolved.