Feature: Add Canon CR3 raw file support and shared ISOBMFF box walker - #731
Open
purno998 wants to merge 3 commits into
Open
Feature: Add Canon CR3 raw file support and shared ISOBMFF box walker#731purno998 wants to merge 3 commits into
purno998 wants to merge 3 commits into
Conversation
added 3 commits
May 26, 2026 15:15
infrastructure. Designed so other readers (MP4, QuickTime, HEIF) can migrate onto it; CR3 is the first consumer.
IsoBoxWalker. Decodes the three Canon uuid blocks: CMT1-CMT4 (TIFF blobs feeding ExifTiffHandler for IFD0, ExifSubIFD, Canon makernote and GPS), the XMP uuid (delegated to XmpReader), and the preview uuid (PRVW dimensions). Thumbnail dimensions are read from the THMB box and the compressor version from CNCV.
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.
Summary
Introduces a shared ISO Base Media File Format (ISOBMFF) box-walker that handles standard/large-size boxes, EOF-terminated boxes, and
uuidboxes with automatic usertype parsing. Designed so existing MP4/QuickTime/HEIF readers can migrate onto it in later, CR3 is the first consumer.Adds
Cr3MetadataReaderand a three-tier handler hierarchy (Cr3Handler→Cr3CanonUuidHandler/Cr3PreviewUuidHandler) that decodes all three Canon UUID blocks found in CR3 files:ExifTiffHandler, populatingExifIFD0Directory,ExifSubIFDDirectory,CanonMakernoteDirectory, andGpsDirectorywithout any new TIFF parsing logic.XmpReader.PRVWbox header decoded for preview dimensions.Cr3Directory.FileType.CrxthroughImageMetadataReader.Extends
CanonMakernoteDirectoryandCanonMakernoteDescriptorwith tags present on EOS R / RF-mount bodies:FocalType,FocusBracketing,Clarity,HDR-PQ, five additional0x40xxarray tags, and 30 RF lens entries. FixesFlashDetailsto use a proper bitmask. UpdatesContrast,Saturation, andSharpnessdescriptors to handle signedint16 adjustment values from newer bodies while preserving existing
Low/Normal/Highlabels for older cameras.Notable design decisions
No new TIFF parsing. CMT1–CMT4 are self-contained TIFF byte streams; reusing
TiffReader+ExifTiffHandler.FixedRootExifTiffHandleroverridessetTiffMarkerto push the correct root directory class (ExifSubIFD, Canon makernote, GPS) before IFD traversal begins.Existing readers untouched.
Mp4Reader,QuickTimeReader, andHeifReaderare not modified. The shared walker is user by CR3 first, migrating the three legacy readers is a deliberate follow-up to keep this PR reviewable.Backward-compatible descriptor changes. The specific values that old Canon cameras write for Contrast/Saturation/Sharpness (
0,1,0xFFFF) continue to return"Normal","High","Low". Only values outside that set use the new signed-integer path.Sample output — Canon EOS R8