Skip to content

craft-raw: count a TIFF image's chunks from its offsets table - #1102

Merged
dylanmtaylor merged 1 commit into
mainfrom
fix/craft-raw-tiff-table-chunks
Nov 12, 2026
Merged

dylanmtaylor merged 1 commit into
mainfrom
fix/craft-raw-tiff-table-chunks

Conversation

@dylanmtaylor

Copy link
Copy Markdown
Member

craft-tiff builds at most one chunk descriptor per byte of file (#827), so a grid of tiles all pointing at one small payload lists fewer chunks than the image declares. check_image compared that capped list against the grid and refused a file shorter than its tile count for missing chunks, before the byte-accounting check could refuse it for the data it actually holds. Compare info.offsets, the declared table, and cover the short-file case in tiles_sharing_one_payload_count_its_bytes_once.

This is the same one-line fix that resolved the lightcraft tiff regression in storytold/lightcraft#4165.

craft-tiff caps chunk descriptors at the file's length (#827), so a grid of tiles sharing one payload lists fewer chunks than the image declares. Comparing that capped list against the grid refused a file shorter than its tile count for "missing chunks" instead of for the data it actually holds. Compare the offsets table, which is the source of truth, and cover the short-file case.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8958340 and 7b78d56.

Files selected for processing: 1

  • crates/raw/src/tiffraw.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@dylanmtaylor
dylanmtaylor merged commit 80144af into main Nov 12, 2026
10 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.

1 participant