Skip to content

Commit 57bdd27

Browse files
authored
Merge pull request #1453 from hassec/nikon_shuttermode
Add shutter mode and mechanical shutter count to nikon makernote 3
2 parents 9a89cc9 + 056359d commit 57bdd27

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/nikonmn_int.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@ namespace Exiv2 {
104104
N_("Right-most")
105105
};
106106

107+
//! Shutter Modes (credits to exiftool)
108+
extern const TagDetails nikonShutterModes[] = {
109+
{ 0, "Mechanical" },
110+
{ 16, "Electronic" },
111+
{ 48, "Electronic Front Curtain" },
112+
{ 64, "Electronic (Movie)" },
113+
{ 80, "Auto (Mechanical)" },
114+
{ 81, "Auto (Electronic Front Curtain)" }
115+
};
116+
107117
//! FlashComp, tag 0x0012
108118
extern const TagDetails nikonFlashComp[] = {
109119
// From the PHP JPEG Metadata Toolkit
@@ -589,6 +599,8 @@ namespace Exiv2 {
589599
TagInfo(0x0024, "WorldTime", N_("World Time"), N_("World time"), nikon3Id, makerTags, undefined, -1, printValue),
590600
TagInfo(0x0025, "ISOInfo", N_("ISO Info"), N_("ISO info"), nikon3Id, makerTags, undefined, -1, printValue),
591601
TagInfo(0x002a, "VignetteControl", N_("Vignette Control"), N_("Vignette control"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonOlnh)),
602+
TagInfo(0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonShutterModes)),
603+
TagInfo(0x0037, "MechanicalShutterCount", N_("Mechanical Shutter Count"), N_("Mechanical shutter count"), nikon3Id, makerTags, unsignedLong, -1, printValue),
592604
TagInfo(0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), nikon3Id, makerTags, asciiString, -1, printValue),
593605
TagInfo(0x0081, "ToneComp", N_("Tone Compensation"), N_("Tone compensation"), nikon3Id, makerTags, asciiString, -1, printValue),
594606
TagInfo(0x0082, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), nikon3Id, makerTags, asciiString, -1, printValue),

tests/bugfixes/github/test_pr_1437.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
import system_tests
44

5+
# extended to also test include shutter mode and mechanical shutter count (pr 1444)
56
class Nikon_LensData8(metaclass=system_tests.CaseMeta):
67
url = "https://github.com/Exiv2/exiv2/pull/1437"
78
filename = "$data_path/CH0_0174.exv"
8-
commands = ["$exiv2 -g lens/i -g aperture/i $filename"]
9+
commands = ["$exiv2 -g lens/i -g aperture/i -g shutter/i $filename"]
910
stderr = [""]
10-
stdout = ["""Exif.Nikon3.LensType Byte 1 D G VR
11+
stdout = ["""Exif.Nikon3.ShutterMode Short 1 Auto (Electronic Front Curtain)
12+
Exif.Nikon3.MechanicalShutterCount Long 1 174
13+
Exif.Nikon3.LensType Byte 1 D G VR
1114
Exif.Nikon3.Lens Rational 4 70-200mm F2.8
1215
Exif.Nikon3.LensFStops Undefined 4 6
1316
Exif.NikonLd4.AFAperture Byte 1 F2.8
@@ -18,6 +21,7 @@ class Nikon_LensData8(metaclass=system_tests.CaseMeta):
1821
Exif.NikonLd4.EffectiveMaxAperture Byte 1 F2.8
1922
Exif.NikonLd4.LensID Short 1 0
2023
Exif.NikonLd4.MaxAperture Short 1 F0.5
24+
Exif.Nikon3.ShutterCount Long 1 174
2125
Exif.Photo.LensSpecification Rational 4 700/10 2000/10 280/100 280/100
2226
Exif.Photo.LensMake Ascii 6
2327
Exif.Photo.LensModel Ascii 65

0 commit comments

Comments
 (0)