Commit f15837c
committed
Support multi-page TIFF preview IFD chains
Add support for TIFF preview/preview-page IFD chains by introducing a page-oriented IFD slot and plumbing it through parsing, building, and time-patch logic.
Key changes:
- README wording clarified to describe bounded preview-page chain rewrite and preserved downstream tails.
- Replaced Ifd1 with a generic page slot (ExifIfdSlot::IfdPage) and extended TransferExifIfdRef with page_index and is_page.
- Added parse_ifd_page_index_name to parse numbered IFD names (ifdN). Classified page refs during metadata classification.
- Store and handle page IFDs in vectors (page_ifds) instead of a single ifd1. Implemented resizing, sorting, entry serialization, value placement, and time-patch mapping for page IFDs.
- Parsing: follow and validate preview IFD chains, prevent loops and excessive length, and populate parsed_exif.page_ifds. Preserve extra existing page IFDs when merging.
- Writing: assemble page chains, set next offsets correctly, and ensure first_page_ifd_off is used as the rewritten next-ifd offset from IFD0.
- Updated endian conversion and parsing/clearing logic to handle multiple page_ifds.
- Tests: added helpers to construct minimal three-page TIFF/BigTIFF fixtures and multiple tests validating multi-page chain round-trip, tail preservation, and updated expectations (use >= offsets). Adjusted existing tests to assert chain behavior.
These changes enable handling of multiple preview pages (ifdN) in EXIF/TIFF transfers, preserving existing downstream page tails and ensuring correct serialization/deserialization.1 parent c99d107 commit f15837c
File tree
3 files changed
+603
-57
lines changed- src/openmeta
- tests
3 files changed
+603
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
0 commit comments