@@ -1465,6 +1465,37 @@ namespace Exiv2 {
14651465 return tagInfoLd3_;
14661466 }
14671467
1468+ // Nikon3 Lens Data 4 Tag Info
1469+ // based on https://exiftool.org/TagNames/Nikon.html#LensData0800
1470+ const TagInfo Nikon3MakerNote::tagInfoLd4_[] = {
1471+ TagInfo ( 0 , " Version" , N_ (" Version" ), N_ (" Version" ), nikonLd4Id, makerTags, undefined, 4 , printExifVersion),
1472+ TagInfo ( 4 , " ExitPupilPosition" , N_ (" Exit Pupil Position" ), N_ (" Exit pupil position" ), nikonLd4Id, makerTags, unsignedByte, 1 , printExitPupilPosition),
1473+ TagInfo ( 5 , " AFAperture" , N_ (" AF Aperture" ), N_ (" AF aperture" ), nikonLd4Id, makerTags, unsignedByte, 1 , printAperture),
1474+ TagInfo ( 9 , " FocusPosition" , N_ (" Focus Position" ), N_ (" Focus position" ), nikonLd4Id, makerTags, unsignedByte, 1 , printValue),
1475+ TagInfo (11 , " FocusDistance" , N_ (" Focus Distance" ), N_ (" Focus distance" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFocusDistance),
1476+ TagInfo (12 , " FocalLength" , N_ (" Focal Length" ), N_ (" Focal length" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFocal),
1477+ TagInfo (13 , " LensIDNumber" , N_ (" Lens ID Number" ), N_ (" Lens ID number" ), nikonLd4Id, makerTags, unsignedByte, 1 , printLensId4),
1478+ TagInfo (14 , " LensFStops" , N_ (" Lens F-Stops" ), N_ (" Lens F-stops" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFStops),
1479+ TagInfo (15 , " MinFocalLength" , N_ (" Min Focal Length" ), N_ (" Min focal length" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFocal),
1480+ TagInfo (16 , " MaxFocalLength" , N_ (" Max Focal Length" ), N_ (" Max focal length" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFocal),
1481+ TagInfo (17 , " MaxApertureAtMinFocal" , N_ (" Max Aperture At Min Focal" ), N_ (" Max aperture at min focal length" ), nikonLd4Id, makerTags, unsignedByte, 1 , printAperture),
1482+ TagInfo (18 , " MaxApertureAtMaxFocal" , N_ (" Max Aperture At Max Focal" ), N_ (" Max aperture at max focal length" ), nikonLd4Id, makerTags, unsignedByte, 1 , printAperture),
1483+ TagInfo (19 , " MCUVersion" , N_ (" MCU Version" ), N_ (" MCU version" ), nikonLd4Id, makerTags, unsignedByte, 1 , printValue),
1484+ TagInfo (20 , " EffectiveMaxAperture" , N_ (" Effective Max Aperture" ), N_ (" Effective max aperture" ), nikonLd4Id, makerTags, unsignedByte, 1 , printAperture),
1485+ TagInfo (48 , " LensID" , N_ (" LensID" ), N_ (" Lens ID" ), nikonLd4Id, makerTags, unsignedShort, 1 , printLensId4ZMount),
1486+ TagInfo (54 , " MaxAperture" , N_ (" Max Aperture" ), N_ (" Max aperture" ), nikonLd4Id, makerTags, unsignedShort, 1 , printApertureLd4),
1487+ TagInfo (56 , " FNumber" , N_ (" F-Number" ), N_ (" F-Number" ), nikonLd4Id, makerTags, unsignedShort, 1 , printApertureLd4),
1488+ TagInfo (60 , " FocalLength" , N_ (" Focal Length" ), N_ (" Focal length" ), nikonLd4Id, makerTags, unsignedShort, 1 , printFocalLd4),
1489+ TagInfo (79 , " FocusDistance" , N_ (" Focus Distance" ), N_ (" Focus distance" ), nikonLd4Id, makerTags, unsignedByte, 1 , printFocusDistance),
1490+ // End of list marker
1491+ TagInfo (0xffff , " (UnknownNikonLd4Tag)" , " (UnknownNikonLd4Tag)" , N_ (" Unknown Nikon Lens Data 3 Tag" ), nikonLd4Id, makerTags, unsignedByte, 1 , printValue)
1492+ };
1493+
1494+ const TagInfo* Nikon3MakerNote::tagListLd4 ()
1495+ {
1496+ return tagInfoLd4_;
1497+ }
1498+
14681499 std::ostream& Nikon3MakerNote::printIiIso (std::ostream& os,
14691500 const Value& value,
14701501 const ExifData*)
@@ -1790,6 +1821,13 @@ namespace Exiv2 {
17901821 return testConfigFile (os,value) ? os : printLensId (os, value, metadata, " NikonLd3" );
17911822 }
17921823
1824+ std::ostream& Nikon3MakerNote::printLensId4 (std::ostream& os,
1825+ const Value& value,
1826+ const ExifData* metadata)
1827+ {
1828+ return testConfigFile (os,value) ? os : printLensId (os, value, metadata, " NikonLd4" );
1829+ }
1830+
17931831 std::ostream& Nikon3MakerNote::printLensId (std::ostream& os,
17941832 const Value& value,
17951833 const ExifData* metadata,
@@ -2876,4 +2914,71 @@ fmountlens[] = {
28762914 return os << s;
28772915 }
28782916
2917+ std::ostream& Nikon3MakerNote::printLensId4ZMount (std::ostream& os,
2918+ const Value& value,
2919+ const ExifData*)
2920+ {
2921+ if (value.count () != 1 || value.typeId () != unsignedShort) {
2922+ return os << " (" << value << " )" ;
2923+ }
2924+
2925+ // from https://github.com/exiftool/exiftool/blob/12.12/lib/Image/ExifTool/Nikon.pm#L4646
2926+ static const struct ZMntLens {uint16_t lid; const char *manuf, *lensname;}
2927+ zmountlens[] = {
2928+ {1 , " Nikon" , " Nikkor Z 24-70mm f/4 S" },
2929+ {2 , " Nikon" , " Nikkor Z 14-30mm f/4 S" },
2930+ {4 , " Nikon" , " Nikkor Z 35mm f/1.8 S" },
2931+ {8 , " Nikon" , " Nikkor Z 58mm f/0.95 S Noct" }, // IB
2932+ {9 , " Nikon" , " Nikkor Z 50mm f/1.8 S" },
2933+ {11 , " Nikon" , " Nikkor Z DX 16-50mm f/3.5-6.3 VR" },
2934+ {12 , " Nikon" , " Nikkor Z DX 50-250mm f/4.5-6.3 VR" },
2935+ {13 , " Nikon" , " Nikkor Z 24-70mm f/2.8 S" },
2936+ {14 , " Nikon" , " Nikkor Z 85mm f/1.8 S" },
2937+ {15 , " Nikon" , " Nikkor Z 24mm f/1.8 S" }, // IB
2938+ {16 , " Nikon" , " Nikkor Z 70-200mm f/2.8 VR S" }, // IB
2939+ {17 , " Nikon" , " Nikkor Z 20mm f/1.8 S" }, // IB
2940+ {18 , " Nikon" , " Nikkor Z 24-200mm f/4-6.3 VR" }, // IB
2941+ {21 , " Nikon" , " Nikkor Z 50mm f/1.2 S" }, // IB
2942+ {22 , " Nikon" , " Nikkor Z 24-50mm f/4-6.3" }, // IB
2943+ {23 , " Nikon" , " Nikkor Z 14-24mm f/2.8 S" }, // IB
2944+ {0 , " " , " " } // end of array
2945+ };
2946+
2947+ uint16_t lid = static_cast <uint16_t >(value.toLong ());
2948+ for (int i = 0 ; zmountlens[i].lid != 0 ; ++i){
2949+ if ( zmountlens[i].lid == lid ) return os << zmountlens[i].manuf << " " << zmountlens[i].lensname ;
2950+ }
2951+ return os << lid;
2952+ }
2953+
2954+ std::ostream& Nikon3MakerNote::printApertureLd4 (std::ostream& os,
2955+ const Value& value,
2956+ const ExifData*)
2957+ {
2958+ if (value.count () != 1 || value.typeId () != unsignedShort) {
2959+ return os << " (" << value << " )" ;
2960+ }
2961+
2962+ double aperture = pow (2.0 , value.toLong ()/384.0 - 1.0 );
2963+ std::ostringstream oss;
2964+ oss.copyfmt (os);
2965+ os << std::fixed << std::setprecision (1 ) << " F" << aperture;
2966+ os.copyfmt (oss);
2967+ return os;
2968+ }
2969+ std::ostream& Nikon3MakerNote::printFocalLd4 (std::ostream& os,
2970+ const Value& value,
2971+ const ExifData*)
2972+ {
2973+ if (value.count () != 1 || value.typeId () != unsignedShort) {
2974+ return os << " (" << value << " )" ;
2975+ }
2976+ std::ostringstream oss;
2977+ oss.copyfmt (os);
2978+ os << std::fixed << std::setprecision (1 ) << value.toLong () << " mm" ;
2979+ os.copyfmt (oss);
2980+ return os;
2981+ }
2982+
2983+
28792984}} // namespace Internal, Exiv2
0 commit comments