You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bounded 32-bit item-id insertion for BMFF targets that use iloc v2 while preserving 16-bit behavior for iloc v0/1. Expand metadata_transfer to use 32-bit item_id storage/allocation, emit infe v3 when wider IDs are needed, and select iref version/id-widths appropriately (with safe failure when ID space is exhausted). Fix container scanning to read iinf version 1 entry counts as 32-bit. Update iloc/infe/iref read/write paths to honor input id-widths and avoid truncation, and adjust casts where needed. Add unit tests exercising iloc v2 targets with high item IDs and update multiple docs (CHANGES, development, metadata backend/plan, writer target contract) to document the new behavior and limits.
Copy file name to clipboardExpand all lines: docs/metadata_transfer_plan.md
+21-6Lines changed: 21 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The first public write-side sync controls are also in place:
55
55
| WebP | Bounded but real | Prepared bundle, compiled emit, bounded chunk rewrite/edit, file-helper roundtrip | Not a general WebP chunk editor |
56
56
| JP2 | Bounded but real | Prepared bundle, compiled emit, bounded box rewrite/edit, file-helper roundtrip |`jp2h` synthesis is still out of scope |
57
57
| JXL | Bounded but real | Prepared bundle, compiled emit, bounded box rewrite/edit, file-helper roundtrip | Still narrower than JPEG/TIFF |
58
-
| HEIF / AVIF / CR3 | Bounded but real | Prepared bundle, compiled emit, OpenMeta-managed BMFF item/property edit, constrained foreign-`meta` item merge/replacement/strip plus bounded ICC property merge, file-helper roundtrip | Not broad BMFF writer parity; arbitrary foreign `meta` scene/property-graph rewrite is still unsupported |
58
+
| HEIF / AVIF / CR3 | Bounded but real | Prepared bundle, compiled emit, OpenMeta-managed BMFF item/property edit, constrained foreign-`meta` item merge/replacement/strip plus bounded ICC property merge, file-helper roundtrip | Not broad BMFF writer parity; arbitrary foreign `meta` scene/property-graph rewrite is still unsupported; 32-bit inserted item IDs require existing `iloc` v2|
59
59
| EXR | Bounded but real | Prepared bundle, compiled emit, direct backend attribute emit, prepared-bundle to `ExrAdapterBatch` bridge, CLI/Python transfer surface | No file rewrite/edit path yet; current transfer payload is safe string attributes only |
60
60
61
61
## What Is Already Implemented
@@ -304,6 +304,9 @@ Implemented as a bounded BMFF target family:
304
304
- constrained foreign top-level `meta` item merge for parseable `iinf`,
305
305
`iloc` version 0/1/2, `pitm`, optional single `idat`, and primary-item `cdsc`
306
306
references
307
+
- bounded 32-bit item-id insertion for foreign item graphs that already use
308
+
`iloc` version 2; `iloc` version 0/1 targets remain constrained to 16-bit
|`JP2`| top-level `Exif`, top-level XMP `xml` box, `jp2h/colr` ICC | Replace matching top-level metadata boxes; rewrite `jp2h` only to replace/insert `colr`; preserve unrelated boxes and unrelated `jp2h` children | Does not synthesize `jp2h`; requires one existing `jp2h` for ICC |
61
61
|`JXL`| top-level `Exif`, XMP `xml` box, `jumb`, `c2pa`| Replace matching top-level boxes; preserve signature and non-managed boxes; classify `jumb` as generic JUMBF or C2PA | ICC is encoder handoff only; file edit emits uncompressed prepared metadata boxes |
62
-
|`HEIF` / `AVIF` / `CR3`| BMFF metadata items (`Exif`, XMP `mime`, JUMBF/C2PA), bounded `colr/prof` ICC properties, plus OpenMeta-authored metadata-only `meta` boxes | Preserve non-`meta` top-level boxes; replace prior OpenMeta-authored metadata `meta`; merge/replace/strip item metadata in parseable foreign top-level `meta` graphs by extending `iinf`/`iloc`/`idat`/`iref`; replace prior ICC `colr` properties and remap `iprp`/`ipco`/`ipma` for bounded ICC | Does not rewrite arbitrary BMFF scene/property graphs |
62
+
|`HEIF` / `AVIF` / `CR3`| BMFF metadata items (`Exif`, XMP `mime`, JUMBF/C2PA), bounded `colr/prof` ICC properties, plus OpenMeta-authored metadata-only `meta` boxes | Preserve non-`meta` top-level boxes; replace prior OpenMeta-authored metadata `meta`; merge/replace/strip item metadata in parseable foreign top-level `meta` graphs by extending `iinf`/`iloc`/`idat`/`iref`; replace prior ICC `colr` properties and remap `iprp`/`ipco`/`ipma` for bounded ICC | Does not rewrite arbitrary BMFF scene/property graphs; 32-bit item-id insertion requires existing `iloc` v2|
63
63
|`EXR`| safe string header attributes through the EXR transfer emitter or adapter batch | No file rewrite contract today; host applies prepared attributes through its own EXR writer | Attribute-emitter target, not a file edit path |
64
64
65
65
## JPEG
@@ -192,6 +192,12 @@ graphs it merges, replaces, or strips bounded Exif/XMP/JUMBF/C2PA metadata
192
192
items in the existing `meta` by extending `iinf`, `iloc`, `idat`, and `iref`
193
193
with `cdsc` references to the primary item. This constrained merge requires a
194
194
single parseable `iinf`, `iloc` version 0/1/2, `pitm`, and at most one `idat`.
195
+
For `iloc` version 0/1 targets, inserted item IDs remain in the 16-bit item-id
196
+
space. For `iloc` version 2 targets, OpenMeta can allocate 32-bit item IDs and
197
+
uses `infe` version 3 plus `iref` version 1 when a newly inserted item needs
198
+
that wider ID space. If the existing graph has exhausted the usable item-id
199
+
space or mixes item-table widths outside this shape, the edit fails instead of
200
+
truncating IDs.
195
201
For bounded ICC transfer, OpenMeta removes prior ICC `colr/prof` and
196
202
`colr/rICC` properties from `iprp/ipco`, compacts/remaps existing `ipma`
197
203
associations, appends the transferred `colr/prof` property, and associates it
0 commit comments