Skip to content

feat(makernote/canon): implement Canon MakerNote parser#24

Merged
rpuneet merged 1 commit intomainfrom
feat/canon-makernote
Feb 7, 2026
Merged

feat(makernote/canon): implement Canon MakerNote parser#24
rpuneet merged 1 commit intomainfrom
feat/canon-makernote

Conversation

@rpuneet
Copy link
Contributor

@rpuneet rpuneet commented Feb 7, 2026

Summary

  • Implements Canon MakerNote parser (MNI-2, Issue MNI-2: Canon MakerNote Parser #11)
  • Handler with detection, IFD parsing, 70+ tag name mappings
  • Handles all TIFF data types including inline data
  • Canon format: no header, IFD at offset 0, absolute offsets

Test plan

  • Unit tests for Manufacturer(), Detect(), Parse(), TagName()
  • Tests for inline data handling
  • Tests for both little-endian and big-endian
  • All 22 packages passing

🤖 Generated with Claude Code

MNI-2 implementation:
- Canon handler implementing makernote.Handler interface
- Detection based on valid IFD entry count (no header)
- Parses all TIFF data types (BYTE, ASCII, SHORT, LONG, RATIONAL, etc.)
- Handles inline data (<=4 bytes in value field)
- 70+ Canon-specific tag name mappings
- Comprehensive unit tests

Canon format specifics:
- No header - IFD starts at offset 0
- Inherits byte order from parent EXIF
- Uses absolute offsets (relative to EXIF TIFF header)
- HasNextIFD=false (ignore CR2 non-zero values)

Issue #11

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

❌ Patch coverage is 37.37374% with 186 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/parser/tiff/makernote/canon/canon.go 37.37% 167 Missing and 19 partials ⚠️

📢 Thoughts on this report? Let us know!

@rpuneet
Copy link
Contributor Author

rpuneet commented Feb 7, 2026

Review: Canon MakerNote Parser (tech-lead-01)

Status: APPROVED

Summary

Comprehensive Canon MakerNote implementation matching our design spec.

Positive Findings

  1. Format handling correct:

    • No header, IFD at offset 0 ✓
    • Absolute offsets (relative to EXIF TIFF header) ✓
    • Inherits byte order, tries LE first then BE ✓
    • Ignores next-IFD pointer (CR2 quirk) ✓
  2. Implementation (585 lines):

    • All TIFF data types supported (BYTE through SRATIONAL)
    • Inline data optimization (<=4 bytes in value field)
    • 70+ tag name mappings
  3. Tests (305 lines):

    • Detect validation (entry count, type checks)
    • Parse with constructed test data
    • Inline data handling
    • Both LE and BE byte order
  4. Detection robustness:

    • Validates entry count 1-100
    • Checks first entry has valid tag type (1-12)
    • Won't false-positive on Nikon headers

LGTM. Merging now.

@rpuneet rpuneet merged commit 72a3f1f into main Feb 7, 2026
6 of 7 checks passed
rpuneet added a commit that referenced this pull request Feb 7, 2026
Fixes #29

The Canon MakerNote parser was merged (PR #24) but not registered
in the MakerNote registry, causing Canon metadata to not be extracted.

Canon must be registered LAST as it has no header and uses IFD
structure validation as fallback detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant