Skip to content

Commit 51bd57e

Browse files
committed
add shutter mode and mechanical shutter count to nikon makernote 3
1 parent 9a89cc9 commit 51bd57e

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/nikonmn_int.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ namespace Exiv2 {
589589
TagInfo(0x0024, "WorldTime", N_("World Time"), N_("World time"), nikon3Id, makerTags, undefined, -1, printValue),
590590
TagInfo(0x0025, "ISOInfo", N_("ISO Info"), N_("ISO info"), nikon3Id, makerTags, undefined, -1, printValue),
591591
TagInfo(0x002a, "VignetteControl", N_("Vignette Control"), N_("Vignette control"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonOlnh)),
592+
TagInfo(0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), nikon3Id, makerTags, unsignedShort, -1, print0x0034),
593+
TagInfo(0x0037, "MechanicalShutterCount", N_("Mechanical Shutter Count"), N_("Mechanical shutter count"), nikon3Id, makerTags, unsignedLong, -1, printValue),
592594
TagInfo(0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), nikon3Id, makerTags, asciiString, -1, printValue),
593595
TagInfo(0x0081, "ToneComp", N_("Tone Compensation"), N_("Tone compensation"), nikon3Id, makerTags, asciiString, -1, printValue),
594596
TagInfo(0x0082, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), nikon3Id, makerTags, asciiString, -1, printValue),
@@ -1529,6 +1531,30 @@ namespace Exiv2 {
15291531
return os;
15301532
}
15311533

1534+
// shutter mode value conversions, taken from exiftool
1535+
std::ostream& Nikon3MakerNote::print0x0034(std::ostream& os,
1536+
const Value& value,
1537+
const ExifData*)
1538+
{
1539+
long focus = value.toLong();
1540+
switch (focus) {
1541+
case 0: os << "Mechanical";
1542+
break;
1543+
case 16: os << "Electronic";
1544+
break;
1545+
case 48: os << "Electronic Front Curtain";
1546+
break;
1547+
case 64: os << "Electronic (Movie)";
1548+
break;
1549+
case 80: os << "Auto (Mechanical)";
1550+
break;
1551+
case 81: os << "Auto (Electronic Front Curtain)";
1552+
break;
1553+
default: os << "Unknown Shutter Mode";
1554+
}
1555+
return os;
1556+
}
1557+
15321558
std::ostream& Nikon3MakerNote::print0x0083(std::ostream& os,
15331559
const Value& value,
15341560
const ExifData*)

src/nikonmn_int.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ namespace Exiv2 {
176176
static std::ostream& print0x0002(std::ostream& os, const Value& value, const ExifData*);
177177
//! Print autofocus mode
178178
static std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*);
179+
//! Print shutter mode
180+
static std::ostream& print0x0034(std::ostream& os, const Value& value, const ExifData*);
179181
//! Print lens type
180182
static std::ostream& print0x0083(std::ostream& os, const Value& value, const ExifData*);
181183
//! Print lens information
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import system_tests
4+
5+
class Nikon_ShutterMode_MechShutterCount(metaclass=system_tests.CaseMeta):
6+
url = "https://github.com/Exiv2/exiv2/pull/1444"
7+
filename = "$data_path/CH0_0174.exv"
8+
commands = ["$exiv2 -g shutter/i $filename"]
9+
stderr = [""]
10+
stdout = ["""Exif.Nikon3.ShutterMode Short 1 Auto (Electronic Front Curtain)
11+
Exif.Nikon3.MechanicalShutterCount Long 1 174
12+
Exif.Nikon3.ShutterCount Long 1 174
13+
"""]
14+
retval = [0]

0 commit comments

Comments
 (0)