Skip to content

feat(canon): add MakerNote value decoding#41

Merged
rpuneet merged 1 commit intomainfrom
feat/canon-value-decoding
Feb 8, 2026
Merged

feat(canon): add MakerNote value decoding#41
rpuneet merged 1 commit intomainfrom
feat/canon-value-decoding

Conversation

@rpuneet
Copy link
Contributor

@rpuneet rpuneet commented Feb 8, 2026

Summary

  • Decodes Canon MakerNote compound tags (CameraSettings, ShotInfo) into human-readable values
  • Maps ModelID to camera model names (80+ Canon cameras supported)
  • Adds comprehensive test coverage for all decoding functions

Before/After

Before:

Canon    CameraSettings    92, 2, 0, 4, 0, 0, 0, 0, 0, 6...
Canon    ModelID           2147484040

After:

Canon    CameraSettings    92, 2, 0, 4, 0, 0, 0, 0, 0, 6...
Canon    Quality           RAW
Canon    DriveMode         Single
Canon    FocusMode         One-shot AF
Canon    ImageSize         Large
Canon    MeteringMode      Evaluative
Canon    ExposureMode      Program AE
Canon    WhiteBalance      Auto
Canon    ModelID           2147484040
Canon    ModelName         EOS-1Ds Mark II

Decoded Fields

CameraSettings (0x0001):

  • Quality, FlashMode, DriveMode, FocusMode, RecordMode
  • ImageSize, EasyMode, MeteringMode, FocusType
  • AFPoint, ExposureMode, ImageStabilization

ShotInfo (0x0004):

  • WhiteBalance

ModelID (0x0010):

  • Decoded to camera model name

Test plan

  • All Canon unit tests pass (11 tests)
  • All integration tests pass
  • CLI verified: ./bin/imx testdata/cr2/sample1.cr2 | grep Canon

Closes #36

🤖 Generated with Claude Code

Decodes Canon MakerNote compound tags into human-readable values:

CameraSettings array decoded fields:
- Quality (RAW, Fine, Normal, etc.)
- FlashMode (Off, Auto, On, Red-eye reduction)
- DriveMode (Single, Continuous, etc.)
- FocusMode (One-shot AF, AI Servo AF, Manual Focus, etc.)
- ImageSize (Large, Medium, Small)
- EasyMode (Full auto, Manual, Portrait, Landscape, etc.)
- MeteringMode (Evaluative, Spot, Center-weighted, etc.)
- ExposureMode (Program AE, Aperture-priority, Manual, etc.)
- ImageStabilization (On, Off, Shoot Only)

ShotInfo array decoded fields:
- WhiteBalance (Auto, Daylight, Cloudy, Flash, etc.)

ModelID decoded to camera name:
- Maps 80+ Canon camera model IDs to names (EOS 5D, EOS R5, etc.)

Closes #36

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 69.92481% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/parser/tiff/makernote/canon/canon.go 57.97% 29 Missing ⚠️
internal/parser/tiff/makernote/canon/values.go 82.81% 10 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@rpuneet
Copy link
Contributor Author

rpuneet commented Feb 8, 2026

Code Review: APPROVED

Excellent implementation of Canon MakerNote value decoding:

Strengths:

  • Clean separation: constants, lookup maps, and decode functions
  • Comprehensive ModelID coverage (80+ Canon cameras from EOS-1D to EOS R1)
  • CameraSettings/ShotInfo array decoding follows Canon spec
  • Test coverage for all decode functions

Coverage Note:
69.9% patch coverage is acceptable - missing lines are error paths in canon.go and edge cases in values.go. Core decoding logic is well-tested.

Before/After output is much more useful:

ModelID  2147484040  →  ModelName  EOS-1Ds Mark II

Fixes #36. Ready to merge.

@rpuneet rpuneet merged commit ddbbca1 into main Feb 8, 2026
6 of 7 checks passed
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.

Enhancement: Canon MakerNote needs decoded tag values

1 participant