fix(metadata): read exposure mode, interval shooting and RAW size from MakerNotes

BRIEF §9 lists exposure mode, intervalometer hints and sRaw flags among the MakerNote
fields; no vendor parser read them. The vendor exposure mode (Canon, Olympus,
Fujifilm, Panasonic, Sony) now fills ExposureProgram when Exif has none, Panasonic's
TimerRecording becomes FrameMetadata.IntervalShooting, and Canon's SRAWQuality and
Nikon's ImageSizeRAW / small NEF compression become FrameMetadata.RawSize. Nikon keeps
its interval-shooting state in the encrypted ShotInfo, which stays undecoded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-12 09:58:21 +00:00
1 parent d09b5a5cfb
commit 61e61702c6
10 files changed
+271 -7

No files matched your search

@@ -6,7 +6,8 @@ namespace Titano.Core.Metadata.MakerNotes;
/// <summary>
/// Olympus / OM System MakerNote. "OLYMPUS\0II\3\0" (IFD at +12) and "OM SYSTEM\0\0\0II\4\0" (IFD at +16) use offsets
/// relative to the MakerNote start and their own byte order; legacy "OLYMP\0" has its IFD at +8 relative to the
/// Exif TIFF. Equipment (0x2010) gives serial and lens; CameraSettings (0x2020) gives the ORF preview and stabiliser.
/// Exif TIFF. Equipment (0x2010) gives serial and lens; CameraSettings (0x2020) gives the ORF preview, the stabiliser
/// and the exposure mode.
/// </summary>
internal static class OlympusMakerNote
{
@@ -17,6 +18,7 @@ internal static class OlympusMakerNote
private const ushort PreviewImageValid = 0x0100;
private const ushort PreviewImageStart = 0x0101;
private const ushort PreviewImageLength = 0x0102;
private const ushort ExposureMode = 0x0200;
private const ushort ImageStabilization = 0x0604;
public static void Parse(TiffReader exif, long start, ReadOnlySpan<byte> header, MetadataBuilder m)
@@ -52,6 +54,15 @@ internal static class OlympusMakerNote
>= 1 and <= 4 => true,
_ => null,
};
// 1 Manual, 2 Program, 3 Aperture priority, 4 Shutter priority, 5 Program shift.
v.ExposureProgram ??= IfdValue.UInt(r, settings, ExposureMode) switch
{
1 => 1,
2 or 5 => 2,
3 => 3,
4 => 4,
_ => null,
};
if (IfdValue.UInt(r, settings, PreviewImageValid) != 0
&& IfdValue.UInt(r, settings, PreviewImageStart) is { } offset and > 0
&& IfdValue.UInt(r, settings, PreviewImageLength) is { } length and > 0)