Improve BMP resumable decoder to resume at row-level#2744
Merged
197g merged 4 commits intoimage-rs:mainfrom Jan 27, 2026
Merged
Improve BMP resumable decoder to resume at row-level#2744197g merged 4 commits intoimage-rs:mainfrom
197g merged 4 commits intoimage-rs:mainfrom
Conversation
b0df3fd to
3ade962
Compare
…ble helper
- Refactor DecoderState enum to store row progress in variants (RowData { rows_decoded })
- Add with_rows_resumable helper function to reduce code duplication
- Update all row-based decoders to use the helper:
- read_palettized_pixel_data
- read_16_bit_pixel_data
- read_32_bit_pixel_data
- read_full_byte_pixel_data
- Add consolidated test for resumable row decoding
- RLE decoding remains non-resumable at row level (restarts on UnexpectedEof)
3ade962 to
a7a518c
Compare
197g
reviewed
Jan 26, 2026
Co-authored-by: Aurelia Molzer <5550310+197g@users.noreply.github.com>
Co-authored-by: Aurelia Molzer <5550310+197g@users.noreply.github.com>
Co-authored-by: Aurelia Molzer <5550310+197g@users.noreply.github.com>
197g
approved these changes
Jan 27, 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.
This PR extends the coarse-grained resumable decoding from #2738 to support row-level progress tracking for non-RLE BMP formats. When decoding is interrupted by UnexpectedEof, the decoder can now resume from the last successfully decoded row rather than restarting from the beginning.
This is a work towards #2696