diff --git a/src/nikonmn_int.cpp b/src/nikonmn_int.cpp index e7dee3d006..c9247e8faf 100644 --- a/src/nikonmn_int.cpp +++ b/src/nikonmn_int.cpp @@ -104,6 +104,16 @@ namespace Exiv2 { N_("Right-most") }; + //! Shutter Modes (credits to exiftool) + extern const TagDetails nikonShutterModes[] = { + { 0, "Mechanical" }, + { 16, "Electronic" }, + { 48, "Electronic Front Curtain" }, + { 64, "Electronic (Movie)" }, + { 80, "Auto (Mechanical)" }, + { 81, "Auto (Electronic Front Curtain)" } + }; + //! FlashComp, tag 0x0012 extern const TagDetails nikonFlashComp[] = { // From the PHP JPEG Metadata Toolkit @@ -589,6 +599,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, EXV_PRINT_TAG(nikonShutterModes)), + 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), diff --git a/tests/bugfixes/github/test_pr_1437.py b/tests/bugfixes/github/test_pr_1437.py index b240414783..29af8e236c 100644 --- a/tests/bugfixes/github/test_pr_1437.py +++ b/tests/bugfixes/github/test_pr_1437.py @@ -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 @@ -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