Repository navigation
Conversation
wilx
force-pushed
the
fix-cr3-full-preview
branch
4 times, most recently
from
November 4, 2026 23:34
e5e47a1 to
8d2ea37
Compare
Represent boxes, item locations, references, and properties as checked ranges in seekable input without copying encoded image payloads. Retain all item IDs and extents, including file-relative and idat-relative data. Bound structural work and reject malformed addressing and relationships. Keep write eligibility separate so opaque content can be inspected while unsupported layouts are rejected before future rewriting. Register the private model in CMake and Meson; leave production writing disabled.
Add 41 synthetic and corpus cases covering supported field widths and versions, references, properties, shared ranges, malformed boundaries, resource limits, I/O failures, and an 8 GiB sparse input. Check real HEIF and AVIF fixtures against expectations from an independent inventory. Verify that deferred formats and unsafe layouts are rejected and that production metadata writing remains disabled. Register the tests in CMake and Meson, linking the private library for Meson unit tests.
Rebuild item tables and relocate streamed payload ranges while removing obsolete primary metadata, unused media bytes, and padding. Reject shared metadata edits, ambiguous XMP MIME types, and unsupported relocation before writing, then verify the prepared output. Related to Exiv2#2349. This private engine adds no image codec dependency.
Register supported HEIF files through a private BmffImage subclass. Use fresh metadata serialization and compact rewriting for primary Exif/XMP updates and removal, with byte-identical no-ops and preservation checks. Keep AVIF, CR3, and JPEG XL writing disabled. Prepare local file output on disk before transfer; final replacement retains the existing BasicIo failure contract and is not atomic. Related to Exiv2#2349.
Exercise compact rewriting, public metadata APIs, and CLI operations with synthetic containers and existing HEIF fixtures. Check obsolete-byte absence, repeated edits, retained payloads, large offsets, and failures. Related to Exiv2#2349.
Keep MIME and embedded XMP packets available during Exif edits without the XMP toolkit. Reject structured edits and ambiguous packet merges, while allowing explicit raw replacement and removal. Clear cached raw packets with structured XMP data to avoid restoring removed metadata.
Exercise raw packet preservation, replacement, embedded XMP promotion and physical removal. Check rejection of ambiguous packet merges and structured edits. Use raw packets for applicable feature-disabled tests and skip only cases that require structured XMP decoding.
Index metadata keys while keeping ordered values. Preserve last-item precedence and duplicate Exif tags within the winning item without repeatedly scanning every previously decoded tag.
Check that the last item replaces a duplicate tag group while retaining unrelated fields and both duplicate values from the winning item.
Extend both read/write fuzz drivers with deterministic Exif updates and metadata clears, followed by a reread. This exercises serialization and compaction in addition to unchanged writes on owned MemIo inputs.
Update format capabilities and document supported layouts, physical metadata removal, shared-data rejection, feature-disabled behavior and final-transfer limitations. Explain factory selection of the writer. Related to Exiv2#2349; CR3 writing remains outside this HEIF change.
Describe shared structures, field coordinates, parsing limits and payload ownership. Document parser and write-eligibility interfaces.
Describe parser helpers and separate boundary, resource-budget and item graph checks with comments and spacing.
Explain preserve/remove/replace requests, stream ownership and positioning, allocation limits and prepared-output failure handling.
Describe range ownership, shared-data rejection, layout promotion and prepared-output verification. Separate the main rewriting steps.
Describe factory ownership and probe positioning without promising that a recognized container supports metadata writing.
Describe metadata precedence, embedded XMP handling, fresh serialization and staging lifetime. Clarify cleanup intent and final-transfer limits.
Explain fixture layouts, I/O doubles, mutations and preservation checks. Separate setup, editing and assertions without changing test behavior.
Describe disposable fixtures, metadata round trips, obsolete-byte checks and staging or destination failures. Separate the edit sequences.
Describe helper inputs and error propagation, and explain how metadata mutation exercises serialization, compaction and the subsequent reread.
Keep the merged embedded XMP when an unrelated Exif field changes. Honor explicit raw-packet edits and verify regenerated packets through their decoded properties.
Clear all buffered metadata before invoking the legacy reader while retaining the narrower semantics of explicit HEIF metadata clears.
Delegate MIME reporting to the successful legacy reader and reset that choice when adopting native metadata.
Initialize XMLPacket and Canon AFInfo keys once on first use and reuse them for lookups. Keep string conversion outside metadata scan loops.
Move checked box headers, bounded cursors and read budgets into a private format-independent reader. Route the HEIF item parser through it without changing item validation or write eligibility. Add generic container tests and register the new code with CMake and Meson.
Extract a reusable item model and parser with explicit limits and format policy hooks. Keep HEIF admission, metadata selection, Canon handling and relocation rules in a dedicated adapter. Rename the HEIF-specific writer and update both build systems and tests.
Separate box measurement, placement, relocation maps and bounded I/O from HEIF edit policy. Keep iloc encoding and layout convergence in the item layer, with HEIF retaining range ownership and metadata verification. Register the private layers in CMake and Meson and add focused layout, relocation, header-promotion and I/O regressions.
Use a private adapter for legacy metadata decoding and structure output, retaining format-specific behavior and the existing BmffImage ABI. Share counted traversal and FullBox field decoding with the item parser. Reject malformed UUID and container boundaries and propagate structural I/O failures. Add compatibility and hardening regressions.
Describe shared box, item and output mechanics and their format adapters. Link the internal guide from the focused testing documentation.
Resolve the source buffer range before taking the destination end iterator. This avoids GCC 15 bounds warnings caused by argument evaluation order in the two failing vector insertions.
Replace the nine annotated subscript expressions with at(), preserving the existing bounds guards and unflagged accesses.
Separate embedded XMP decoding from error enforcement to avoid incorrect argument passing in MSVC x86 Debug builds. Normalize CRLF output in the HEIF CLI test helper. Validated with MSVC 19.44 x86 Debug: 518 unit tests passed with five expected skips; three HEIF CLI tests passed with one expected POSIX-only skip.
(cherry picked from commit 168993b)
Probe whether directory and file write restrictions are enforced before testing those failure paths. Split the checks so an unsupported staging restriction does not skip destination-open coverage. Validated the original false failure and corrected permission checks with the local CLI; the HEIF regression file passes with expected platform skips.
Give the full unit-test executable a bounded 120-second timeout. In PR Exiv2#9531, macOS sanitizer and FreeBSD VM jobs passed the large Exif boundary cases but exhausted Meson's 30-second default during later XMP concurrency tests. Retain every test and assertion. Validated the registered timeout change and unchanged limits for other test groups. All 400 unit tests passed on MSVC x86 Debug forcefallback, including the 35 focused JPEG/EXV tests. Native platform checks await CI. (cherry picked from commit 1ef5e05)
Resolve single-sample BMFF tables and Canon CRAW/JPEG descriptions through the shared box reader. Expose the embedded JPEG alongside THMB/PRVW using the existing native preview API. Rebuild CR3 preview state on metadata reads and keep structure printing from accumulating duplicate entries. Fixes Exiv2#2854.
Normalize CRLF in the captured textual listing before comparison. Keep extracted JPEG and source-preservation checks byte exact. Validated with MSVC 19.44 x86 Debug: the CR3 CLI regressions pass, the inherited HEIF CLI tests pass with expected skips, and the full unit-test suite passes.
wilx
force-pushed
the
fix-cr3-full-preview
branch
from
November 22, 2026 15:24
8d2ea37 to
cc366c3
Compare
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9541 +/- ##
==========================================
+ Coverage 65.28% 67.36% +2.08%
==========================================
Files 117 129 +12
Lines 21859 23681 +1822
Branches 10806 11780 +974
==========================================
+ Hits 14270 15953 +1683
- Misses 5324 5336 +12
- Partials 2265 2392 +127 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2854.
Stacked on #9527 and depends on its shared BMFF infrastructure. This PR includes those prerequisite commits until #9527 is merged; the CR3 change is the final commit.
Extract the full-resolution JPEG from ordinary single-sample CR3 CRAW/JPEG tracks through the existing preview API and CLI. Preserve THMB/PRVW and stop CR3 previews accumulating on repeated reads or structure printing. CR3 remains read-only.
Local Linux validation: full serial debug CTest 8/8; focused debug, no-XMP, ASan/UBSan and Meson tests; BMFF-disabled/video-disabled builds; 30-second preview fuzzing. Extracted JPEGs from real RAW/C-RAW samples match ExifTool byte-for-byte. Sanitizer/fuzz validation disabled optional network support to avoid an external library startup leak.
AI assistance: OpenAI Codex assisted with implementation, tests and documentation and ran local validation.