Skip to content

feat: expose TIFF.header_byte_size for prefetch sizing#302

Merged
kylebarron merged 4 commits into
mainfrom
kyle/header-byte-size
May 6, 2026
Merged

feat: expose TIFF.header_byte_size for prefetch sizing#302
kylebarron merged 4 commits into
mainfrom
kyle/header-byte-size

Conversation

@kylebarron
Copy link
Copy Markdown
Member

@kylebarron kylebarron commented May 6, 2026

Summary

  • Adds TIFF::header_byte_size() (Rust) and TIFF.header_byte_size (Python) returning the minimum non-zero offset across every IFD's TileOffsets and StripOffsets.
  • For a typical COG, this is the smallest prefetch= value that lets a future open complete metadata reading in a single request.
  • Pure function over already-parsed IFDs — no changes to the metadata reader, fetch, or IFD types.

Closes #301.

Test plan

  • New Rust test asserts the accessor matches the min-offset computation on an existing fixture.
  • New Python test mirrors the assertion through TIFF.open on the eox fixture.
  • `cargo test --all-features` — all 56 + 6 doctests pass.
  • `pytest` (python) — all 43 tests pass.

🤖 Generated with Claude Code

kylebarron added 2 commits May 6, 2026 11:31
Returns the minimum non-zero offset across every IFD's TileOffsets and
StripOffsets — the smallest prefetch that lets a future open complete
metadata reading in a single request for typical COG layouts.

Closes #301
Mirrors the Rust accessor so Python users can record the smallest
prefetch that lets a future TIFF.open complete in a single request.
@ds-release-bot ds-release-bot Bot added the feat label May 6, 2026
@kylebarron kylebarron merged commit 71aeed5 into main May 6, 2026
13 checks passed
@kylebarron kylebarron deleted the kyle/header-byte-size branch May 6, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose length of header metadata through TIFF

1 participant