Skip to content

Improve BMP resumable decoder to resume at row-level#2744

Merged
197g merged 4 commits intoimage-rs:mainfrom
telecos:refactor/bmp-row-resumable
Jan 27, 2026
Merged

Improve BMP resumable decoder to resume at row-level#2744
197g merged 4 commits intoimage-rs:mainfrom
telecos:refactor/bmp-row-resumable

Conversation

@telecos
Copy link
Contributor

@telecos telecos commented Jan 26, 2026

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

@telecos telecos force-pushed the refactor/bmp-row-resumable branch from b0df3fd to 3ade962 Compare January 26, 2026 23:09
…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)
@telecos telecos force-pushed the refactor/bmp-row-resumable branch from 3ade962 to a7a518c Compare January 26, 2026 23:16
telecos and others added 3 commits January 27, 2026 00:24
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>
@telecos telecos marked this pull request as ready for review January 26, 2026 23:31
@telecos telecos requested a review from 197g January 26, 2026 23:31
@197g 197g merged commit 354a99d into image-rs:main Jan 27, 2026
32 checks passed
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.

2 participants