Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/nikonmn_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ namespace Exiv2 {
TagInfo(0x0024, "WorldTime", N_("World Time"), N_("World time"), nikon3Id, makerTags, undefined, -1, printValue),
TagInfo(0x0025, "ISOInfo", N_("ISO Info"), N_("ISO info"), nikon3Id, makerTags, undefined, -1, printValue),
TagInfo(0x002a, "VignetteControl", N_("Vignette Control"), N_("Vignette control"), nikon3Id, makerTags, unsignedShort, -1, EXV_PRINT_TAG(nikonOlnh)),
TagInfo(0x0034, "ShutterMode", N_("Shutter Mode"), N_("Shutter mode"), nikon3Id, makerTags, unsignedShort, -1, print0x0034),
TagInfo(0x0037, "MechanicalShutterCount", N_("Mechanical Shutter Count"), N_("Mechanical shutter count"), nikon3Id, makerTags, unsignedLong, -1, printValue),
TagInfo(0x0080, "ImageAdjustment", N_("Image Adjustment"), N_("Image adjustment setting"), nikon3Id, makerTags, asciiString, -1, printValue),
TagInfo(0x0081, "ToneComp", N_("Tone Compensation"), N_("Tone compensation"), nikon3Id, makerTags, asciiString, -1, printValue),
TagInfo(0x0082, "AuxiliaryLens", N_("Auxiliary Lens"), N_("Auxiliary lens (adapter)"), nikon3Id, makerTags, asciiString, -1, printValue),
Expand Down Expand Up @@ -1529,6 +1531,30 @@ namespace Exiv2 {
return os;
}

// shutter mode value conversions, taken from exiftool
std::ostream& Nikon3MakerNote::print0x0034(std::ostream& os,
const Value& value,
const ExifData*)
{
long focus = value.toLong();
switch (focus) {
case 0: os << "Mechanical";
break;
case 16: os << "Electronic";
break;
case 48: os << "Electronic Front Curtain";
break;
case 64: os << "Electronic (Movie)";
break;
case 80: os << "Auto (Mechanical)";
break;
case 81: os << "Auto (Electronic Front Curtain)";
break;
default: os << "Unknown Shutter Mode";
}
return os;
}

std::ostream& Nikon3MakerNote::print0x0083(std::ostream& os,
const Value& value,
const ExifData*)
Expand Down
2 changes: 2 additions & 0 deletions src/nikonmn_int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ namespace Exiv2 {
static std::ostream& print0x0002(std::ostream& os, const Value& value, const ExifData*);
//! Print autofocus mode
static std::ostream& print0x0007(std::ostream& os, const Value& value, const ExifData*);
//! Print shutter mode
static std::ostream& print0x0034(std::ostream& os, const Value& value, const ExifData*);
//! Print lens type
static std::ostream& print0x0083(std::ostream& os, const Value& value, const ExifData*);
//! Print lens information
Expand Down
8 changes: 6 additions & 2 deletions tests/bugfixes/github/test_pr_1437.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import system_tests

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