exiftool_vendored 12.55.0 → 12.57.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +38 -1
  3. data/bin/MANIFEST +5 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +19 -19
  7. data/bin/arg_files/xmp2exif.args +4 -1
  8. data/bin/exiftool +97 -53
  9. data/bin/fmt_files/kml.fmt +3 -0
  10. data/bin/fmt_files/kml_track.fmt +3 -0
  11. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +13 -6
  12. data/bin/lib/Image/ExifTool/Canon.pm +8 -2
  13. data/bin/lib/Image/ExifTool/Exif.pm +31 -2
  14. data/bin/lib/Image/ExifTool/FlashPix.pm +73 -8
  15. data/bin/lib/Image/ExifTool/FujiFilm.pm +2 -1
  16. data/bin/lib/Image/ExifTool/GPS.pm +7 -2
  17. data/bin/lib/Image/ExifTool/InfiRay.pm +227 -0
  18. data/bin/lib/Image/ExifTool/JPEG.pm +40 -6
  19. data/bin/lib/Image/ExifTool/Jpeg2000.pm +5 -5
  20. data/bin/lib/Image/ExifTool/MIE.pm +3 -3
  21. data/bin/lib/Image/ExifTool/Nikon.pm +862 -1264
  22. data/bin/lib/Image/ExifTool/NikonCustom.pm +2 -2
  23. data/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  24. data/bin/lib/Image/ExifTool/Olympus.pm +3 -1
  25. data/bin/lib/Image/ExifTool/OpenEXR.pm +32 -15
  26. data/bin/lib/Image/ExifTool/PNG.pm +80 -2
  27. data/bin/lib/Image/ExifTool/Photoshop.pm +36 -5
  28. data/bin/lib/Image/ExifTool/QuickTime.pm +18 -2
  29. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +25 -14
  30. data/bin/lib/Image/ExifTool/README +11 -2
  31. data/bin/lib/Image/ExifTool/Real.pm +2 -2
  32. data/bin/lib/Image/ExifTool/Sigma.pm +2 -1
  33. data/bin/lib/Image/ExifTool/Sony.pm +5 -1
  34. data/bin/lib/Image/ExifTool/TagLookup.pm +4667 -4624
  35. data/bin/lib/Image/ExifTool/TagNames.pod +400 -90
  36. data/bin/lib/Image/ExifTool/VCard.pm +19 -5
  37. data/bin/lib/Image/ExifTool/Writer.pl +36 -16
  38. data/bin/lib/Image/ExifTool.pm +92 -35
  39. data/bin/lib/Image/ExifTool.pod +54 -53
  40. data/bin/perl-Image-ExifTool.spec +18 -18
  41. data/lib/exiftool_vendored/version.rb +1 -1
  42. metadata +3 -2
@@ -64,11 +64,12 @@ use Image::ExifTool::Exif;
64
64
  use Image::ExifTool::GPS;
65
65
  use Image::ExifTool::XMP;
66
66
 
67
- $VERSION = '4.17';
67
+ $VERSION = '4.19';
68
68
 
69
69
  sub LensIDConv($$$);
70
70
  sub ProcessNikonAVI($$$);
71
71
  sub ProcessNikonMOV($$$);
72
+ sub ProcessNikonEncrypted($$$);
72
73
  sub FormatString($);
73
74
  sub ProcessNikonCaptureEditVersions($$$);
74
75
  sub PrintAFPoints($$);
@@ -919,6 +920,14 @@ my %hDMIOutputResolutionZ9 = (
919
920
  #7 => '480p',
920
921
  );
921
922
 
923
+ my %highFrameRateZ9 = (
924
+ 0 => 'Off',
925
+ 1 => 'CH',
926
+ 3 => 'C30',
927
+ 5 => 'C60',
928
+ 4 => 'C120',
929
+ );
930
+
922
931
  my %imageAreaZ9 = (
923
932
  0 => 'FX',
924
933
  1 => 'DX',
@@ -1104,6 +1113,14 @@ my %offLowNormalHighZ7 = (
1104
1113
  3 => 'High',
1105
1114
  );
1106
1115
 
1116
+ my %releaseModeZ7 = (
1117
+ 0 => 'Continuous Low',
1118
+ 1 => 'Continuous High',
1119
+ 2 => 'Continuous High (Extended)',
1120
+ 4 => 'Timer',
1121
+ 5 => 'Single Frame',
1122
+ );
1123
+
1107
1124
  my %secondarySlotFunctionZ9 = (
1108
1125
  0 => 'Overflow',
1109
1126
  1 => 'Backup',
@@ -1501,9 +1518,7 @@ my %base64coord = (
1501
1518
  0x0006 => { Name => 'Sharpness', Writable => 'string' },
1502
1519
  0x0007 => {
1503
1520
  Name => 'FocusMode',
1504
- DataMember => 'FocusMode',
1505
1521
  Writable => 'string',
1506
- RawConv => '$$self{FocusMode} = $val',
1507
1522
  },
1508
1523
  # FlashSetting (better named FlashSyncMode, ref 28) values:
1509
1524
  # "Normal", "Slow", "Rear Slow", "RED-EYE", "RED-EYE SLOW"
@@ -1651,7 +1666,7 @@ my %base64coord = (
1651
1666
  0x0019 => { #5
1652
1667
  Name => 'ExposureBracketValue',
1653
1668
  Writable => 'rational64s',
1654
- PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
1669
+ PrintConv => '$val !~ /undef/ ? Image::ExifTool::Exif::PrintFraction($val) : "n/a" ', #undef observed for Z9 jpgs at C30/C60/C90 [data is 0/0 rather than the usual 0/6]
1655
1670
  PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
1656
1671
  },
1657
1672
  0x001a => { #PH
@@ -1803,6 +1818,8 @@ my %base64coord = (
1803
1818
  0x0034 => { #forum9646
1804
1819
  Name => 'ShutterMode',
1805
1820
  Writable => 'int16u',
1821
+ RawConv => '$$self{ShutterMode} = $val',
1822
+ DataMember => 'ShutterMode',
1806
1823
  PrintConv => {
1807
1824
  0 => 'Mechanical',
1808
1825
  16 => 'Electronic',
@@ -1811,6 +1828,7 @@ my %base64coord = (
1811
1828
  64 => 'Electronic (Movie)', #JanSkoda (Z6II)
1812
1829
  80 => 'Auto (Mechanical)', #JanSkoda (Z6II)
1813
1830
  81 => 'Auto (Electronic Front Curtain)', #JanSkoda (Z6II)
1831
+ 96 => 'Electronic (High Speed)', #28 Z9 at C30/C60/C120 frame rates
1814
1832
  },
1815
1833
  },
1816
1834
  0x0035 => [{ #32
@@ -1874,6 +1892,14 @@ my %base64coord = (
1874
1892
  SubDirectory => { TagTable => 'Image::ExifTool::Nikon::MakerNotes0x51' },
1875
1893
  },
1876
1894
  #0x0053 #28 possibly a secondary DistortionControl block (in addition to DistortInfo)? Certainly offset 0x04 within block contains tag AutoDistortionControl for Z72 and D6 (1=>On; 2=> Off)
1895
+ 0x0056 => { #28 (Z9)
1896
+ Name => 'MakerNotes0x56',
1897
+ Writable => 'undef',
1898
+ Hidden => 1,
1899
+ Permanent => 0,
1900
+ Flags => [ 'Binary', 'Protected' ],
1901
+ SubDirectory => { TagTable => 'Image::ExifTool::Nikon::MakerNotes0x56' },
1902
+ },
1877
1903
  #0x005e #28 possibly DiffractionCompensation block? Certainly offset 0x04 within block contains tag DiffractionCompensation
1878
1904
  0x0080 => { Name => 'ImageAdjustment', Writable => 'string' },
1879
1905
  0x0081 => { Name => 'ToneComp', Writable => 'string' }, #2
@@ -2003,6 +2029,7 @@ my %base64coord = (
2003
2029
  6 => 'White-Balance Bracketing',
2004
2030
  7 => 'IR Control',
2005
2031
  8 => 'D-Lighting Bracketing', #forum6281 (NC)
2032
+ 11 => 'Pre-capture', #28 Z9 pre-release burst
2006
2033
  });
2007
2034
  ],
2008
2035
  },
@@ -2165,8 +2192,6 @@ my %base64coord = (
2165
2192
  SubDirectory => {
2166
2193
  TagTable => 'Image::ExifTool::Nikon::ShotInfoD810',
2167
2194
  DecryptStart => 4,
2168
- DecryptLen => 0x36f4 + 12,
2169
- DecryptMore => 'Get32u(\$data, 0x84) + 12',
2170
2195
  ByteOrder => 'LittleEndian',
2171
2196
  },
2172
2197
  },
@@ -2176,8 +2201,6 @@ my %base64coord = (
2176
2201
  SubDirectory => {
2177
2202
  TagTable => 'Image::ExifTool::Nikon::ShotInfoD850',
2178
2203
  DecryptStart => 4,
2179
- DecryptLen => 0x2efb + 12,
2180
- DecryptMore => 'Get32u(\$data, 0xa0) + 12',
2181
2204
  ByteOrder => 'LittleEndian',
2182
2205
  },
2183
2206
  },
@@ -2244,25 +2267,12 @@ my %base64coord = (
2244
2267
  ByteOrder => 'LittleEndian',
2245
2268
  },
2246
2269
  },
2247
- { #28 (D5 firmware version 1.10a)
2248
- Condition => '$$valPt =~ /^0238/',
2249
- Name => 'ShotInfoD5',
2250
- SubDirectory => {
2251
- TagTable => 'Image::ExifTool::Nikon::ShotInfoD500',
2252
- DecryptStart => 4,
2253
- DecryptLen => 0x2c24 + 12,
2254
- DecryptMore => 'Get32u(\$data, 0xa8) + 0x2ea5 - 0x2c90',
2255
- ByteOrder => 'LittleEndian',
2256
- },
2257
- },
2258
- { # (D500 firmware version 1.00)
2259
- Condition => '$$valPt =~ /^0239/',
2270
+ { #28 (D500 firmware version 1.00 and D5 firmware version 1.10a)
2271
+ Condition => '$$valPt =~ /^023[89]/',
2260
2272
  Name => 'ShotInfoD500',
2261
2273
  SubDirectory => {
2262
2274
  TagTable => 'Image::ExifTool::Nikon::ShotInfoD500',
2263
2275
  DecryptStart => 4,
2264
- DecryptLen => 0x2cb2 + 4,
2265
- DecryptMore => 'Get32u(\$data, 0xa8) + 0x2ea5 - 0x2c90',
2266
2276
  ByteOrder => 'LittleEndian',
2267
2277
  },
2268
2278
  },
@@ -2272,7 +2282,6 @@ my %base64coord = (
2272
2282
  SubDirectory => {
2273
2283
  TagTable => 'Image::ExifTool::Nikon::ShotInfoD6',
2274
2284
  DecryptStart => 4,
2275
- DecryptLen => 0xc292 + 720, # thru decoded parts of Offset 32
2276
2285
  ByteOrder => 'LittleEndian',
2277
2286
  },
2278
2287
  },
@@ -2293,8 +2302,6 @@ my %base64coord = (
2293
2302
  SubDirectory => {
2294
2303
  TagTable => 'Image::ExifTool::Nikon::ShotInfoZ7II',
2295
2304
  DecryptStart => 4,
2296
- # TODO: eventually set the length dynamically according to actual offsets!
2297
- DecryptLen => 0xd04e + 860, # thru decoded MenuSettingsZ7II
2298
2305
  ByteOrder => 'LittleEndian',
2299
2306
  },
2300
2307
  },
@@ -2304,8 +2311,6 @@ my %base64coord = (
2304
2311
  SubDirectory => {
2305
2312
  TagTable => 'Image::ExifTool::Nikon::ShotInfoZ9',
2306
2313
  DecryptStart => 4,
2307
- # TODO: eventually set the length dynamically according to actual offsets!
2308
- DecryptLen => 0xec4b + 2196, # decoded thru end of Offset26
2309
2314
  ByteOrder => 'LittleEndian',
2310
2315
  },
2311
2316
  },
@@ -2314,8 +2319,8 @@ my %base64coord = (
2314
2319
  Name => 'ShotInfo02xx',
2315
2320
  SubDirectory => {
2316
2321
  TagTable => 'Image::ExifTool::Nikon::ShotInfo',
2317
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2318
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2322
+ ProcessProc => \&ProcessNikonEncrypted,
2323
+ WriteProc => \&ProcessNikonEncrypted,
2319
2324
  DecryptStart => 4,
2320
2325
  DecryptLen => 0x251,
2321
2326
  ByteOrder => 'BigEndian',
@@ -2381,8 +2386,8 @@ my %base64coord = (
2381
2386
  Name => 'ColorBalance0205',
2382
2387
  SubDirectory => {
2383
2388
  TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
2384
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2385
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2389
+ ProcessProc => \&ProcessNikonEncrypted,
2390
+ WriteProc => \&ProcessNikonEncrypted,
2386
2391
  DecryptStart => 4,
2387
2392
  DecryptLen => 22, # 284 bytes encrypted, but don't need to decrypt it all
2388
2393
  DirOffset => 14,
@@ -2393,8 +2398,8 @@ my %base64coord = (
2393
2398
  Name => 'ColorBalance0209',
2394
2399
  SubDirectory => {
2395
2400
  TagTable => 'Image::ExifTool::Nikon::ColorBalance4',
2396
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2397
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2401
+ ProcessProc => \&ProcessNikonEncrypted,
2402
+ WriteProc => \&ProcessNikonEncrypted,
2398
2403
  DecryptStart => 284,
2399
2404
  DecryptLen => 18, # 324 bytes encrypted, but don't need to decrypt it all
2400
2405
  DirOffset => 10,
@@ -2405,8 +2410,8 @@ my %base64coord = (
2405
2410
  Name => 'ColorBalance02',
2406
2411
  SubDirectory => {
2407
2412
  TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
2408
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2409
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2413
+ ProcessProc => \&ProcessNikonEncrypted,
2414
+ WriteProc => \&ProcessNikonEncrypted,
2410
2415
  DecryptStart => 284,
2411
2416
  DecryptLen => 14, # don't need to decrypt it all
2412
2417
  DirOffset => 6,
@@ -2417,8 +2422,8 @@ my %base64coord = (
2417
2422
  Name => 'ColorBalance0211',
2418
2423
  SubDirectory => {
2419
2424
  TagTable => 'Image::ExifTool::Nikon::ColorBalance4',
2420
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2421
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2425
+ ProcessProc => \&ProcessNikonEncrypted,
2426
+ WriteProc => \&ProcessNikonEncrypted,
2422
2427
  DecryptStart => 284,
2423
2428
  DecryptLen => 24, # don't need to decrypt it all
2424
2429
  DirOffset => 16,
@@ -2429,8 +2434,8 @@ my %base64coord = (
2429
2434
  Name => 'ColorBalance0213',
2430
2435
  SubDirectory => {
2431
2436
  TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
2432
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2433
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2437
+ ProcessProc => \&ProcessNikonEncrypted,
2438
+ WriteProc => \&ProcessNikonEncrypted,
2434
2439
  DecryptStart => 284,
2435
2440
  DecryptLen => 18, # don't need to decrypt it all
2436
2441
  DirOffset => 10,
@@ -2441,8 +2446,8 @@ my %base64coord = (
2441
2446
  Name => 'ColorBalance0215',
2442
2447
  SubDirectory => {
2443
2448
  TagTable => 'Image::ExifTool::Nikon::ColorBalance4',
2444
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2445
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2449
+ ProcessProc => \&ProcessNikonEncrypted,
2450
+ WriteProc => \&ProcessNikonEncrypted,
2446
2451
  DecryptStart => 284,
2447
2452
  DecryptLen => 12, # don't need to decrypt it all
2448
2453
  DirOffset => 4,
@@ -2453,7 +2458,8 @@ my %base64coord = (
2453
2458
  Condition => '$$valPt =~ /^0[26]/',
2454
2459
  SubDirectory => {
2455
2460
  TagTable => 'Image::ExifTool::Nikon::ColorBalanceUnknown',
2456
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2461
+ ProcessProc => \&ProcessNikonEncrypted,
2462
+ WriteProc => \&ProcessNikonEncrypted, # (necessary to recrypt this if serial number changed)
2457
2463
  DecryptStart => 284,
2458
2464
  DecryptLen => 10, # (arbitrary)
2459
2465
  },
@@ -2463,7 +2469,8 @@ my %base64coord = (
2463
2469
  Condition => '$$valPt =~ /^0[48]/',
2464
2470
  SubDirectory => {
2465
2471
  TagTable => 'Image::ExifTool::Nikon::ColorBalanceUnknown',
2466
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2472
+ ProcessProc => \&ProcessNikonEncrypted,
2473
+ WriteProc => \&ProcessNikonEncrypted, # (necessary to recrypt this if serial number changed)
2467
2474
  DecryptStart => 4,
2468
2475
  DecryptLen => 10, # (arbitrary)
2469
2476
  },
@@ -2494,8 +2501,8 @@ my %base64coord = (
2494
2501
  Name => 'LensData0201',
2495
2502
  SubDirectory => {
2496
2503
  TagTable => 'Image::ExifTool::Nikon::LensData01',
2497
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2498
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2504
+ ProcessProc => \&ProcessNikonEncrypted,
2505
+ WriteProc => \&ProcessNikonEncrypted,
2499
2506
  DecryptStart => 4,
2500
2507
  },
2501
2508
  },
@@ -2504,8 +2511,8 @@ my %base64coord = (
2504
2511
  Name => 'LensData0204',
2505
2512
  SubDirectory => {
2506
2513
  TagTable => 'Image::ExifTool::Nikon::LensData0204',
2507
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2508
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2514
+ ProcessProc => \&ProcessNikonEncrypted,
2515
+ WriteProc => \&ProcessNikonEncrypted,
2509
2516
  DecryptStart => 4,
2510
2517
  },
2511
2518
  },
@@ -2514,8 +2521,8 @@ my %base64coord = (
2514
2521
  Name => 'LensData0400',
2515
2522
  SubDirectory => {
2516
2523
  TagTable => 'Image::ExifTool::Nikon::LensData0400',
2517
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2518
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2524
+ ProcessProc => \&ProcessNikonEncrypted,
2525
+ WriteProc => \&ProcessNikonEncrypted,
2519
2526
  DecryptStart => 4,
2520
2527
  },
2521
2528
  },
@@ -2524,8 +2531,8 @@ my %base64coord = (
2524
2531
  Name => 'LensData0402',
2525
2532
  SubDirectory => {
2526
2533
  TagTable => 'Image::ExifTool::Nikon::LensData0402',
2527
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2528
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2534
+ ProcessProc => \&ProcessNikonEncrypted,
2535
+ WriteProc => \&ProcessNikonEncrypted,
2529
2536
  DecryptStart => 4,
2530
2537
  },
2531
2538
  },
@@ -2534,8 +2541,8 @@ my %base64coord = (
2534
2541
  Name => 'LensData0403',
2535
2542
  SubDirectory => {
2536
2543
  TagTable => 'Image::ExifTool::Nikon::LensData0403',
2537
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2538
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2544
+ ProcessProc => \&ProcessNikonEncrypted,
2545
+ WriteProc => \&ProcessNikonEncrypted,
2539
2546
  DecryptStart => 4,
2540
2547
  },
2541
2548
  },
@@ -2544,8 +2551,8 @@ my %base64coord = (
2544
2551
  Name => 'LensData0800',
2545
2552
  SubDirectory => {
2546
2553
  TagTable => 'Image::ExifTool::Nikon::LensData0800',
2547
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2548
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2554
+ ProcessProc => \&ProcessNikonEncrypted,
2555
+ WriteProc => \&ProcessNikonEncrypted,
2549
2556
  DecryptStart => 4,
2550
2557
  ByteOrder => 'LittleEndian',
2551
2558
  },
@@ -2554,8 +2561,8 @@ my %base64coord = (
2554
2561
  Name => 'LensDataUnknown',
2555
2562
  SubDirectory => {
2556
2563
  TagTable => 'Image::ExifTool::Nikon::LensDataUnknown',
2557
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2558
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
2564
+ ProcessProc => \&ProcessNikonEncrypted,
2565
+ WriteProc => \&ProcessNikonEncrypted,
2559
2566
  DecryptStart => 4,
2560
2567
  },
2561
2568
  },
@@ -5285,14 +5292,20 @@ my %nikonFocalConversions = (
5285
5292
  22 => 'Nikkor Z 24-50mm f/4-6.3', #IB
5286
5293
  23 => 'Nikkor Z 14-24mm f/2.8 S', #IB
5287
5294
  24 => 'Nikkor Z MC 105mm f/2.8 VR S', #IB
5295
+ 25 => 'Nikkor Z 40mm f/2', #28
5296
+ 26 => 'Nikkor Z DX 18-140mm f/3.5-6.3 VR', #IB
5288
5297
  27 => 'Nikkor Z MC 50mm f/2.8', #IB
5289
5298
  28 => 'Nikkor Z 100-400mm f/4.5-5.6 VR S', #28
5290
5299
  29 => 'Nikkor Z 28mm f/2.8', #IB
5291
5300
  30 => 'Nikkor Z 400mm f/2.8 TC VR S', #28
5292
5301
  31 => 'Nikkor Z 24-120 f/4', #28
5293
5302
  32 => 'Nikkor Z 800mm f/6.3 VR S', #28
5303
+ 35 => 'Nikkor Z 28-75mm f/2.8', #IB
5294
5304
  36 => 'Nikkor Z 400mm f/4.5 VR S', #IB
5305
+ 37 => 'Nikkor Z 600mm f/4 TC VR S', #28
5295
5306
  39 => 'Nikkor Z 17-28mm f/2.8', #IB
5307
+ 32768 => 'Nikkor Z 400mm f/2.8 TC VR S TC-1.4x', #28
5308
+ 32769 => 'Nikkor Z 600mm f/4 TC VR S TC-1.4x', #28
5296
5309
  },
5297
5310
  },
5298
5311
  0x35 => { #28
@@ -5498,8 +5511,8 @@ my %nikonFocalConversions = (
5498
5511
 
5499
5512
  # shot information for D40 and D40X (encrypted) - ref PH
5500
5513
  %Image::ExifTool::Nikon::ShotInfoD40 = (
5501
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5502
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5514
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5515
+ WRITE_PROC => \&ProcessNikonEncrypted,
5503
5516
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5504
5517
  VARS => { ID_LABEL => 'Index' },
5505
5518
  IS_SUBDIR => [ 729 ],
@@ -5534,8 +5547,8 @@ my %nikonFocalConversions = (
5534
5547
 
5535
5548
  # shot information for D80 (encrypted) - ref JD
5536
5549
  %Image::ExifTool::Nikon::ShotInfoD80 = (
5537
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5538
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5550
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5551
+ WRITE_PROC => \&ProcessNikonEncrypted,
5539
5552
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5540
5553
  VARS => { ID_LABEL => 'Index' },
5541
5554
  IS_SUBDIR => [ 748 ],
@@ -5614,8 +5627,8 @@ my %nikonFocalConversions = (
5614
5627
 
5615
5628
  # shot information for D90 (encrypted) - ref PH
5616
5629
  %Image::ExifTool::Nikon::ShotInfoD90 = (
5617
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5618
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5630
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5631
+ WRITE_PROC => \&ProcessNikonEncrypted,
5619
5632
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5620
5633
  VARS => { ID_LABEL => 'Index' },
5621
5634
  IS_SUBDIR => [ 0x374 ],
@@ -5660,8 +5673,8 @@ my %nikonFocalConversions = (
5660
5673
 
5661
5674
  # shot information for the D3 firmware 0.37 and 1.00 (encrypted) - ref PH
5662
5675
  %Image::ExifTool::Nikon::ShotInfoD3a = (
5663
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5664
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5676
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5677
+ WRITE_PROC => \&ProcessNikonEncrypted,
5665
5678
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5666
5679
  VARS => { ID_LABEL => 'Index' },
5667
5680
  IS_SUBDIR => [ 0x301 ],
@@ -5724,8 +5737,8 @@ my %nikonFocalConversions = (
5724
5737
 
5725
5738
  # shot information for the D3 firmware 1.10, 2.00 and 2.01 (encrypted) - ref PH
5726
5739
  %Image::ExifTool::Nikon::ShotInfoD3b = (
5727
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5728
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5740
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5741
+ WRITE_PROC => \&ProcessNikonEncrypted,
5729
5742
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5730
5743
  VARS => { ID_LABEL => 'Index' },
5731
5744
  IS_SUBDIR => [ 0x30a ],
@@ -5819,8 +5832,8 @@ my %nikonFocalConversions = (
5819
5832
 
5820
5833
  # shot information for the D3X firmware 1.00 (encrypted) - ref PH
5821
5834
  %Image::ExifTool::Nikon::ShotInfoD3X = (
5822
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5823
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5835
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5836
+ WRITE_PROC => \&ProcessNikonEncrypted,
5824
5837
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5825
5838
  VARS => { ID_LABEL => 'Index' },
5826
5839
  IS_SUBDIR => [ 0x30b ],
@@ -5865,8 +5878,8 @@ my %nikonFocalConversions = (
5865
5878
 
5866
5879
  # shot information for the D3S firmware 0.16 and 1.00 (encrypted) - ref PH
5867
5880
  %Image::ExifTool::Nikon::ShotInfoD3S = (
5868
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5869
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5881
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5882
+ WRITE_PROC => \&ProcessNikonEncrypted,
5870
5883
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5871
5884
  VARS => { ID_LABEL => 'Index' },
5872
5885
  IS_SUBDIR => [ 0x2ce ],
@@ -5920,8 +5933,8 @@ my %nikonFocalConversions = (
5920
5933
 
5921
5934
  # shot information for the D300 firmware 1.00 (encrypted) - ref JD
5922
5935
  %Image::ExifTool::Nikon::ShotInfoD300a = (
5923
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5924
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
5936
+ PROCESS_PROC => \&ProcessNikonEncrypted,
5937
+ WRITE_PROC => \&ProcessNikonEncrypted,
5925
5938
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
5926
5939
  VARS => { ID_LABEL => 'Index' },
5927
5940
  IS_SUBDIR => [ 790 ],
@@ -6013,8 +6026,8 @@ my %nikonFocalConversions = (
6013
6026
 
6014
6027
  # shot information for the D300 firmware 1.10 (encrypted) - ref PH
6015
6028
  %Image::ExifTool::Nikon::ShotInfoD300b = (
6016
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6017
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6029
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6030
+ WRITE_PROC => \&ProcessNikonEncrypted,
6018
6031
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6019
6032
  VARS => { ID_LABEL => 'Index' },
6020
6033
  DATAMEMBER => [ 4 ],
@@ -6164,8 +6177,8 @@ my %nikonFocalConversions = (
6164
6177
 
6165
6178
  # shot information for the D300S firmware 1.00 (encrypted) - ref PH
6166
6179
  %Image::ExifTool::Nikon::ShotInfoD300S = (
6167
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6168
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6180
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6181
+ WRITE_PROC => \&ProcessNikonEncrypted,
6169
6182
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6170
6183
  VARS => { ID_LABEL => 'Index' },
6171
6184
  IS_SUBDIR => [ 804 ],
@@ -6210,8 +6223,8 @@ my %nikonFocalConversions = (
6210
6223
 
6211
6224
  # shot information for the D700 firmware 1.02f (encrypted) - ref 29
6212
6225
  %Image::ExifTool::Nikon::ShotInfoD700 = (
6213
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6214
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6226
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6227
+ WRITE_PROC => \&ProcessNikonEncrypted,
6215
6228
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6216
6229
  VARS => { ID_LABEL => 'Index' },
6217
6230
  IS_SUBDIR => [ 804 ],
@@ -6256,8 +6269,8 @@ my %nikonFocalConversions = (
6256
6269
 
6257
6270
  # shot information for the D5000 firmware 1.00 (encrypted) - ref PH
6258
6271
  %Image::ExifTool::Nikon::ShotInfoD5000 = (
6259
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6260
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6272
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6273
+ WRITE_PROC => \&ProcessNikonEncrypted,
6261
6274
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6262
6275
  VARS => { ID_LABEL => 'Index' },
6263
6276
  IS_SUBDIR => [ 0x378 ],
@@ -6302,8 +6315,8 @@ my %nikonFocalConversions = (
6302
6315
 
6303
6316
  # shot information for the D5100 firmware 1.00f (encrypted) - ref PH
6304
6317
  %Image::ExifTool::Nikon::ShotInfoD5100 = (
6305
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6306
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6318
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6319
+ WRITE_PROC => \&ProcessNikonEncrypted,
6307
6320
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6308
6321
  VARS => { ID_LABEL => 'Index' },
6309
6322
  IS_SUBDIR => [ 0x407 ],
@@ -6337,8 +6350,8 @@ my %nikonFocalConversions = (
6337
6350
 
6338
6351
  # shot information for the D5200 firmware 1.00 (encrypted) - ref PH
6339
6352
  %Image::ExifTool::Nikon::ShotInfoD5200 = (
6340
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6341
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6353
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6354
+ WRITE_PROC => \&ProcessNikonEncrypted,
6342
6355
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6343
6356
  VARS => { ID_LABEL => 'Index' },
6344
6357
  IS_SUBDIR => [ 0xcd5 ],
@@ -6375,8 +6388,8 @@ my %nikonFocalConversions = (
6375
6388
 
6376
6389
  # shot information for the D7000 firmware 1.01d (encrypted) - ref 29
6377
6390
  %Image::ExifTool::Nikon::ShotInfoD7000 = (
6378
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6379
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6391
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6392
+ WRITE_PROC => \&ProcessNikonEncrypted,
6380
6393
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6381
6394
  VARS => { ID_LABEL => 'Index' },
6382
6395
  IS_SUBDIR => [ 1028 ],
@@ -6420,8 +6433,8 @@ my %nikonFocalConversions = (
6420
6433
 
6421
6434
  # shot information for the D800 firmware 1.01a (encrypted) - ref PH
6422
6435
  %Image::ExifTool::Nikon::ShotInfoD800 = (
6423
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6424
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6436
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6437
+ WRITE_PROC => \&ProcessNikonEncrypted,
6425
6438
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6426
6439
  VARS => { ID_LABEL => 'Index' },
6427
6440
  IS_SUBDIR => [ 0x6ec ],
@@ -6541,15 +6554,13 @@ my %nikonFocalConversions = (
6541
6554
 
6542
6555
  # shot information for the D5 firmware 1.10a and D500 firmware 1.01 (encrypted) - ref 28
6543
6556
  %Image::ExifTool::Nikon::ShotInfoD500 = (
6544
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6545
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
6557
+ PROCESS_PROC => \&ProcessNikonEncrypted,
6558
+ WRITE_PROC => \&ProcessNikonEncrypted,
6546
6559
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
6547
- VARS => { ID_LABEL => 'Index' },
6548
- DATAMEMBER => [ 0x04, 0x10, 0x14, 0x2c, 0x50, 0x58, 0xa0, 0xa8, 0xb0,
6549
- 0x07b0, 0x086c, 0x0e7c, 0x0eea, 0x2c23, 0x2c8f ],
6550
- IS_SUBDIR => [ 0x0eeb ],
6560
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x0c },
6561
+ DATAMEMBER => [ 0x04 ],
6562
+ IS_SUBDIR => [ 0x10, 0x14, 0x2c, 0x50, 0x58, 0xa0, 0xa8 ],
6551
6563
  WRITABLE => 1,
6552
- FIRST_ENTRY => 0,
6553
6564
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6554
6565
  NOTES => 'These tags are extracted from encrypted data in images from the D5 and D500.',
6555
6566
  0x00 => {
@@ -6566,73 +6577,66 @@ my %nikonFocalConversions = (
6566
6577
  },
6567
6578
  0x10 => {
6568
6579
  Name => 'RotationInfoOffset',
6569
- DataMember => 'RotationInfoOffset',
6570
6580
  Format => 'int32u',
6571
- Writable => 0,
6572
- Hidden => 1,
6573
- RawConv => '$$self{RotationInfoOffset} = $val || 0x10000000; undef', # (ignore if 0)
6581
+ SubDirectory => {
6582
+ TagTable => 'Image::ExifTool::Nikon::RotationInfoD500',
6583
+ Start => '$val',
6584
+ }
6574
6585
  },
6575
6586
  0x14 => {
6576
6587
  Name => 'JPGInfoOffset',
6577
- DataMember => 'JPGInfoOffset',
6578
6588
  Format => 'int32u',
6579
- Writable => 0,
6580
- Hidden => 1,
6581
- RawConv => '$$self{JPGInfoOffset} = $val || 0x10000000; undef', # (ignore if 0)
6589
+ SubDirectory => {
6590
+ TagTable => 'Image::ExifTool::Nikon::JPGInfoD500',
6591
+ Start => '$val',
6592
+ }
6582
6593
  },
6583
6594
  0x2c => {
6584
- Name => 'BracketingInfoOffset',
6585
- DataMember => 'BracketingInfoOffset',
6595
+ Name => 'BracketingOffset',
6586
6596
  Format => 'int32u',
6587
- Writable => 0,
6588
- Hidden => 1,
6589
- RawConv => '$$self{BracketingInfoOffset} = $val || 0x10000000; undef', # (ignore if 0)
6597
+ SubDirectory => {
6598
+ TagTable => 'Image::ExifTool::Nikon::BracketingInfoD500',
6599
+ Start => '$val',
6600
+ }
6590
6601
  },
6591
6602
  0x50 => {
6592
6603
  Name => 'ShootingMenuOffset',
6593
- DataMember => 'ShootingMenuOffset',
6594
6604
  Format => 'int32u',
6595
- Writable => 0,
6596
- Hidden => 1,
6597
- RawConv => '$$self{ShootingMenuOffset} = $val || 0x10000000; undef', # (ignore if 0)
6605
+ SubDirectory => {
6606
+ TagTable => 'Image::ExifTool::Nikon::ShootingMenuD500',
6607
+ Start => '$val',
6608
+ }
6598
6609
  },
6599
6610
  0x58 => {
6600
6611
  Name => 'CustomSettingsOffset',
6601
- DataMember => 'CustomSettingsOffset',
6602
6612
  Format => 'int32u',
6603
- Writable => 0,
6604
- Hidden => 1,
6605
- RawConv => '$$self{CustomSettingsOffset} = $val || 0x10000000; undef', # (ignore if 0)
6613
+ SubDirectory => {
6614
+ TagTable => 'Image::ExifTool::Nikon::CustomSettingsD500',
6615
+ Start => '$val',
6616
+ }
6606
6617
  },
6607
6618
  0xa0 => {
6608
6619
  Name => 'OrientationOffset',
6609
- DataMember => 'OrientationOffset',
6610
6620
  Format => 'int32u',
6611
- Writable => 0,
6612
- Hidden => 1,
6613
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef', # (ignore if 0)
6621
+ SubDirectory => {
6622
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
6623
+ Start => '$val',
6624
+ }
6614
6625
  },
6615
6626
  0xa8 => {
6616
6627
  Name => 'OtherOffset',
6617
- DataMember => 'OtherOffset',
6618
6628
  Format => 'int32u',
6619
- Writable => 0,
6620
- Hidden => 1,
6621
- RawConv => '$$self{OtherOffset} = $val || 0x10000000; undef', # (ignore if 0)
6622
- },
6623
- #
6624
- # Tag ID's below are the offsets for a D500 JPEG image, but these offsets change
6625
- # for various image types according to the offset table above
6626
- #
6627
- ### 0xb0 - RotationInfo start
6628
- 0xb0 => {
6629
- Name => 'Hook1',
6630
- Hidden => 1,
6631
- RawConv => 'undef',
6632
- # account for variable location of Rotation data
6633
- Hook => '$varSize = $$self{RotationInfoOffset} - 0xb0',
6629
+ SubDirectory => {
6630
+ TagTable => 'Image::ExifTool::Nikon::OtherInfoD500',
6631
+ Start => '$val',
6632
+ }
6634
6633
  },
6635
- 0xca => {
6634
+ );
6635
+
6636
+ %Image::ExifTool::Nikon::RotationInfoD500 = (
6637
+ %binaryDataAttrs,
6638
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6639
+ 0x1a => {
6636
6640
  Name => 'Rotation',
6637
6641
  Mask => 0x03,
6638
6642
  PrintConv => {
@@ -6642,32 +6646,29 @@ my %nikonFocalConversions = (
6642
6646
  3 => 'Rotate 180',
6643
6647
  },
6644
6648
  },
6645
- 0x0d0 => {
6649
+ 0x20 => {
6646
6650
  Name => 'Interval',
6647
6651
  # prior version of the d% firmware do not support this tag, nor does the D500 (at least thru firmware 1.3)
6648
6652
  Condition => '$$self{Model} eq "NIKON D5" and $$self{FirmwareVersion} ge "1.40"',
6649
6653
  PrintConv => '$val > 0 ? sprintf("%.0f", $val) : ""',
6650
6654
  },
6651
- 0x0d4 => {
6655
+ 0x24 => {
6652
6656
  Name => 'IntervalFrame',
6653
6657
  # prior version of the d% firmware do not support this tag, nor does the D500 (at least thru firmware 1.3)
6654
6658
  Condition => '$$self{Model} eq "NIKON D5" and $$self{FirmwareVersion} ge "1.40"',
6655
6659
  PrintConv => '$val > 0 ? sprintf("%.0f", $val) : ""',
6656
6660
  },
6657
- 0x05e2 => {
6661
+ 0x0532 => {
6658
6662
  Name => 'FlickerReductionIndicator',
6659
6663
  Mask => 0x01,
6660
6664
  PrintConv => { 0 => 'On', 1 => 'Off' },
6661
6665
  },
6662
- ### 0x07b0 - JPEGInfo start
6663
- 0x07b0 => {
6664
- Name => 'Hook2',
6665
- Hidden => 1,
6666
- RawConv => 'undef',
6667
- # account for variable location of Shooting Menu data
6668
- Hook => '$varSize = $$self{JPGInfoOffset} - 0x07b0',
6669
- },
6670
- 0x07d4 => {
6666
+ );
6667
+
6668
+ %Image::ExifTool::Nikon::JPGInfoD500 = (
6669
+ %binaryDataAttrs,
6670
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6671
+ 0x24 => {
6671
6672
  Name => 'JPGCompression',
6672
6673
  Mask => 0x01,
6673
6674
  PrintConv => {
@@ -6675,16 +6676,12 @@ my %nikonFocalConversions = (
6675
6676
  1 => 'Optimal Quality',
6676
6677
  },
6677
6678
  },
6678
- ### 0x0830 - ? start
6679
- ### 0x086c - BracketingInfo start
6680
- 0x086c => {
6681
- Name => 'Hook3',
6682
- Hidden => 1,
6683
- RawConv => 'undef',
6684
- # account for variable location of Shooting Menu data
6685
- Hook => '$varSize = $$self{BracketingInfoOffset} - 0x086c',
6686
- },
6687
- 0x087b => {
6679
+ );
6680
+
6681
+ %Image::ExifTool::Nikon::BracketingInfoD500 = (
6682
+ %binaryDataAttrs,
6683
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6684
+ 0x0f => {
6688
6685
  Name => 'AEBracketingSteps',
6689
6686
  Condition => '$$self{FILE_TYPE} ne "TIFF"', # (covers NEF and TIFF)
6690
6687
  Mask => 0xff,
@@ -6742,7 +6739,7 @@ my %nikonFocalConversions = (
6742
6739
  0xd6 => '5F3',
6743
6740
  },
6744
6741
  },
6745
- 0x087c => {
6742
+ 0x10 => {
6746
6743
  Name => 'WBBracketingSteps',
6747
6744
  Condition => '$$self{FILE_TYPE} ne "TIFF"', # (covers NEF and TIFF)
6748
6745
  Mask => 0xff,
@@ -6785,7 +6782,7 @@ my %nikonFocalConversions = (
6785
6782
  0x28 => '9F 3',
6786
6783
  },
6787
6784
  },
6788
- 0x0883 => {
6785
+ 0x17 => {
6789
6786
  Name => 'ADLBracketingStep',
6790
6787
  Mask => 0xf0,
6791
6788
  PrintConv => {
@@ -6797,7 +6794,7 @@ my %nikonFocalConversions = (
6797
6794
  8 => 'Auto',
6798
6795
  },
6799
6796
  },
6800
- 0x0884 => {
6797
+ 0x18 => {
6801
6798
  Name => 'ADLBracketingType',
6802
6799
  Mask => 0x0f,
6803
6800
  PrintConv => {
@@ -6808,23 +6805,12 @@ my %nikonFocalConversions = (
6808
6805
  4 => '5 Shots',
6809
6806
  },
6810
6807
  },
6811
- ### 0x0887 - ? start
6812
- ### 0x089f - ? start
6813
- ### 0x0929 - ? start
6814
- ### 0x09c9 - ? start
6815
- ### 0x0ac5 - ? start
6816
- ### 0x0bc1 - ? start
6817
- ### 0x0cbd - ? start
6818
- ### 0x0d98 - ? start
6819
- ### 0x0e7d - ShootingMenuOffset start
6820
- 0x0e7c => {
6821
- Name => 'Hook4',
6822
- Hidden => 1,
6823
- RawConv => 'undef',
6824
- # account for variable location of Shooting Menu data
6825
- Hook => '$varSize = $$self{ShootingMenuOffset} - 0x0e7d',
6826
- },
6827
- 0x0e7d => {
6808
+ );
6809
+
6810
+ %Image::ExifTool::Nikon::ShootingMenuD500 = (
6811
+ %binaryDataAttrs,
6812
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6813
+ 0x00 => {
6828
6814
  Name => 'PhotoShootingMenuBank',
6829
6815
  Mask => 0x03,
6830
6816
  PrintConv => {
@@ -6834,7 +6820,7 @@ my %nikonFocalConversions = (
6834
6820
  3 => 'D',
6835
6821
  },
6836
6822
  },
6837
- 0x0e7f => {
6823
+ 0x02 => {
6838
6824
  Name => 'PrimarySlot',
6839
6825
  Condition => '$$self{Model} =~ /\bD500\b/',
6840
6826
  Notes => 'D500 only',
@@ -6844,7 +6830,7 @@ my %nikonFocalConversions = (
6844
6830
  1 => 'SD Card',
6845
6831
  },
6846
6832
  },
6847
- 0x0e81 => {
6833
+ 0x04 => {
6848
6834
  Name => 'ISOAutoShutterTime',
6849
6835
  Mask => 0x3f,
6850
6836
  PrintConv => {
@@ -6887,7 +6873,7 @@ my %nikonFocalConversions = (
6887
6873
  36 => 'Auto (Fastest)',
6888
6874
  },
6889
6875
  },
6890
- 0x0e82 => {
6876
+ 0x05 => {
6891
6877
  Name => 'ISOAutoHiLimit',
6892
6878
  Mask => 0xff,
6893
6879
  PrintHex => 1,
@@ -6935,7 +6921,7 @@ my %nikonFocalConversions = (
6935
6921
  0x72 => 'ISO Hi 5.0',
6936
6922
  },
6937
6923
  },
6938
- 0x0e84 => {
6924
+ 0x07 => {
6939
6925
  Name => 'FlickerReduction',
6940
6926
  Mask => 0x20,
6941
6927
  PrintConv => {
@@ -6943,7 +6929,7 @@ my %nikonFocalConversions = (
6943
6929
  1 => 'Disable',
6944
6930
  },
6945
6931
  },
6946
- 3716.1 => { # (0x0e84)
6932
+ 7.1 => {
6947
6933
  Name => 'PhotoShootingMenuBankImageArea',
6948
6934
  Mask => 0x07,
6949
6935
  PrintConv => {
@@ -6954,16 +6940,14 @@ my %nikonFocalConversions = (
6954
6940
  4 => '1.3x (18x12)',
6955
6941
  },
6956
6942
  },
6957
- ### 0x0ec4 - ? start
6958
- ### 0x0eeb - CustomSettings start
6959
- 0x0eea => {
6960
- Name => 'Hook5',
6961
- Hidden => 1,
6962
- RawConv => 'undef',
6963
- # account for variable location of CustomSettings data
6964
- Hook => '$varSize = $$self{CustomSettingsOffset} - 0x0eeb',
6965
- },
6966
- 0x0eeb => [{
6943
+ );
6944
+
6945
+ %Image::ExifTool::Nikon::CustomSettingsD500 = (
6946
+ %binaryDataAttrs,
6947
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
6948
+ IS_SUBDIR => [ 0x00 ],
6949
+ VARS => { ALLOW_REPROCESS => 1 }, # (necessary because subdirectory is at offset 0)
6950
+ 0x00 => [{
6967
6951
  Name => 'CustomSettingsD5',
6968
6952
  Condition => '$$self{Model} =~ /\bD5\b/',
6969
6953
  Format => 'undef[90]',
@@ -6977,7 +6961,7 @@ my %nikonFocalConversions = (
6977
6961
  TagTable => 'Image::ExifTool::NikonCustom::SettingsD500',
6978
6962
  },
6979
6963
  }],
6980
- # 0x0f68 => { #this decode works, but involves more bits than should be necessary
6964
+ # 0x7d => { #this decode works, but involves more bits than should be necessary
6981
6965
  # Name => 'ShutterTrigger',
6982
6966
  # Mask => 0xff,
6983
6967
  # PrintConv => {
@@ -6986,51 +6970,13 @@ my %nikonFocalConversions = (
6986
6970
  # 195 => 'Shutter Button',
6987
6971
  # },
6988
6972
  # },
6989
- ### 0x2c24 - OrientationInfo start (D5 firmware 1.10b)
6990
- 0x2c23 => {
6991
- Name => 'Hook6',
6992
- Hidden => 1,
6993
- RawConv => 'undef',
6994
- # account for variable location of OrientationInfo data
6995
- Hook => '$varSize = $$self{OrientationOffset} - 0x2c24',
6996
- },
6997
- 0x2c24 => {
6998
- Name => 'RollAngle',
6999
- Format => 'fixed32u',
7000
- Notes => 'converted to degrees of clockwise camera roll',
7001
- ValueConv => '$val <= 180 ? $val : $val - 360',
7002
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7003
- PrintConv => 'sprintf("%.1f", $val)',
7004
- PrintConvInv => '$val',
7005
- },
7006
- 0x2c28 => {
7007
- Name => 'PitchAngle',
7008
- Format => 'fixed32u',
7009
- Notes => 'converted to degrees of upward camera tilt',
7010
- ValueConv => '$val <= 180 ? $val : $val - 360',
7011
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7012
- PrintConv => 'sprintf("%.1f", $val)',
7013
- PrintConvInv => '$val',
7014
- },
7015
- 0x2c2c => {
7016
- Name => 'YawAngle',
7017
- Format => 'fixed32u',
7018
- Notes => 'the camera yaw angle when shooting in portrait orientation',
7019
- ValueConv => '$val <= 180 ? $val : $val - 360',
7020
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7021
- PrintConv => 'sprintf("%.1f", $val)',
7022
- PrintConvInv => '$val',
7023
- },
7024
- ### 0x2c90 - OtherInfo start (D500 firmware 1.20d)
7025
- 0x2c8f => {
7026
- Name => 'Hook7',
7027
- Hidden => 1,
7028
- RawConv => 'undef',
7029
- # account for variable location of OtherInfo data
7030
- Hook => '$varSize = $$self{OtherOffset} - 0x2c90',
7031
- },
6973
+ );
6974
+
6975
+ %Image::ExifTool::Nikon::OtherInfoD500 = (
6976
+ %binaryDataAttrs,
6977
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7032
6978
  # (needs testing)
7033
- #0x2cb2 => {
6979
+ #0x22 => {
7034
6980
  # Name => 'ExtendedPhotoShootingBanks',
7035
6981
  # Mask => 0x01,
7036
6982
  # PrintConv => {
@@ -7039,7 +6985,7 @@ my %nikonFocalConversions = (
7039
6985
  # },
7040
6986
  #},
7041
6987
  # (may not be reliable and is found elsewhere)
7042
- #0x2ea2 => {
6988
+ #0x212 => {
7043
6989
  # Name => 'Rotation',
7044
6990
  # Condition => '$$self{Model} =~ /\bD500\b/',
7045
6991
  # Notes => 'D500 firmware 1.1x',
@@ -7051,7 +6997,7 @@ my %nikonFocalConversions = (
7051
6997
  # 3 => 'Rotate 180',
7052
6998
  # },
7053
6999
  #},
7054
- 0x2ea4 => { #PH
7000
+ 0x214 => { #PH
7055
7001
  Name => 'NikonMeteringMode',
7056
7002
  Condition => '$$self{Model} =~ /\bD500\b/', # (didn't seem to work for D5, but I need more samples)
7057
7003
  Notes => 'D500 only',
@@ -7068,13 +7014,12 @@ my %nikonFocalConversions = (
7068
7014
 
7069
7015
  # shot information for the D6 firmware 1.00 (encrypted) - ref 28
7070
7016
  %Image::ExifTool::Nikon::ShotInfoD6 = (
7071
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7072
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7017
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7018
+ WRITE_PROC => \&ProcessNikonEncrypted,
7073
7019
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7074
- VARS => { ID_LABEL => 'Index' },
7075
- DATAMEMBER => [ 0x30, 0x60, 0x9c, 0xa4, 0x75e7, 0x760c, 0x7610, 0xc219, 0xc292, 0xc40e, 0xc412, 0xc4a6, 0xc4be ],
7020
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x24 },
7021
+ IS_SUBDIR => [ 0x30, 0x9c, 0xa4 ],
7076
7022
  WRITABLE => 1,
7077
- FIRST_ENTRY => 0,
7078
7023
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7079
7024
  NOTES => 'These tags are extracted from encrypted data in images from the D6.',
7080
7025
  0x00 => {
@@ -7089,159 +7034,111 @@ my %nikonFocalConversions = (
7089
7034
  },
7090
7035
  0x24 => {
7091
7036
  Name => 'NumberOffsets', # (number of entries in offset table. offsets are from start of ShotInfo data)
7092
- DataMember => 'NumberOffsets',
7093
7037
  Format => 'int32u',
7094
7038
  Writable => 0,
7095
7039
  Hidden => 1,
7096
7040
  },
7097
7041
  0x30 => {
7098
- Name => 'Offset3',
7099
- DataMember => 'Offset3',
7100
- Format => 'int32u',
7101
- Writable => 0,
7102
- Hidden => 1,
7103
- RawConv => '$$self{Offset3} = $val || 0x10000000; undef', # (ignore if 0)
7104
- },
7105
- 0x60 => {
7106
- Name => 'Offset15',
7107
- DataMember => 'Offset15',
7042
+ Name => 'SequenceOffset',
7108
7043
  Format => 'int32u',
7109
- Writable => 0,
7110
- Hidden => 1,
7111
- RawConv => '$$self{Offset15} = $val || 0x10000000; undef', # (ignore if 0)
7044
+ SubDirectory => {
7045
+ TagTable => 'Image::ExifTool::Nikon::SeqInfoD6',
7046
+ Start => '$val',
7047
+ },
7112
7048
  },
7113
7049
  0x9c => {
7114
7050
  Name => 'OrientationOffset',
7115
- DataMember => 'OrientationOffset',
7116
7051
  Format => 'int32u',
7117
- Writable => 0,
7118
- Hidden => 1,
7119
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef', # (ignore if 0)
7052
+ SubDirectory => {
7053
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
7054
+ Start => '$val',
7055
+ },
7120
7056
  },
7121
7057
  0xa4 => {
7122
- Name => 'Offset32',
7123
- DataMember => 'Offset32',
7058
+ Name => 'IntervalOffset',
7124
7059
  Format => 'int32u',
7125
- Writable => 0,
7126
- Hidden => 1,
7127
- RawConv => '$$self{Offset32} = $val || 0x10000000; undef', # (ignore if 0)
7128
- },
7129
- ### 0x75e8 - Offset3 info start (D6 firmware 1.33)
7130
- 0x75e7 => {
7131
- Name => 'Hook1',
7132
- Hidden => 1,
7133
- RawConv => 'undef',
7134
- # account for variable location of Offset5 data
7135
- Hook => '$varSize = $$self{Offset3} - 0x75e8',
7060
+ SubDirectory => {
7061
+ TagTable => 'Image::ExifTool::Nikon::IntervalInfoD6',
7062
+ Start => '$val',
7063
+ }
7136
7064
  },
7137
- 0x760c => {
7065
+ );
7066
+
7067
+ %Image::ExifTool::Nikon::SeqInfoD6 = (
7068
+ %binaryDataAttrs,
7069
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7070
+ DATAMEMBER => [ 0x24, 0x28 ],
7071
+ 0x24 => {
7138
7072
  Name => 'IntervalShooting',
7139
7073
  RawConv => '$$self{IntervalShooting} = $val',
7140
7074
  Format => 'int16u',
7141
7075
  PrintConv => q{
7142
7076
  return 'Off' if $val == 0 ;
7143
- my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}); #something like "Interval 1 of 3"
7144
- my $f = $$self{IntervalShootingShotsPerInterval} > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}): '' ; #something like "Frame 1 of 3" or blank
7077
+ my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0); #something like "Interval 1 of 3"
7078
+ my $f = ($$self{IntervalShootingShotsPerInterval}||0) > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0): '' ; #something like "Frame 1 of 3" or blank
7145
7079
  return "On: $i$f"
7146
- #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}, $$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}),
7080
+ #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0, $$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0),
7147
7081
  },
7148
7082
  },
7149
- 0x7610 => {
7083
+ 0x28 => {
7150
7084
  Name => 'IntervalFrame',
7151
7085
  RawConv => '$$self{IntervalFrame} = $val',
7152
7086
  Condition => '$$self{IntervalShooting} > 0',
7153
7087
  Format => 'int16u',
7154
7088
  Hidden => 1,
7155
7089
  },
7156
- ### 0xc21a - OrientationInfo start (D6 firmware 1.00) (0xc952 for firmware 1.33)
7157
- 0xc219 => {
7158
- Name => 'Hook2',
7159
- Hidden => 1,
7160
- RawConv => 'undef',
7161
- # account for variable location of OrientationInfo data
7162
- Hook => '$varSize = $$self{OrientationOffset} - 0xc21a',
7163
- },
7164
- 0xc21a => {
7165
- Name => 'RollAngle',
7166
- Format => 'fixed32u',
7167
- Notes => 'converted to degrees of clockwise camera roll',
7168
- ValueConv => '$val <= 180 ? $val : $val - 360',
7169
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7170
- PrintConv => 'sprintf("%.1f", $val)',
7171
- PrintConvInv => '$val',
7172
- },
7173
- 0xc21e => {
7174
- Name => 'PitchAngle',
7175
- Format => 'fixed32u',
7176
- Notes => 'converted to degrees of upward camera tilt',
7177
- ValueConv => '$val <= 180 ? $val : $val - 360',
7178
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7179
- PrintConv => 'sprintf("%.1f", $val)',
7180
- PrintConvInv => '$val',
7181
- },
7182
- 0xc222 => {
7183
- Name => 'YawAngle',
7184
- Format => 'fixed32u',
7185
- Notes => 'the camera yaw angle when shooting in portrait orientation',
7186
- ValueConv => '$val <= 180 ? $val : $val - 360',
7187
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7188
- PrintConv => 'sprintf("%.1f", $val)',
7189
- PrintConvInv => '$val',
7190
- },
7191
- ### 0xc9c6 - Offset32 start (D6 firmware 1.33)
7192
- 0xc292 => {
7193
- Name => 'Hook3',
7194
- Hidden => 1,
7195
- RawConv => 'undef',
7196
- # account for variable location of data
7197
- Hook => '$varSize = $$self{Offset32} - 0xc292',
7198
- },
7199
- 0xc40e => {
7090
+ );
7091
+
7092
+ %Image::ExifTool::Nikon::IntervalInfoD6 = (
7093
+ %binaryDataAttrs,
7094
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7095
+ DATAMEMBER => [ 0x17c, 0x180, 0x214, 0x22c ],
7096
+ 0x17c => {
7200
7097
  Name => 'Intervals',
7201
7098
  Format => 'int32u',
7202
7099
  RawConv => '$$self{IntervalShootingIntervals} = $val',
7203
7100
  Condition => '$$self{IntervalShooting} > 0',
7204
7101
  },
7205
- 0xc412 => {
7102
+ 0x180 => {
7206
7103
  Name => 'ShotsPerInterval',
7207
7104
  Format => 'int32u',
7208
7105
  RawConv => '$$self{IntervalShootingShotsPerInterval} = $val',
7209
7106
  Condition => '$$self{IntervalShooting} > 0',
7210
7107
  },
7211
- 0xc416 => {
7108
+ 0x184 => {
7212
7109
  Name => 'IntervalExposureSmoothing',
7213
7110
  Condition => '$$self{IntervalShooting} > 0',
7214
7111
  Format => 'int8u',
7215
7112
  PrintConv => \%offOn,
7216
7113
  },
7217
- 0xc418 => {
7114
+ 0x186 => {
7218
7115
  Name => 'IntervalPriority',
7219
7116
  Condition => '$$self{IntervalShooting} > 0',
7220
7117
  Format => 'int8u',
7221
7118
  PrintConv => \%offOn,
7222
7119
  },
7223
- 0xc43a => {
7120
+ 0x1a8 => {
7224
7121
  Name => 'FocusShiftNumberShots',
7225
7122
  },
7226
- 0xc43e => {
7123
+ 0x1ac => {
7227
7124
  Name => 'FocusShiftStepWidth',
7228
7125
  },
7229
- 0xc442 => {
7126
+ 0x1b0 => {
7230
7127
  Name => 'FocusShiftInterval',
7231
7128
  PrintConv => '$val == 1? "1 Second" : sprintf("%.0f Seconds",$val)',
7232
7129
  },
7233
- 0xc446 => {
7130
+ 0x1b4 => {
7234
7131
  Name => 'FocusShiftExposureLock',
7235
7132
  PrintConv => \%offOn,
7236
7133
  },
7237
- #0xc49c => HighISONoiseReduction
7238
- 0xc4a0 => {
7134
+ #0x20a => HighISONoiseReduction
7135
+ 0x20e => {
7239
7136
  Name => 'DiffractionCompensation',
7240
7137
  Format => 'int8u',
7241
7138
  PrintConv => \%offOn,
7242
7139
  },
7243
- #0xc4a1 => {Name => 'FlickerReductionShooting',}, #redundant with tag in NikonSettings
7244
- 0xc4a6 => {
7140
+ #0x20f => {Name => 'FlickerReductionShooting',}, #redundant with tag in NikonSettings
7141
+ 0x214 => {
7245
7142
  Name => 'FlashControlMode', #this and nearby tag values for flash may be set from either the Photo Shooting Menu or using the Flash unit menu
7246
7143
  RawConv => '$$self{FlashControlMode} = $val',
7247
7144
  PrintConv => {
@@ -7252,14 +7149,14 @@ my %nikonFocalConversions = (
7252
7149
  4 => 'Repeating Flash',
7253
7150
  },
7254
7151
  },
7255
- 0xc4ac => {
7152
+ 0x21a => {
7256
7153
  Name => 'FlashGNDistance',
7257
7154
  Condition => '$$self{FlashControlMode} == 2',
7258
7155
  Unknown => 1,
7259
7156
  ValueConv => '$val + 3',
7260
7157
  PrintConv => \%flashGNDistance,
7261
7158
  },
7262
- 0xc4b0 => {
7159
+ 0x21e => {
7263
7160
  Name => 'FlashOutput', #range[0,24] with 0=>Full; 1=>50%; then decreasing flash power in 1/3 stops to 0.39% (1/256 full power). #also found in FlashInfoUnknown at offset 0x0a (with different mappings)
7264
7161
  Condition => '$$self{FlashControlMode} >= 3',
7265
7162
  Unknown => 1,
@@ -7268,7 +7165,7 @@ my %nikonFocalConversions = (
7268
7165
  PrintConv => '$val>0.99 ? "Full" : sprintf("%.1f%%",$val*100)',
7269
7166
  PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
7270
7167
  },
7271
- 0xc4ba => {
7168
+ 0x228 => {
7272
7169
  Name => 'FlashRemoteControl',
7273
7170
  Unknown => 1,
7274
7171
  PrintConv => {
@@ -7277,12 +7174,12 @@ my %nikonFocalConversions = (
7277
7174
  2 => 'Remote Repeating',
7278
7175
  },
7279
7176
  },
7280
- 0xc4be => {
7177
+ 0x22c => {
7281
7178
  Name => 'FlashMasterControlMode', #tag name chosen for compatibility with those found in FlashInfo0102 & FlashInfo0103
7282
7179
  RawConv => '$$self{FlashGroupOptionsMasterMode} = $val',
7283
7180
  PrintConv => \%flashGroupOptionsMode,
7284
7181
  },
7285
- 0xc4c0 => {
7182
+ 0x22e => {
7286
7183
  Name => 'FlashMasterCompensation',
7287
7184
  Unknown => 1,
7288
7185
  Format => 'int8s',
@@ -7292,7 +7189,7 @@ my %nikonFocalConversions = (
7292
7189
  PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
7293
7190
  PrintConvInv => '$val',
7294
7191
  },
7295
- 0xc4c4 => {
7192
+ 0x232 => {
7296
7193
  Name => 'FlashMasterOutput',
7297
7194
  Unknown => 1,
7298
7195
  Condition => '$$self{FlashGroupOptionsMasterMode} == 1', #only for Mode=M
@@ -7301,7 +7198,7 @@ my %nikonFocalConversions = (
7301
7198
  PrintConv => '$val>0.99 ? "Full" : sprintf("%.1f%%",$val*100)',
7302
7199
  PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
7303
7200
  },
7304
- 0xc4c6 => {
7201
+ 0x234 => {
7305
7202
  Name => 'FlashWirelessOption',
7306
7203
  Unknown => 1,
7307
7204
  PrintConv => {
@@ -7309,7 +7206,7 @@ my %nikonFocalConversions = (
7309
7206
  1 => 'Off',
7310
7207
  },
7311
7208
  },
7312
- 0xc55c => {
7209
+ 0x2ca => {
7313
7210
  Name => 'MovieType',
7314
7211
  Unknown => 1,
7315
7212
  PrintConv => {
@@ -7317,13 +7214,12 @@ my %nikonFocalConversions = (
7317
7214
  1 => 'MP4',
7318
7215
  },
7319
7216
  },
7320
- # note: DecryptLen currently set to 0xc9c6 + 720
7321
7217
  );
7322
7218
 
7323
7219
  # shot information for the D610 firmware 1.00 (encrypted) - ref PH
7324
7220
  %Image::ExifTool::Nikon::ShotInfoD610 = (
7325
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7326
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7221
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7222
+ WRITE_PROC => \&ProcessNikonEncrypted,
7327
7223
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7328
7224
  VARS => { ID_LABEL => 'Index' },
7329
7225
  IS_SUBDIR => [ 0x07cf ],
@@ -7353,20 +7249,15 @@ my %nikonFocalConversions = (
7353
7249
 
7354
7250
  # shot information for the D810 firmware 1.00(PH)/1.01 (encrypted) - ref 28
7355
7251
  %Image::ExifTool::Nikon::ShotInfoD810 = (
7356
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7357
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7252
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7253
+ WRITE_PROC => \&ProcessNikonEncrypted,
7358
7254
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7359
- VARS => { ID_LABEL => 'Index' },
7360
- DATAMEMBER => [ 0x04, 0x24, 0x38, 0x40, 0x84, 0x01d0, 0x175e, 0x185d, 0x18ab ],
7361
- IS_SUBDIR => [ 0x18ab ],
7255
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x0c },
7256
+ DATAMEMBER => [ 0x04 ],
7257
+ IS_SUBDIR => [ 0x10, 0x24, 0x38, 0x40, 0x84 ],
7362
7258
  WRITABLE => 1,
7363
- FIRST_ENTRY => 0,
7364
7259
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7365
- NOTES => q{
7366
- These tags are extracted from encrypted data in images from the D810. Note
7367
- that the indices listed below are for firmware version 1.0, but they may be
7368
- different for other firmware versions.
7369
- },
7260
+ NOTES => 'These tags are extracted from encrypted data in images from the D810.',
7370
7261
  0x00 => {
7371
7262
  Name => 'ShotInfoVersion',
7372
7263
  Format => 'string[4]',
@@ -7381,39 +7272,64 @@ my %nikonFocalConversions = (
7381
7272
  },
7382
7273
  # 0x0c - number of entries in offset table (= 0x21)
7383
7274
  # 0x10 - int32u[val 0x0c]: offset table
7275
+ 0x10 => {
7276
+ Name => 'SettingsOffset',
7277
+ Format => 'int32u',
7278
+ SubDirectory => {
7279
+ TagTable => 'Image::ExifTool::Nikon::SettingsInfoD810',
7280
+ Start => '$val',
7281
+ },
7282
+ },
7384
7283
  0x24 => {
7385
7284
  Name => 'BracketingOffset',
7386
- DataMember => 'BracketingOffset',
7387
7285
  Format => 'int32u',
7388
- Writable => 0,
7389
- Hidden => 1,
7390
- RawConv => '$$self{BracketingOffset} = $val || 0x10000000; undef',
7286
+ SubDirectory => {
7287
+ TagTable => 'Image::ExifTool::Nikon::BracketingInfoD810',
7288
+ Start => '$val',
7289
+ },
7391
7290
  },
7392
7291
  0x38 => {
7393
7292
  Name => 'ISOAutoOffset',
7394
- DataMember => 'ISOAutoOffset',
7395
7293
  Format => 'int32u',
7396
- Writable => 0,
7397
- Hidden => 1,
7398
- RawConv => '$$self{ISOAutoOffset} = $val || 0x10000000; undef',
7294
+ SubDirectory => {
7295
+ TagTable => 'Image::ExifTool::Nikon::ISOAutoInfoD810',
7296
+ Start => '$val',
7297
+ },
7399
7298
  },
7400
7299
  0x40 => {
7401
7300
  Name => 'CustomSettingsOffset', # (relative offset from start of ShotInfo data)
7402
- DataMember => 'CustomSettingsOffset',
7403
7301
  Format => 'int32u',
7404
- Writable => 0,
7405
- Hidden => 1,
7406
- RawConv => '$$self{CustomSettingsOffset} = $val || 0x10000000; undef',
7302
+ SubDirectory => {
7303
+ TagTable => 'Image::ExifTool::NikonCustom::SettingsD810',
7304
+ Start => '$val',
7305
+ },
7407
7306
  },
7408
7307
  0x84 => {
7409
7308
  Name => 'OrientationOffset',
7410
- DataMember => 'OrientationOffset',
7411
7309
  Format => 'int32u',
7412
- Writable => 0,
7413
- Hidden => 1,
7414
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef',
7310
+ SubDirectory => {
7311
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
7312
+ Start => '$val',
7313
+ }
7415
7314
  },
7416
- 0x01d0 => {
7315
+ # (moves around too much and doesn't fit cleanly in the offset table)
7316
+ #0x38be => {
7317
+ # Name => 'Rotation',
7318
+ # Condition => '$$self{FirmwareVersion} =~ /^1\.0/',
7319
+ # Mask => 0x30,
7320
+ # PrintConv => {
7321
+ # 0 => 'Horizontal',
7322
+ # 1 => 'Rotate 270 CW',
7323
+ # 2 => 'Rotate 90 CW',
7324
+ # 3 => 'Rotate 180',
7325
+ # },
7326
+ #},
7327
+ );
7328
+
7329
+ %Image::ExifTool::Nikon::SettingsInfoD810 = (
7330
+ %binaryDataAttrs,
7331
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7332
+ 0x13c => {
7417
7333
  Name => 'SecondarySlotFunction',
7418
7334
  Mask => 0x03,
7419
7335
  PrintConv => {
@@ -7421,9 +7337,13 @@ my %nikonFocalConversions = (
7421
7337
  2 => 'Backup',
7422
7338
  3 => 'NEF Primary + JPG Secondary',
7423
7339
  },
7424
- Hook => '$varSize = $$self{BracketingOffset} - 0x1747',
7425
7340
  },
7426
- 0x1756 => {
7341
+ );
7342
+
7343
+ %Image::ExifTool::Nikon::BracketingInfoD810 = (
7344
+ %binaryDataAttrs,
7345
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7346
+ 0x0f => {
7427
7347
  Name => 'AEBracketingSteps',
7428
7348
  Mask => 0xff,
7429
7349
  PrintHex => 1,
@@ -7480,7 +7400,7 @@ my %nikonFocalConversions = (
7480
7400
  0xd6 => '5F3',
7481
7401
  },
7482
7402
  },
7483
- 0x1757 => {
7403
+ 0x10 => {
7484
7404
  Name => 'WBBracketingSteps',
7485
7405
  Condition => '$$self{FILE_TYPE} ne "TIFF"', # (covers NEF and TIFF)
7486
7406
  Mask => 0xff,
@@ -7523,7 +7443,7 @@ my %nikonFocalConversions = (
7523
7443
  0x28 => '9F 3',
7524
7444
  },
7525
7445
  },
7526
- 0x175e => {
7446
+ 0x17 => {
7527
7447
  Name => 'NikonMeteringMode',
7528
7448
  Mask => 0x03,
7529
7449
  PrintConv => {
@@ -7532,9 +7452,13 @@ my %nikonFocalConversions = (
7532
7452
  2 => 'Spot',
7533
7453
  3 => 'Highlight'
7534
7454
  },
7535
- Hook => '$varSize = $$self{ISOAutoOffset} - 0x1858',
7536
7455
  },
7537
- 0x185c => {
7456
+ );
7457
+
7458
+ %Image::ExifTool::Nikon::ISOAutoInfoD810 = (
7459
+ %binaryDataAttrs,
7460
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7461
+ 0x04 => {
7538
7462
  Name => 'ISOAutoShutterTime',
7539
7463
  Mask => 0x3f,
7540
7464
  PrintConv => {
@@ -7577,7 +7501,7 @@ my %nikonFocalConversions = (
7577
7501
  36 => 'Auto (Fastest)',
7578
7502
  },
7579
7503
  },
7580
- 0x185d => {
7504
+ 0x05 => {
7581
7505
  Name => 'ISOAutoHiLimit',
7582
7506
  Mask => 0xff,
7583
7507
  PrintHex => 1,
@@ -7624,69 +7548,18 @@ my %nikonFocalConversions = (
7624
7548
  0x6c => 'ISO Hi 4.0',
7625
7549
  0x72 => 'ISO Hi 5.0',
7626
7550
  },
7627
- Hook => '$varSize = $$self{CustomSettingsOffset} - 0x18ab',
7628
- },
7629
- 0x18ab => { # (actual offset adjusted by Hook above)
7630
- Name => 'CustomSettingsD810',
7631
- Format => 'undef[53]',
7632
- SubDirectory => {
7633
- TagTable => 'Image::ExifTool::NikonCustom::SettingsD810',
7634
- },
7635
- Hook => '$varSize = $$self{OrientationOffset} - 0x36f4',
7636
7551
  },
7637
- 0x36f4 => {
7638
- Name => 'RollAngle',
7639
- Format => 'fixed32u',
7640
- Notes => 'converted to degrees of clockwise camera roll',
7641
- ValueConv => '$val <= 180 ? $val : $val - 360',
7642
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7643
- PrintConv => 'sprintf("%.1f", $val)',
7644
- PrintConvInv => '$val',
7645
- },
7646
- 0x36f8 => {
7647
- Name => 'PitchAngle',
7648
- Format => 'fixed32u',
7649
- Notes => 'converted to degrees of upward camera tilt',
7650
- ValueConv => '$val <= 180 ? $val : $val - 360',
7651
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7652
- PrintConv => 'sprintf("%.1f", $val)',
7653
- PrintConvInv => '$val',
7654
- },
7655
- 0x36fc => {
7656
- Name => 'YawAngle',
7657
- Format => 'fixed32u',
7658
- Notes => 'the camera yaw angle when shooting in portrait orientation',
7659
- ValueConv => '$val <= 180 ? $val : $val - 360',
7660
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7661
- PrintConv => 'sprintf("%.1f", $val)',
7662
- PrintConvInv => '$val',
7663
- },
7664
- # note: DecryptLen currently set to OrientationOffset + 12
7665
-
7666
- # (moves around too much and doesn't fit cleanly in the offset table)
7667
- #0x38be => {
7668
- # Name => 'Rotation',
7669
- # Condition => '$$self{FirmwareVersion} =~ /^1\.0/',
7670
- # Mask => 0x30,
7671
- # PrintConv => {
7672
- # 0 => 'Horizontal',
7673
- # 1 => 'Rotate 270 CW',
7674
- # 2 => 'Rotate 90 CW',
7675
- # 3 => 'Rotate 180',
7676
- # },
7677
- #},
7678
7552
  );
7679
7553
 
7680
7554
  # shot information for the D850 firmware 1.00b (encrypted) - ref 28
7681
7555
  %Image::ExifTool::Nikon::ShotInfoD850 = (
7682
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7683
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7556
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7557
+ WRITE_PROC => \&ProcessNikonEncrypted,
7684
7558
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7685
- VARS => { ID_LABEL => 'Index' },
7686
- DATAMEMBER => [ 0x04, 0x58, 0xa0, 0x0fbf, 0x2efa ],
7687
- IS_SUBDIR => [ 0x1038 ],
7559
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x0c },
7560
+ DATAMEMBER => [ 0x04 ],
7561
+ IS_SUBDIR => [ 0x10, 0x4c, 0x58, 0xa0 ],
7688
7562
  WRITABLE => 1,
7689
- FIRST_ENTRY => 0,
7690
7563
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7691
7564
  NOTES => 'These tags are extracted from encrypted data in images from the D850.',
7692
7565
  0x00 => {
@@ -7701,23 +7574,44 @@ my %nikonFocalConversions = (
7701
7574
  Writable => 0,
7702
7575
  RawConv => '$$self{FirmwareVersion} = $val',
7703
7576
  },
7577
+ 0x10 => {
7578
+ Name => 'MenuSettingsOffset',
7579
+ Format => 'int32u',
7580
+ SubDirectory => {
7581
+ TagTable => 'Image::ExifTool::Nikon::MenuSettingsD850',
7582
+ Start => '$val',
7583
+ },
7584
+ },
7585
+ 0x4c => {
7586
+ Name => 'MoreSettingsOffset',
7587
+ Format => 'int32u',
7588
+ SubDirectory => {
7589
+ TagTable => 'Image::ExifTool::Nikon::MoreSettingsD850',
7590
+ Start => '$val',
7591
+ },
7592
+ },
7704
7593
  0x58 => {
7705
- Name => 'CustomSettingsOffset', # (relative offset from start of ShotInfo data)
7706
- DataMember => 'CustomSettingsOffset',
7594
+ Name => 'CustomSettingsOffset',
7707
7595
  Format => 'int32u',
7708
- Writable => 0,
7709
- Hidden => 1,
7710
- RawConv => '$$self{CustomSettingsOffset} = $val || 0x10000000; undef',
7596
+ SubDirectory => {
7597
+ TagTable => 'Image::ExifTool::NikonCustom::SettingsD850',
7598
+ Start => '$val',
7599
+ },
7711
7600
  },
7712
7601
  0xa0 => {
7713
7602
  Name => 'OrientationOffset',
7714
- DataMember => 'OrientationOffset',
7715
7603
  Format => 'int32u',
7716
- Writable => 0,
7717
- Hidden => 1,
7718
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef',
7604
+ SubDirectory => {
7605
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
7606
+ Start => '$val',
7607
+ },
7719
7608
  },
7720
- 0x0791 => {
7609
+ );
7610
+
7611
+ %Image::ExifTool::Nikon::MenuSettingsD850 = (
7612
+ %binaryDataAttrs,
7613
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7614
+ 0x06dd => {
7721
7615
  Name => 'PhotoShootingMenuBankImageArea',
7722
7616
  Mask => 0x07,
7723
7617
  PrintConv => {
@@ -7728,7 +7622,12 @@ my %nikonFocalConversions = (
7728
7622
  4 => '1:1 (24x24)',
7729
7623
  },
7730
7624
  },
7731
- 0x0fbd => {
7625
+ );
7626
+
7627
+ %Image::ExifTool::Nikon::MoreSettingsD850 = (
7628
+ %binaryDataAttrs,
7629
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
7630
+ 0x24 => {
7732
7631
  Name => 'PhotoShootingMenuBank',
7733
7632
  Condition => '$$self{FILE_TYPE} eq "JPEG"',
7734
7633
  Notes => 'valid for JPEG images only',
@@ -7740,63 +7639,20 @@ my %nikonFocalConversions = (
7740
7639
  3 => 'D',
7741
7640
  },
7742
7641
  },
7743
- 0x0fbf => {
7642
+ 0x25 => {
7744
7643
  Name => 'PrimarySlot',
7745
7644
  Mask => 0x80,
7746
7645
  PrintConv => {
7747
7646
  0 => 'XQD Card',
7748
7647
  1 => 'SD Card',
7749
7648
  },
7750
- Hook => '$varSize = $$self{CustomSettingsOffset} - 0x1038',
7751
- },
7752
- 0x1038 => {
7753
- Name => 'CustomSettingsD850',
7754
- Format => 'undef[90]',
7755
- SubDirectory => {
7756
- TagTable => 'Image::ExifTool::NikonCustom::SettingsD850',
7757
- },
7758
- },
7759
- ### 0x2efb - OrientationInfo start (D850 firmware 1.01a)
7760
- 0x2efa => {
7761
- Name => 'Hook1',
7762
- Hidden => 1,
7763
- RawConv => 'undef',
7764
- # account for variable location of OrientationInfo data
7765
- Hook => '$varSize = $$self{OrientationOffset} - 0x2efb',
7766
- },
7767
- 0x2efb => { #28
7768
- Name => 'RollAngle',
7769
- Format => 'fixed32u',
7770
- Notes => 'converted to degrees of clockwise camera roll',
7771
- ValueConv => '$val <= 180 ? $val : $val - 360',
7772
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7773
- PrintConv => 'sprintf("%.1f", $val)',
7774
- PrintConvInv => '$val',
7775
- },
7776
- 0x2eff => { #28
7777
- Name => 'PitchAngle',
7778
- Format => 'fixed32u',
7779
- Notes => 'converted to degrees of upward camera tilt',
7780
- ValueConv => '$val <= 180 ? $val : $val - 360',
7781
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7782
- PrintConv => 'sprintf("%.1f", $val)',
7783
- PrintConvInv => '$val',
7784
- },
7785
- 0x2f03 => { #28
7786
- Name => 'YawAngle',
7787
- Format => 'fixed32u',
7788
- Notes => 'the camera yaw angle when shooting in portrait orientation',
7789
- ValueConv => '$val <= 180 ? $val : $val - 360',
7790
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
7791
- PrintConv => 'sprintf("%.1f", $val)',
7792
- PrintConvInv => '$val',
7793
7649
  },
7794
- # note: DecryptLen currently set to 0x2f07
7795
7650
  );
7651
+
7796
7652
  # shot information for the D4 firmware 1.00g (ref PH)
7797
7653
  %Image::ExifTool::Nikon::ShotInfoD4 = (
7798
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7799
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7654
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7655
+ WRITE_PROC => \&ProcessNikonEncrypted,
7800
7656
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7801
7657
  VARS => { ID_LABEL => 'Index' },
7802
7658
  IS_SUBDIR => [ 0x0751 ],
@@ -7827,12 +7683,12 @@ my %nikonFocalConversions = (
7827
7683
 
7828
7684
  # shot information for the D4S firmware 1.01a (ref 28, encrypted)
7829
7685
  %Image::ExifTool::Nikon::ShotInfoD4S = (
7830
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7831
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7686
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7687
+ WRITE_PROC => \&ProcessNikonEncrypted,
7832
7688
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
7833
7689
  VARS => { ID_LABEL => 'Index' },
7834
7690
  DATAMEMBER => [ 4 ],
7835
- IS_SUBDIR => [ 0x189d, 0x193d ],
7691
+ IS_SUBDIR => [ 0x189d, 0x193d, 0x350b ],
7836
7692
  WRITABLE => 1,
7837
7693
  FIRST_ENTRY => 0,
7838
7694
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
@@ -8096,31 +7952,13 @@ my %nikonFocalConversions = (
8096
7952
  # },
8097
7953
  # },
8098
7954
  0x350b => {
8099
- Name => 'RollAngle',
8100
- Format => 'fixed32u',
8101
- Notes => 'converted to degrees of clockwise camera roll',
8102
- ValueConv => '$val < 180 ? -$val : 360 - $val',
8103
- ValueConvInv => '$val <= 0 ? -$val : 360 - $val',
8104
- PrintConv => 'sprintf("%.1f", $val)',
8105
- PrintConvInv => '$val',
8106
- },
8107
- 0x350f => {
8108
- Name => 'PitchAngle',
8109
- Format => 'fixed32u',
8110
- Notes => 'converted to degrees of upward camera tilt',
8111
- ValueConv => '$val <= 180 ? $val : $val - 360',
8112
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
8113
- PrintConv => 'sprintf("%.1f", $val)',
8114
- PrintConvInv => '$val',
8115
- },
8116
- 0x3513 => {
8117
- Name => 'YawAngle',
8118
- Format => 'fixed32u',
8119
- Notes => 'the camera yaw angle when shooting in portrait orientation',
8120
- ValueConv => '$val <= 180 ? $val : $val - 360',
8121
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
8122
- PrintConv => 'sprintf("%.1f", $val)',
8123
- PrintConvInv => '$val',
7955
+ Name => 'OrientationInfo',
7956
+ Format => 'undef[12]',
7957
+ SubDirectory => {
7958
+ # Note: pitch angle may be wrong sign for this model?
7959
+ # (pitch sign was changed without verification to use same decoding as other models)
7960
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
7961
+ },
8124
7962
  },
8125
7963
  0x3693 => {
8126
7964
  Name => 'Rotation',
@@ -8137,15 +7975,13 @@ my %nikonFocalConversions = (
8137
7975
 
8138
7976
  # shot information for the Z7II firmware 1.00 (encrypted) - ref 28
8139
7977
  %Image::ExifTool::Nikon::ShotInfoZ7II = (
8140
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
8141
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
7978
+ PROCESS_PROC => \&ProcessNikonEncrypted,
7979
+ WRITE_PROC => \&ProcessNikonEncrypted,
8142
7980
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
8143
- VARS => { ID_LABEL => 'Index' },
8144
- DATAMEMBER => [ 0x04, 0x30, 0x38, 0x98, 0xa0, 0x75e7, 0x760c,
8145
- 0x7610, 0x7eff, 0xce31, 0xcea5, 0xceb6, 0xceb7 ],
8146
- IS_SUBDIR => [ 0xceb8 ],
7981
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x24 },
7982
+ DATAMEMBER => [ 0x04 ],
7983
+ IS_SUBDIR => [ 0x30, 0x38, 0x98, 0xa0 ],
8147
7984
  WRITABLE => 1,
8148
- FIRST_ENTRY => 0,
8149
7985
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8150
7986
  NOTES => 'These tags are extracted from encrypted data in images from the Z7II.',
8151
7987
  0x00 => {
@@ -8174,79 +8010,73 @@ my %nikonFocalConversions = (
8174
8010
  },
8175
8011
  0x24 => {
8176
8012
  Name => 'NumberOffsets', # number of entries in offset table. offsets are from start of ShotInfo data.
8177
- DataMember => 'NumberOffsets',
8178
8013
  Format => 'int32u',
8179
8014
  Writable => 0,
8180
8015
  Hidden => 1,
8181
8016
  },
8182
8017
  0x30 => {
8183
- Name => 'Offset3',
8184
- DataMember => 'Offset3',
8018
+ Name => 'IntervalOffset',
8185
8019
  Format => 'int32u',
8186
- Writable => 0,
8187
- Hidden => 1,
8188
- RawConv => '$$self{Offset3} = $val || 0x10000000; undef', # (ignore if 0)
8020
+ SubDirectory => {
8021
+ TagTable => 'Image::ExifTool::Nikon::IntervalInfoZ7II',
8022
+ Start => '$val',
8023
+ }
8189
8024
  },
8190
8025
  0x38 => {
8191
- Name => 'Offset5',
8192
- DataMember => 'Offset5',
8026
+ Name => 'PortraitOffset',
8193
8027
  Format => 'int32u',
8194
- Writable => 0,
8195
- Hidden => 1,
8196
- RawConv => '$$self{Offset5} = $val || 0x10000000; undef', # (ignore if 0)
8028
+ SubDirectory => {
8029
+ TagTable => 'Image::ExifTool::Nikon::PortraitInfoZ7II',
8030
+ Start => '$val',
8031
+ }
8197
8032
  },
8198
8033
  0x98 => {
8199
8034
  Name => 'OrientationOffset',
8200
- DataMember => 'OrientationOffset',
8201
8035
  Format => 'int32u',
8202
- Writable => 0,
8203
- Hidden => 1,
8204
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef', # (ignore if 0)
8036
+ SubDirectory => {
8037
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
8038
+ Start => '$val',
8039
+ }
8205
8040
  },
8206
8041
  0xa0 => {
8207
- Name => 'Offset31',
8208
- DataMember => 'Offset31',
8042
+ Name => 'MenuOffset',
8209
8043
  Format => 'int32u',
8210
- Writable => 0,
8211
- Hidden => 1,
8212
- RawConv => '$$self{Offset31} = $val || 0x10000000; undef', # (ignore if 0)
8213
- },
8214
- ### 0x75e8 - Offset3 info start (Z7II firmware 1.30)
8215
- 0x75e7 => {
8216
- Name => 'Hook1',
8217
- Hidden => 1,
8218
- RawConv => 'undef',
8219
- # account for variable location of Offset3 data
8220
- Hook => '$varSize = $$self{Offset3} - 0x75e8',
8044
+ SubDirectory => {
8045
+ TagTable => 'Image::ExifTool::Nikon::MenuInfoZ7II',
8046
+ Start => '$val',
8047
+ },
8221
8048
  },
8222
- 0x760c => {
8049
+ );
8050
+
8051
+ %Image::ExifTool::Nikon::IntervalInfoZ7II = (
8052
+ %binaryDataAttrs,
8053
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8054
+ DATAMEMBER => [ 0x24, 0x28 ],
8055
+ 0x24 => {
8223
8056
  Name => 'IntervalShooting',
8224
8057
  RawConv => '$$self{IntervalShooting} = $val',
8225
8058
  Format => 'int16u',
8226
8059
  PrintConv => q{
8227
8060
  return 'Off' if $val == 0 ;
8228
- my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}); # something like "Interval 1 of 3"
8229
- my $f = $$self{IntervalShootingShotsPerInterval} > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}): '' ; # something like "Frame 1 of 3" or blank
8061
+ my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0); # something like "Interval 1 of 3"
8062
+ my $f = ($$self{IntervalShootingShotsPerInterval}||0) > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0): '' ; # something like "Frame 1 of 3" or blank
8230
8063
  return "On: $i$f"
8231
- #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}, $$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}),
8064
+ #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0, $$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0),
8232
8065
  },
8233
8066
  },
8234
- 0x7610 => {
8067
+ 0x28 => {
8235
8068
  Name => 'IntervalFrame',
8236
8069
  RawConv => '$$self{IntervalFrame} = $val',
8237
8070
  Condition => '$$self{IntervalShooting} > 0',
8238
8071
  Format => 'int16u',
8239
8072
  Hidden => 1,
8240
8073
  },
8241
- ### 0x7f00 - Offset5 info start (Z7II firmware 1.30)
8242
- 0x7eff => {
8243
- Name => 'Hook2',
8244
- Hidden => 1,
8245
- RawConv => 'undef',
8246
- # account for variable location of Offset5 data
8247
- Hook => '$varSize = $$self{Offset5} - 0x7f00',
8248
- },
8249
- 0x7fa0 => { #28
8074
+ );
8075
+
8076
+ %Image::ExifTool::Nikon::PortraitInfoZ7II = (
8077
+ %binaryDataAttrs,
8078
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8079
+ 0xa0 => { #28
8250
8080
  Name => 'PortraitImpressionBalance', # will be 0 for firmware 1.21 and earlier; firmware 1.30 onward: will be set by Photo Shooting Menu entry Portrait Impression Balance
8251
8081
  # offset5+160; 128 is neutral; >128 increases Yellow; <128 increases Magenta; increments of 4 result from 1 full unit adjustment on the camera
8252
8082
  # offset5+161 128 is neutral; >128 increases Brightness; <128 decreases Brightness
@@ -8262,83 +8092,31 @@ my %nikonFocalConversions = (
8262
8092
  return "$color $brightness"
8263
8093
  },
8264
8094
  },
8265
- ### 0xce32 - OrientationInfo start (Z7II firmware 1.00)
8266
- 0xce31 => {
8267
- Name => 'Hook3',
8268
- Hidden => 1,
8269
- RawConv => 'undef',
8270
- # account for variable location of OrientationInfo data
8271
- Hook => '$varSize = $$self{OrientationOffset} - 0xce32',
8272
- },
8095
+ );
8273
8096
 
8274
- 0xce32 => {
8275
- Name => 'RollAngle',
8276
- Format => 'fixed32u',
8277
- Notes => 'converted to degrees of clockwise camera roll',
8278
- ValueConv => '$val <= 180 ? $val : $val - 360',
8279
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
8280
- PrintConv => 'sprintf("%.1f", $val)',
8281
- PrintConvInv => '$val',
8282
- },
8283
- 0xce36 => {
8284
- Name => 'PitchAngle',
8285
- Format => 'fixed32u',
8286
- Notes => 'converted to degrees of upward camera tilt',
8287
- ValueConv => '$val <= 180 ? $val : $val - 360',
8288
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
8289
- PrintConv => 'sprintf("%.1f", $val)',
8290
- PrintConvInv => '$val',
8291
- },
8292
- 0xce3a => {
8293
- Name => 'YawAngle',
8294
- Format => 'fixed32u',
8295
- Notes => 'the camera yaw angle when shooting in portrait orientation',
8296
- ValueConv => '$val <= 180 ? $val : $val - 360',
8297
- ValueConvInv => '$val >= 0 ? $val : $val + 360',
8298
- PrintConv => 'sprintf("%.1f", $val)',
8299
- PrintConvInv => '$val',
8300
- },
8301
- 0xcea5 => {
8302
- Name => 'Hook4',
8303
- Hidden => 1,
8304
- RawConv => 'undef',
8305
- # account for variable location of Offset31 data
8306
- Hook => '$varSize = $$self{Offset31} - 0xcea6',
8307
- },
8308
- ### 0xcea6 - Offset31 info start (Z7II firmware 1.30)
8309
- 0xceb6 => {
8310
- Name => 'MenuSettingsZ7IIOffset',
8311
- # offset to MenuSettingsZ7II is relative to start of Offset31 block
8312
- RawConv => '$$self{MenuSettingsZ7IIOffset} = ($val || 0x10000000) + $$self{Offset31}; undef', # (ignore if 0)
8313
- },
8314
- 0xceb7 => {
8315
- Name => 'Hook5',
8316
- Hidden => 1,
8317
- RawConv => 'undef',
8318
- # account for variable location of Offset5 data
8319
- Hook => '$varSize = $$self{MenuSettingsZ7IIOffset} - 0xceb8',
8320
- },
8321
- 0xceb8 => { # (this is 0xd04e for the Z50)
8322
- Name => 'MenuSettingsZ7II',
8323
- Format => 'undef[860]',
8097
+ %Image::ExifTool::Nikon::MenuInfoZ7II = (
8098
+ %binaryDataAttrs,
8099
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8100
+ IS_SUBDIR => [ 0x10 ],
8101
+ 0x10 => {
8102
+ Name => 'MenuSettingsOffsetZ7II',
8103
+ Format => 'int32u',
8324
8104
  SubDirectory => {
8325
8105
  TagTable => 'Image::ExifTool::Nikon::MenuSettingsZ7II',
8106
+ Start => '$dirStart + $val',
8326
8107
  },
8327
- }
8328
- # note: DecryptLen currently set to 0xd04e + 860 (offset for Z50 is 0xd04e)
8108
+ },
8329
8109
  );
8330
8110
 
8331
8111
  # shot information for the Z9 firmware 1.00 (encrypted) - ref 28
8332
8112
  %Image::ExifTool::Nikon::ShotInfoZ9 = (
8333
- PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
8334
- WRITE_PROC => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
8113
+ PROCESS_PROC => \&ProcessNikonEncrypted,
8114
+ WRITE_PROC => \&ProcessNikonEncrypted,
8335
8115
  CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
8336
- VARS => { ID_LABEL => 'Index' },
8337
- DATAMEMBER => [ 0x04, 0x30, 0x38, 0x84, 0x8c, 0x6c6f, 0x6c90, 0x6c98,
8338
- 0x6c9a, 0xeaea, 0xeb6f, 0xeb70 ],
8339
- IS_SUBDIR => [ 0xec4b ],
8116
+ VARS => { ID_LABEL => 'Index', NIKON_OFFSETS => 0x24 },
8117
+ DATAMEMBER => [ 0x04 ],
8118
+ IS_SUBDIR => [ 0x30, 0x84, 0x8c ],
8340
8119
  WRITABLE => 1,
8341
- FIRST_ENTRY => 0,
8342
8120
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8343
8121
  NOTES => 'These tags are extracted from encrypted data in images from the Z9.',
8344
8122
  0x00 => {
@@ -8367,53 +8145,45 @@ my %nikonFocalConversions = (
8367
8145
  },
8368
8146
  0x24 => {
8369
8147
  Name => 'NumberOffsets', # number of entries in offset table. offsets are from start of ShotInfo data.
8370
- DataMember => 'NumberOffsets',
8371
8148
  Format => 'int32u',
8372
8149
  Writable => 0,
8373
8150
  Hidden => 1,
8374
8151
  },
8152
+ # subdirectories, referenced by offsets (not processed if offset is zero)
8375
8153
  0x30 => {
8376
- Name => 'Offset3', #offset3 - length 2528 (Z9 firmware 1.0)
8377
- DataMember => 'Offset3',
8378
- Format => 'int32u',
8379
- Writable => 0,
8380
- Hidden => 1,
8381
- RawConv => '$$self{Offset3} = $val || 0x10000000; undef', # (ignore if 0)
8382
- },
8383
- 0x38 => {
8384
- Name => 'Offset5', #offset5 - length 2488 (Z9 firmware 1.0)
8385
- DataMember => 'Offset5',
8154
+ Name => 'SequenceOffset',
8386
8155
  Format => 'int32u',
8387
- Writable => 0,
8388
- Hidden => 1,
8389
- RawConv => '$$self{Offset5} = $val || 0x10000000; undef', # (ignore if 0)
8156
+ SubDirectory => {
8157
+ TagTable => 'Image::ExifTool::Nikon::SeqInfoZ9',
8158
+ Start => '$val',
8159
+ },
8390
8160
  },
8391
8161
  0x84 => {
8392
- Name => 'OrientationOffset', #offset24 - length 108 (Z9 firmware 1.0)
8393
- DataMember => 'OrientationOffset',
8162
+ Name => 'OrientOffset',
8163
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96', #not valid for C30/C60/C120
8394
8164
  Format => 'int32u',
8395
- Writable => 0,
8396
- Hidden => 1,
8397
- RawConv => '$$self{OrientationOffset} = $val || 0x10000000; undef', # (ignore if 0)
8165
+ SubDirectory => {
8166
+ TagTable => 'Image::ExifTool::Nikon::OrientationInfo',
8167
+ Start => '$val',
8168
+ },
8398
8169
  },
8399
8170
  0x8c => {
8400
- Name => 'Offset26', #offset26 - length 1895 (Z9 firmware 1.0)
8401
- DataMember => 'Offset26',
8171
+ Name => 'MenuOffset',
8402
8172
  Format => 'int32u',
8403
- Writable => 0,
8404
- Hidden => 1,
8405
- RawConv => '$$self{Offset26} = $val || 0x10000000; undef', # (ignore if 0)
8406
- },
8407
- ### 0x6c70 - Offset3 info start (Z9 firmware 1.00)
8408
- 0x6c6f => {
8409
- Name => 'Offset3Hook',
8410
- Hidden => 1,
8411
- RawConv => 'undef',
8412
- # account for variable location of Offset3 data
8413
- Hook => '$varSize = $$self{Offset3} - 0x6c70',
8173
+ SubDirectory => {
8174
+ TagTable => 'Image::ExifTool::Nikon::MenuInfoZ9',
8175
+ Start => '$val',
8176
+ },
8414
8177
  },
8415
- 0x6c90 => {
8178
+ );
8179
+
8180
+ %Image::ExifTool::Nikon::SeqInfoZ9 = (
8181
+ %binaryDataAttrs,
8182
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8183
+ DATAMEMBER => [ 0x20, 0x28, 0x2a ],
8184
+ 0x0020 => {
8416
8185
  Name => 'FocusShiftShooting',
8186
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96', #not valid for C30/C60/C120
8417
8187
  RawConv => '$$self{FocusShiftShooting} = $val',
8418
8188
  PrintConv => q{
8419
8189
  return 'Off' if $val == 0 ;
@@ -8421,34 +8191,60 @@ my %nikonFocalConversions = (
8421
8191
  return "On: $i"
8422
8192
  },
8423
8193
  },
8424
- 0x6c98 => {
8194
+ 0x0028 => {
8425
8195
  Name => 'IntervalShooting',
8196
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96', #not valid for C30/C60/C120
8426
8197
  RawConv => '$$self{IntervalShooting} = $val',
8427
8198
  Format => 'int16u',
8428
8199
  PrintConv => q{
8429
8200
  return 'Off' if $val == 0 ;
8430
- my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}); # something like "Interval 1 of 3"
8431
- my $f = $$self{IntervalShootingShotsPerInterval} > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}): '' ; # something like "Frame 1 of 3" or blank
8201
+ my $i = sprintf("Interval %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0); # something like "Interval 1 of 3"
8202
+ my $f = ($$self{IntervalShootingShotsPerInterval}||0) > 1 ? sprintf(" Frame %.0f of %.0f",$$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0): '' ; # something like "Frame 1 of 3" or blank
8432
8203
  return "On: $i$f"
8433
- #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}, $$self{IntervalFrame}, $$self{IntervalShootingShotsPerInterval}),
8204
+ #$val == 0 ? 'Off' : sprintf("On: Interval %.0f of %.0f Frame %.0f of %.0f",$val, $$self{IntervalShootingIntervals}||0, $$self{IntervalFrame}||0, $$self{IntervalShootingShotsPerInterval}||0),
8434
8205
  },
8435
8206
  },
8436
- 0x6c9a => {
8207
+ 0x002a => {
8437
8208
  Name => 'IntervalFrame',
8438
8209
  RawConv => '$$self{IntervalFrame} = $val',
8439
- Condition => '$$self{IntervalShooting} > 0',
8210
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8440
8211
  Format => 'int16u',
8441
8212
  Hidden => 1,
8442
8213
  },
8443
- ### 0xeaeb - OrientationInfo start (Z9 firmware 1.00)
8444
- 0xeaea => {
8445
- Name => 'OrientationHook',
8446
- Hidden => 1,
8447
- RawConv => 'undef',
8448
- # account for variable location of OrientationInfo data
8449
- Hook => '$varSize = $$self{OrientationOffset} - 0xeaeb',
8450
- },
8451
- 0xeaeb => {
8214
+ );
8215
+
8216
+ %Image::ExifTool::Nikon::MenuInfoZ9 = (
8217
+ %binaryDataAttrs,
8218
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8219
+ IS_SUBDIR => [ 0x10 ],
8220
+ # 0x00 - int32u size of this directory
8221
+ 0x10 => [
8222
+ {
8223
+ Name => 'MenuSettingsOffsetZ9',
8224
+ Condition => '$$self{FirmwareVersion} and $$self{FirmwareVersion} lt "03.00"',
8225
+ Format => 'int32u',
8226
+ Notes => 'Firmware versions 2.11 and earlier',
8227
+ SubDirectory => {
8228
+ TagTable => 'Image::ExifTool::Nikon::MenuSettingsZ9',
8229
+ Start => '$dirStart + $val',
8230
+ },
8231
+ },
8232
+ {
8233
+ Name => 'MenuSettingsOffsetZ9v3',
8234
+ Notes => 'Firmware versions 3.0 and later',
8235
+ Format => 'int32u',
8236
+ SubDirectory => {
8237
+ TagTable => 'Image::ExifTool::Nikon::MenuSettingsZ9v3',
8238
+ Start => '$dirStart + $val',
8239
+ },
8240
+ },
8241
+ ],
8242
+ );
8243
+
8244
+ %Image::ExifTool::Nikon::OrientationInfo = (
8245
+ %binaryDataAttrs,
8246
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8247
+ 0 => {
8452
8248
  Name => 'RollAngle',
8453
8249
  Format => 'fixed32u',
8454
8250
  Notes => 'converted to degrees of clockwise camera roll',
@@ -8457,7 +8253,7 @@ my %nikonFocalConversions = (
8457
8253
  PrintConv => 'sprintf("%.1f", $val)',
8458
8254
  PrintConvInv => '$val',
8459
8255
  },
8460
- 0xeaef => {
8256
+ 4 => {
8461
8257
  Name => 'PitchAngle',
8462
8258
  Format => 'fixed32u',
8463
8259
  Notes => 'converted to degrees of upward camera tilt',
@@ -8466,7 +8262,7 @@ my %nikonFocalConversions = (
8466
8262
  PrintConv => 'sprintf("%.1f", $val)',
8467
8263
  PrintConvInv => '$val',
8468
8264
  },
8469
- 0xeaf3 => {
8265
+ 8 => {
8470
8266
  Name => 'YawAngle',
8471
8267
  Format => 'fixed32u',
8472
8268
  Notes => 'the camera yaw angle when shooting in portrait orientation',
@@ -8475,48 +8271,25 @@ my %nikonFocalConversions = (
8475
8271
  PrintConv => 'sprintf("%.1f", $val)',
8476
8272
  PrintConvInv => '$val',
8477
8273
  },
8478
- ### 0xeb5f - Offset26 info start (Z9 firmware 1.00)
8479
- 0xeb6f => {
8480
- Name => 'MenuSettingsZ9Offset',
8481
- Writable => 0,
8482
- Hidden => 1,
8483
- # offset to MenuSettingsZ9 is relative to start of Offset26 block
8484
- RawConv => '$$self{MenuSettingsZ9Offset} = ($val || 0x10000000) + $$self{Offset26}; undef', # (ignore if 0)
8485
- },
8486
- 0xeb70 => {
8487
- Name => 'Hook5',
8488
- Hidden => 1,
8489
- RawConv => 'undef',
8490
- # account for variable location of menu settings data
8491
- Hook => '$varSize = $$self{MenuSettingsZ9Offset} - 0xec4b',
8492
- },
8493
- 0xec4b => [
8494
- {
8495
- Name => 'MenuSettingsZ9',
8496
- Condition => '$$self{FirmwareVersion} lt "03.00"',
8497
- Format => 'undef[1646]',
8498
- Notes => 'Firmware versions 2.11 and earlier',
8499
- SubDirectory => {
8500
- TagTable => 'Image::ExifTool::Nikon::MenuSettingsZ9',
8501
- },
8502
- },
8503
- {
8504
- Name => 'MenuSettingsZ9',
8505
- Notes => 'Firmware versions 3.0 and later',
8506
- Format => 'undef[1948]',
8507
- SubDirectory => {
8508
- TagTable => 'Image::ExifTool::Nikon::MenuSettingsZ9Firmware3',
8509
- },
8510
- },
8511
- ],
8512
- # note: DecryptLen currently set to 0xec4b + 2196
8513
8274
  );
8514
8275
 
8515
8276
  %Image::ExifTool::Nikon::MenuSettingsZ7II = (
8516
8277
  %binaryDataAttrs,
8517
8278
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8518
- DATAMEMBER => [ 176, 180, 328, 352, 858 ],
8279
+ DATAMEMBER => [ 90, 176, 180, 328, 352, 858 ],
8519
8280
  NOTES => 'These tags are used by the Z5, Z6, Z7, Z6II, Z7II, Z50 and Zfc.',
8281
+ #48 SelfTimer' #0=> no 1=> yes works for Z7II firmware 1.40, but not 1.30. Follow-up required.
8282
+ 90 => {
8283
+ Name => 'SingleFrame', #0=> Single Frame 1=> one of the continuous modes
8284
+ Hidden => 1,
8285
+ RawConv => '$$self{SingleFrame} = $val',
8286
+ },
8287
+ 92 => {
8288
+ Name => 'ReleaseMode',
8289
+ #ValueConv => '$$self{SelfTimer} == 1 ? 4 : $$self{SingleFrame} == 0 ? 5 : $val', #map single frame and timer to a unique values for PrintConv. Activate when SelfTimer tag is clarified for cameras other than Z7II fw 1.40
8290
+ ValueConv => '$$self{SingleFrame} == 0 ? 5 : $val', #map single frame to a unique value for PrintConv
8291
+ PrintConv => \%releaseModeZ7,
8292
+ },
8520
8293
  160 => {
8521
8294
  Name => 'IntervalDurationHours',
8522
8295
  Format => 'int32u',
@@ -8751,34 +8524,34 @@ my %nikonFocalConversions = (
8751
8524
  Name => 'Intervals',
8752
8525
  Format => 'int32u',
8753
8526
  RawConv => '$$self{IntervalShootingIntervals} = $val',
8754
- Condition => '$$self{IntervalShooting} > 0',
8527
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8755
8528
  },
8756
8529
  192 => {
8757
8530
  Name => 'ShotsPerInterval',
8758
8531
  Format => 'int32u',
8759
8532
  RawConv => '$$self{IntervalShootingShotsPerInterval} = $val',
8760
- Condition => '$$self{IntervalShooting} > 0',
8533
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8761
8534
  },
8762
8535
  #220 NEFCompression 0=> 'Lossless' 1=> 'High Efficiency*' 4=> 'High Efficientcy'
8763
8536
  232 => {
8764
8537
  Name => 'FocusShiftNumberShots', #1-300
8765
8538
  RawConv => '$$self{FocusShiftNumberShots} = $val',
8766
- Condition => '$$self{FocusShiftShooting} > 0',
8539
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8767
8540
  },
8768
8541
  236 => {
8769
8542
  Name => 'FocusShiftStepWidth', #1(Narrow) to 10 (Wide)
8770
- Condition => '$$self{FocusShiftShooting} > 0',
8543
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8771
8544
  },
8772
8545
  240 => {
8773
8546
  Name => 'FocusShiftInterval',
8774
- Condition => '$$self{FocusShiftShooting} > 0',
8547
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8775
8548
  PrintConv => '$val == 1? "1 Second" : sprintf("%.0f Seconds",$val)',
8776
8549
  },
8777
8550
  244 => {
8778
8551
  Name => 'FocusShiftExposureLock',
8779
8552
  Unknown => 1,
8780
8553
  PrintConv => \%offOn,
8781
- Condition => '$$self{FocusShiftShooting} > 0',
8554
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8782
8555
  },
8783
8556
  274 => { Name => 'PhotoShootingMenuBank', PrintConv => \%banksZ9 },
8784
8557
  276 => { Name => 'ExtendedMenuBanks', PrintConv => \%offOn }, #single tag from both Photo & Video menus
@@ -8933,17 +8706,22 @@ my %nikonFocalConversions = (
8933
8706
  1565 => { Name => 'SetClockFromLocationData', PrintConv => \%offOn, Unknown => 1 },
8934
8707
  1572 => { Name => 'AirplaneMode', PrintConv => \%offOn, Unknown => 1 },
8935
8708
  1573 => { Name => 'EmptySlotRelease', PrintConv => { 0 => 'Disable Release', 1 => 'Enable Release' }, Unknown => 1 },
8936
- 1608 => { Name => 'EnergySavingMode', PrintConv =>\%offOn, Unknown => 1 },
8709
+ 1608 => { Name => 'EnergySavingMode', PrintConv => \%offOn, Unknown => 1 },
8937
8710
  1632 => { Name => 'RecordLocationData', PrintConv => \%offOn, Unknown => 1 },
8938
8711
  1636 => { Name => 'USBPowerDelivery', PrintConv => \%offOn, Unknown => 1 },
8939
8712
  1645 => { Name => 'SensorShield', PrintConv => { 0 => 'Stays Open', 1 => 'Closes' }, Unknown => 1 },
8940
8713
  );
8941
- %Image::ExifTool::Nikon::MenuSettingsZ9Firmware3 = ( #starts at Offset26 + 248
8714
+
8715
+ %Image::ExifTool::Nikon::MenuSettingsZ9v3 = (
8942
8716
  %binaryDataAttrs,
8943
8717
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8944
8718
  DATAMEMBER => [ 154, 204, 208, 248, 444, 554 ],
8945
8719
  IS_SUBDIR => [ 847 ],
8946
8720
  NOTES => 'These tags are used by the Z9 firmware 3.00.',
8721
+ 72 => {
8722
+ Name => 'HighFrameRate', #CH and C30/C60/C120 but not CL
8723
+ PrintConv => \%highFrameRateZ9,
8724
+ },
8947
8725
  154 => {
8948
8726
  Name => 'MultipleExposureMode',
8949
8727
  RawConv => '$$self{MultipleExposureMode} = $val',
@@ -8954,33 +8732,33 @@ my %nikonFocalConversions = (
8954
8732
  Name => 'Intervals',
8955
8733
  Format => 'int32u',
8956
8734
  RawConv => '$$self{IntervalShootingIntervals} = $val',
8957
- Condition => '$$self{IntervalShooting} > 0',
8735
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8958
8736
  },
8959
8737
  208 => {
8960
8738
  Name => 'ShotsPerInterval',
8961
8739
  Format => 'int32u',
8962
8740
  RawConv => '$$self{IntervalShootingShotsPerInterval} = $val',
8963
- Condition => '$$self{IntervalShooting} > 0',
8741
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8964
8742
  },
8965
8743
  248 => {
8966
8744
  Name => 'FocusShiftNumberShots', #1-300
8967
8745
  RawConv => '$$self{FocusShiftNumberShots} = $val',
8968
- Condition => '$$self{FocusShiftShooting} > 0',
8746
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8969
8747
  },
8970
8748
  252 => {
8971
8749
  Name => 'FocusShiftStepWidth', #1(Narrow) to 10 (Wide)
8972
- Condition => '$$self{FocusShiftShooting} > 0',
8750
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8973
8751
  },
8974
8752
  256 => {
8975
8753
  Name => 'FocusShiftInterval',
8976
- Condition => '$$self{FocusShiftShooting} > 0',
8754
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8977
8755
  PrintConv => '$val == 1? "1 Second" : sprintf("%.0f Seconds",$val)',
8978
8756
  },
8979
8757
  260 => {
8980
8758
  Name => 'FocusShiftExposureLock',
8981
8759
  Unknown => 1,
8982
8760
  PrintConv => \%offOn,
8983
- Condition => '$$self{FocusShiftShooting} > 0',
8761
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8984
8762
  },
8985
8763
  290 => { Name => 'PhotoShootingMenuBank', PrintConv => \%banksZ9 },
8986
8764
  292 => { Name => 'ExtendedMenuBanks', PrintConv => \%offOn }, # single tag from both Photo & Video menus
@@ -9006,466 +8784,159 @@ my %nikonFocalConversions = (
9006
8784
  Name => 'ISOAutoShutterTime', # shutter speed is 2 ** (-$val/24)
9007
8785
  ValueConv => '$val / 8',
9008
8786
  Format => 'int16s',
9009
- PrintConv => \%iSOAutoShutterTimeZ9,
9010
- },
9011
- 436 => { Name => 'MovieVignetteControl', PrintConv => \%offLowNormalHighZ7, Unknown => 1 },
9012
- 438 => { Name => 'DiffractionCompensation', PrintConv => \%offOn }, # value can be set from both the Photo Shoot Menu and the Video Shooting Menu
9013
- 440 => { Name => 'FlickerReductionShooting',PrintConv => \%offOn },
9014
- 444 => {
9015
- Name => 'FlashControlMode', # this and nearby tag values for flash may be set from either the Photo Shooting Menu or using the Flash unit menu
9016
- RawConv => '$$self{FlashControlMode} = $val',
9017
- PrintConv => \%flashControlModeZ7,
9018
- },
9019
- 446 => {
9020
- Name => 'FlashMasterCompensation',
9021
- Format => 'int8s',
9022
- Unknown => 1,
9023
- ValueConv => '$val/6',
9024
- ValueConvInv => '6 * $val',
9025
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9026
- PrintConvInv => '$val',
9027
- },
9028
- 450 => {
9029
- Name => 'FlashGNDistance',
9030
- Condition => '$$self{FlashControlMode} == 2',
9031
- Unknown => 1,
9032
- ValueConv => '$val + 3',
9033
- PrintConv => \%flashGNDistance,
9034
- },
9035
- 454 => {
9036
- Name => 'FlashOutput', # range[0,24] with 0=>Full; 1=>50%; then decreasing flash power in 1/3 stops to 0.39% (1/256 full power). also found in FlashInfoUnknown at offset 0x0a (with different mappings)
9037
- Condition => '$$self{FlashControlMode} >= 3',
9038
- Unknown => 1,
9039
- ValueConv => '2 ** (-$val/3)',
9040
- ValueConvInv => '$val>0 ? -3*log($val)/log(2) : 0',
9041
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.1f%%",$val*100)',
9042
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9043
- },
9044
- #462 flash wireless control 0=> 'Off' 1=> 'Optical AWL'
9045
- #464 => { Name => 'FlashRemoteControl', PrintConv => \%flashRemoteControlZ7, Unknown => 1 },
9046
- #476 => { Name => 'FlashWirelessOption', PrintConv => \%flashWirelessOptionZ7, Unknown => 1 },
9047
- 548 => { Name => 'AFAreaMode', PrintConv => \%aFAreaModeZ9},
9048
- 550 => { Name => 'VRMode', PrintConv => \%vRModeZ9},
9049
- 554 => {
9050
- Name => 'BracketSet',
9051
- RawConv => '$$self{BracketSet} = $val',
9052
- PrintConv => \%bracketSetZ9,
9053
- },
9054
- 556 => {
9055
- Name => 'BracketProgram',
9056
- Condition => '$$self{BracketSet} < 3',
9057
- Notes => 'AE and/or Flash Bracketing',
9058
- PrintConv => \%bracketProgramZ9,
9059
- },
9060
- 558 => {
9061
- Name => 'BracketIncrement',
9062
- Condition => '$$self{BracketSet} < 3',
9063
- Notes => 'AE and/or Flash Bracketing',
9064
- PrintConv => \%bracketIncrementZ9,
9065
- },
9066
- 576 => { Name => 'SecondarySlotFunction', PrintConv => \%secondarySlotFunctionZ9 },
9067
- 592 => { Name => 'DXCropAlert', PrintConv => \%offOn },
9068
- 594 => { Name => 'SubjectDetection', PrintConv => \%subjectDetectionZ9 },
9069
- 636 => { Name => 'HighFrequencyFlickerReductionShooting', PrintConv => \%offOn, Unknown => 1 }, # new with firmware 3.0
9070
- 646 => {
9071
- Name => 'MovieImageArea',
9072
- Unknown => 1,
9073
- Mask => 0x01, # without the mask 4 => 'FX' 5 => DX only the 2nd Z-series field encountered with a mask.
9074
- PrintConv => \%imageAreaZ9b,
9075
- },
9076
- 656 => { Name => 'MovieType', PrintConv => \%movieTypeZ9, Unknown => 1 },
9077
- 658 => {
9078
- Name => 'MovieISOAutoHiLimit',
9079
- Format => 'int16u',
9080
- Unknown => 1,
9081
- ValueConv => '($val-104)/8',
9082
- ValueConvInv => '8 * ($val + 104)',
9083
- PrintConv => \%iSOAutoHiLimitZ7,
9084
- },
9085
- 660 => { Name => 'MovieISOAutoControlManualMode', PrintConv => \%offOn, Unknown => 1 },
9086
- 662 => {
9087
- Name => 'MovieISOAutoManualMode',
9088
- Format => 'int16u',
9089
- Unknown => 1,
9090
- ValueConv => '($val-104)/8',
9091
- ValueConvInv => '8 * ($val + 104)',
9092
- PrintConv => \%iSOAutoHiLimitZ7,
9093
- },
9094
- 736 => { Name => 'MovieActiveD-Lighting', PrintConv => \%activeDLightingZ7, Unknown => 1 },
9095
- 738 => { Name => 'MovieHighISONoiseReduction', PrintConv => \%offLowNormalHighZ7, Unknown => 1 },
9096
- 744 => { Name => 'MovieFlickerReduction', PrintConv => \%movieFlickerReductionZ9 },
9097
- 746 => { Name => 'MovieMeteringMode', PrintConv => \%meteringModeZ7, Unknown => 1 },
9098
- 748 => { Name => 'MovieFocusMode', PrintConv => \%focusModeZ7, Unknown => 1 },
9099
- 750 => { Name => 'MovieAFAreaMode', PrintConv => \%aFAreaModeZ9 },
9100
- 752 => { Name => 'MovieVRMode', PrintConv => \%vRModeZ9, Unknown => 1 },
9101
- 756 => { Name => 'MovieElectronicVR', PrintConv => \%offOn, Unknown => 1 }, # distinct from MoveieVRMode
9102
- 758 => { Name => 'MovieSoundRecording', PrintConv => { 0 => 'Off', 1 => 'Auto', 2 => 'Manual' }, Unknown => 1 },
9103
- 760 => { Name => 'MicrophoneSensitivity', Unknown => 1 }, # 1-20
9104
- 762 => { Name => 'MicrophoneAttenuator', PrintConv => \%offOn, Unknown => 1 }, # distinct from MoveieVRMode
9105
- 764 => { Name => 'MicrophoneFrequencyResponse',PrintConv => { 0 => 'Wide Range', 1 => 'Vocal Range' }, Unknown => 1 },
9106
- 766 => { Name => 'WindNoiseReduction', PrintConv => \%offOn, Unknown => 1 },
9107
- 788 => { Name => 'MovieToneMap', PrintConv => \%movieToneMapZ9, Unknown => 1 },
9108
- 794 => { Name => 'MovieFrameSize', PrintConv => \%movieFrameSizeZ9, Unknown => 1 },
9109
- 796 => { Name => 'MovieFrameRate', PrintConv => \%movieFrameRateZ7, Unknown => 1 },
9110
- 802 => { Name => 'MicrophoneJackPower', PrintConv => \%offOn, Unknown => 1 },
9111
- 803 => { Name => 'MovieDXCropAlert', PrintConv => \%offOn, Unknown => 1 },
9112
- 804 => { Name => 'MovieSubjectDetection', PrintConv => \%subjectDetectionZ9, Unknown => 1 },
9113
- 812 => { Name => 'MovieHighResZoom', PrintConv => \%offOn, Unknown => 1 },
9114
- 847 => {
9115
- Name => 'CustomSettingsZ9',
9116
- Format => 'undef[608]',
9117
- SubDirectory => { TagTable => 'Image::ExifTool::NikonCustom::SettingsZ9' },
9118
- },
9119
- 1474 => { Name => 'Language', PrintConv => \%languageZ9, Unknown => 1 },
9120
- 1476 => { Name => 'TimeZone', PrintConv => \%timeZoneZ9 },
9121
- 1482 => { Name => 'MonitorBrightness', PrintConv => \%monitorBrightnessZ9, Unknown => 1 }, # settings: -5 to +5. Added with firmware 3.0: Lo1, Lo2, Hi1, Hi2
9122
- 1504 => { Name => 'AFFineTune', PrintConv => \%offOn, Unknown => 1 },
9123
- 1600 => { Name => 'HDMIOutputResolution', PrintConv => \%hDMIOutputResolutionZ9 },
9124
- 1613 => { Name => 'SetClockFromLocationData', PrintConv => \%offOn, Unknown => 1 },
9125
- 1620 => { Name => 'AirplaneMode', PrintConv => \%offOn, Unknown => 1 },
9126
- 1621 => { Name => 'EmptySlotRelease', PrintConv => { 0 => 'Disable Release', 1 => 'Enable Release' }, Unknown => 1 },
9127
- 1656 => { Name => 'EnergySavingMode', PrintConv =>\%offOn, Unknown => 1 },
9128
- 1680 => { Name => 'RecordLocationData', PrintConv => \%offOn, Unknown => 1 },
9129
- 1684 => { Name => 'USBPowerDelivery', PrintConv => \%offOn, Unknown => 1 },
9130
- 1693 => { Name => 'SensorShield', PrintConv => { 0 => 'Stays Open', 1 => 'Closes' }, Unknown => 1 },
9131
- 1754 => {
9132
- Name => 'FocusShiftAutoReset',
9133
- Unknown => 1,
9134
- PrintConv => \%offOn,
9135
- Condition => '$$self{FocusShiftShooting} > 0',
9136
- },
9137
- #1824 ReleaseTimingIndicatorTypeADelay CSd14-b 0 => '1/200' ... 15 => '1/6'
9138
- #1826 VerticalISOButton CSf2
9139
- #1828 ExposureCompensationButton CSf2
9140
- #1830 ISOButton CSf2
9141
- #1890 ViewModeShowEffectsOfSettings CSd9-a 0=>'Always', 1=> 'Only When Flash Not Used'
9142
- #1892 DispButton CSf2
9143
- #1936 FocusPointDisplayOption3DTrackingColor CSa11-d 0=> 'White', 1= => 'Red'
9144
- );
9145
-
9146
- # Flash information (ref JD)
9147
- %Image::ExifTool::Nikon::FlashInfo0100 = (
9148
- %binaryDataAttrs,
9149
- DATAMEMBER => [ 9.2, 15, 16 ],
9150
- GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
9151
- NOTES => q{
9152
- These tags are used by the D2H, D2Hs, D2X, D2Xs, D50, D70, D70s, D80 and
9153
- D200.
9154
- },
9155
- # NOTE: Must set ByteOrder in SubDirectory if any multi-byte integer tags added
9156
- 0 => {
9157
- Name => 'FlashInfoVersion',
9158
- Format => 'string[4]',
9159
- Writable => 0,
9160
- },
9161
- 4 => { #PH
9162
- Name => 'FlashSource',
9163
- PrintConv => {
9164
- 0 => 'None',
9165
- 1 => 'External',
9166
- 2 => 'Internal',
9167
- },
9168
- },
9169
- # 5 - values: 46,48,50,54,78
9170
- 6 => {
9171
- Format => 'int8u[2]',
9172
- Name => 'ExternalFlashFirmware',
9173
- SeparateTable => 'FlashFirmware',
9174
- PrintConv => \%flashFirmware,
9175
- },
9176
- 8 => {
9177
- Name => 'ExternalFlashFlags',
9178
- PrintConv => { 0 => '(none)',
9179
- BITMASK => {
9180
- 0 => 'Fired', #28
9181
- 2 => 'Bounce Flash', #PH
9182
- 4 => 'Wide Flash Adapter',
9183
- 5 => 'Dome Diffuser', #28
9184
- },
9185
- },
9186
- },
9187
- 9.1 => {
9188
- Name => 'FlashCommanderMode',
9189
- Mask => 0x80,
9190
- PrintConv => { 0 => 'Off', 1 => 'On' },
9191
- },
9192
- 9.2 => {
9193
- Name => 'FlashControlMode',
9194
- Mask => 0x7f,
9195
- DataMember => 'FlashControlMode',
9196
- RawConv => '$$self{FlashControlMode} = $val',
9197
- PrintConv => \%flashControlMode,
9198
- SeparateTable => 'FlashControlMode',
9199
- },
9200
- 10 => [
9201
- {
9202
- Name => 'FlashOutput',
9203
- Condition => '$$self{FlashControlMode} >= 0x06',
9204
- ValueConv => '2 ** (-$val/6)',
9205
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9206
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9207
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9208
- },
9209
- {
9210
- Name => 'FlashCompensation',
9211
- Format => 'int8s',
9212
- Priority => 0,
9213
- ValueConv => '-$val/6',
9214
- ValueConvInv => '-6 * $val',
9215
- PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
9216
- PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
9217
- },
9218
- ],
9219
- 11 => {
9220
- Name => 'FlashFocalLength',
9221
- RawConv => '$val ? $val : undef',
9222
- PrintConv => '"$val mm"',
9223
- PrintConvInv => '$val=~/(\d+)/; $1 || 0',
9224
- },
9225
- 12 => {
9226
- Name => 'RepeatingFlashRate',
9227
- RawConv => '$val ? $val : undef',
9228
- PrintConv => '"$val Hz"',
9229
- PrintConvInv => '$val=~/(\d+)/; $1 || 0',
9230
- },
9231
- 13 => {
9232
- Name => 'RepeatingFlashCount',
9233
- RawConv => '$val ? $val : undef',
9234
- },
9235
- 14 => { #PH
9236
- Name => 'FlashGNDistance',
9237
- SeparateTable => 1,
9238
- PrintConv => \%flashGNDistance,
9239
- },
9240
- 15 => {
9241
- Name => 'FlashGroupAControlMode',
9242
- Mask => 0x0f,
9243
- DataMember => 'FlashGroupAControlMode',
9244
- RawConv => '$$self{FlashGroupAControlMode} = $val',
9245
- PrintConv => \%flashControlMode,
9246
- SeparateTable => 'FlashControlMode',
9247
- },
9248
- 16 => {
9249
- Name => 'FlashGroupBControlMode',
9250
- Mask => 0x0f,
9251
- DataMember => 'FlashGroupBControlMode',
9252
- RawConv => '$$self{FlashGroupBControlMode} = $val',
9253
- PrintConv => \%flashControlMode,
9254
- SeparateTable => 'FlashControlMode',
9255
- },
9256
- 17 => [
9257
- {
9258
- Name => 'FlashGroupAOutput',
9259
- Condition => '$$self{FlashGroupAControlMode} >= 0x06',
9260
- ValueConv => '2 ** (-$val/6)',
9261
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9262
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9263
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9264
- },
9265
- {
9266
- Name => 'FlashGroupACompensation',
9267
- Format => 'int8s',
9268
- ValueConv => '-$val/6',
9269
- ValueConvInv => '-6 * $val',
9270
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9271
- PrintConvInv => '$val',
9272
- },
9273
- ],
9274
- 18 => [
9275
- {
9276
- Name => 'FlashGroupBOutput',
9277
- Condition => '$$self{FlashGroupBControlMode} >= 0x06',
9278
- ValueConv => '2 ** (-$val/6)',
9279
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9280
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9281
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9282
- },
9283
- {
9284
- Name => 'FlashGroupBCompensation',
9285
- Format => 'int8s',
9286
- ValueConv => '-$val/6',
9287
- ValueConvInv => '-6 * $val',
9288
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9289
- PrintConvInv => '$val',
9290
- },
9291
- ],
9292
- );
9293
-
9294
- # Flash information for D40, D40x, D3 and D300 (ref JD)
9295
- %Image::ExifTool::Nikon::FlashInfo0102 = (
9296
- %binaryDataAttrs,
9297
- DATAMEMBER => [ 9.2, 16.1, 17.1, 17.2 ],
9298
- GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
9299
- NOTES => q{
9300
- These tags are used by the D3 (firmware 1.x), D40, D40X, D60 and D300
9301
- (firmware 1.00).
9302
- },
9303
- # NOTE: Must set ByteOrder in SubDirectory if any multi-byte integer tags added
9304
- 0 => {
9305
- Name => 'FlashInfoVersion',
9306
- Format => 'string[4]',
9307
- Writable => 0,
9308
- },
9309
- 4 => { #PH
9310
- Name => 'FlashSource',
9311
- PrintConv => {
9312
- 0 => 'None',
9313
- 1 => 'External',
9314
- 2 => 'Internal',
9315
- },
9316
- },
9317
- # 5 - values: 46,48,50,54,78
9318
- 6 => {
9319
- Format => 'int8u[2]',
9320
- Name => 'ExternalFlashFirmware',
9321
- SeparateTable => 'FlashFirmware',
9322
- PrintConv => \%flashFirmware,
9323
- },
9324
- 8 => {
9325
- Name => 'ExternalFlashFlags',
9326
- PrintConv => { BITMASK => {
9327
- 0 => 'Fired', #28
9328
- 2 => 'Bounce Flash', #PH
9329
- 4 => 'Wide Flash Adapter',
9330
- 5 => 'Dome Diffuser', #28
9331
- }},
9332
- },
9333
- 9.1 => {
9334
- Name => 'FlashCommanderMode',
9335
- Mask => 0x80,
9336
- PrintConv => { 0 => 'Off', 1 => 'On' },
9337
- },
9338
- 9.2 => {
9339
- Name => 'FlashControlMode',
9340
- Mask => 0x7f,
9341
- DataMember => 'FlashControlMode',
9342
- RawConv => '$$self{FlashControlMode} = $val',
9343
- PrintConv => \%flashControlMode,
9344
- SeparateTable => 'FlashControlMode',
9345
- },
9346
- 10 => [
9347
- {
9348
- Name => 'FlashOutput',
9349
- Condition => '$$self{FlashControlMode} >= 0x06',
9350
- ValueConv => '2 ** (-$val/6)',
9351
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9352
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9353
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9354
- },
9355
- {
9356
- Name => 'FlashCompensation',
9357
- # this is the compensation from the camera (0x0012) for "Built-in" FlashType, or
9358
- # the compensation from the external unit (0x0017) for "Optional" FlashType - PH
9359
- Format => 'int8s',
9360
- Priority => 0,
9361
- ValueConv => '-$val/6',
9362
- ValueConvInv => '-6 * $val',
9363
- PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
9364
- PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
9365
- },
9366
- ],
9367
- 12 => {
9368
- Name => 'FlashFocalLength',
9369
- RawConv => '$val ? $val : undef',
9370
- PrintConv => '"$val mm"',
9371
- PrintConvInv => '$val=~/(\d+)/; $1 || 0',
8787
+ PrintConv => \%iSOAutoShutterTimeZ9,
9372
8788
  },
9373
- 13 => {
9374
- Name => 'RepeatingFlashRate',
9375
- RawConv => '$val ? $val : undef',
9376
- PrintConv => '"$val Hz"',
9377
- PrintConvInv => '$val=~/(\d+)/; $1 || 0',
8789
+ 436 => { Name => 'MovieVignetteControl', PrintConv => \%offLowNormalHighZ7, Unknown => 1 },
8790
+ 438 => { Name => 'DiffractionCompensation', PrintConv => \%offOn }, # value can be set from both the Photo Shoot Menu and the Video Shooting Menu
8791
+ 440 => { Name => 'FlickerReductionShooting',PrintConv => \%offOn },
8792
+ 444 => {
8793
+ Name => 'FlashControlMode', # this and nearby tag values for flash may be set from either the Photo Shooting Menu or using the Flash unit menu
8794
+ RawConv => '$$self{FlashControlMode} = $val',
8795
+ PrintConv => \%flashControlModeZ7,
9378
8796
  },
9379
- 14 => {
9380
- Name => 'RepeatingFlashCount',
9381
- RawConv => '$val ? $val : undef',
8797
+ 446 => {
8798
+ Name => 'FlashMasterCompensation',
8799
+ Format => 'int8s',
8800
+ Unknown => 1,
8801
+ ValueConv => '$val/6',
8802
+ ValueConvInv => '6 * $val',
8803
+ PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
8804
+ PrintConvInv => '$val',
9382
8805
  },
9383
- 15 => { #PH
8806
+ 450 => {
9384
8807
  Name => 'FlashGNDistance',
9385
- SeparateTable => 1,
8808
+ Condition => '$$self{FlashControlMode} == 2',
8809
+ Unknown => 1,
8810
+ ValueConv => '$val + 3',
9386
8811
  PrintConv => \%flashGNDistance,
9387
8812
  },
9388
- 16.1 => {
9389
- Name => 'FlashGroupAControlMode',
9390
- Mask => 0x0f,
9391
- Notes => 'note: group A tags may apply to the built-in flash settings for some models',
9392
- DataMember => 'FlashGroupAControlMode',
9393
- RawConv => '$$self{FlashGroupAControlMode} = $val',
9394
- PrintConv => \%flashControlMode,
9395
- SeparateTable => 'FlashControlMode',
8813
+ 454 => {
8814
+ Name => 'FlashOutput', # range[0,24] with 0=>Full; 1=>50%; then decreasing flash power in 1/3 stops to 0.39% (1/256 full power). also found in FlashInfoUnknown at offset 0x0a (with different mappings)
8815
+ Condition => '$$self{FlashControlMode} >= 3',
8816
+ Unknown => 1,
8817
+ ValueConv => '2 ** (-$val/3)',
8818
+ ValueConvInv => '$val>0 ? -3*log($val)/log(2) : 0',
8819
+ PrintConv => '$val>0.99 ? "Full" : sprintf("%.1f%%",$val*100)',
8820
+ PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9396
8821
  },
9397
- 17.1 => {
9398
- Name => 'FlashGroupBControlMode',
9399
- Mask => 0xf0,
9400
- Notes => 'note: group B tags may apply to group A settings for some models',
9401
- DataMember => 'FlashGroupBControlMode',
9402
- RawConv => '$$self{FlashGroupBControlMode} = $val',
9403
- PrintConv => \%flashControlMode,
9404
- SeparateTable => 'FlashControlMode',
8822
+ #462 flash wireless control 0=> 'Off' 1=> 'Optical AWL'
8823
+ #464 => { Name => 'FlashRemoteControl', PrintConv => \%flashRemoteControlZ7, Unknown => 1 },
8824
+ #476 => { Name => 'FlashWirelessOption', PrintConv => \%flashWirelessOptionZ7, Unknown => 1 },
8825
+ 548 => { Name => 'AFAreaMode', PrintConv => \%aFAreaModeZ9},
8826
+ 550 => { Name => 'VRMode', PrintConv => \%vRModeZ9},
8827
+ 554 => {
8828
+ Name => 'BracketSet',
8829
+ RawConv => '$$self{BracketSet} = $val',
8830
+ PrintConv => \%bracketSetZ9,
9405
8831
  },
9406
- 17.2 => { #PH
9407
- Name => 'FlashGroupCControlMode',
9408
- Mask => 0x0f,
9409
- Notes => 'note: group C tags may apply to group B settings for some models',
9410
- DataMember => 'FlashGroupCControlMode',
9411
- RawConv => '$$self{FlashGroupCControlMode} = $val',
9412
- PrintConv => \%flashControlMode,
9413
- SeparateTable => 'FlashControlMode',
8832
+ 556 => {
8833
+ Name => 'BracketProgram',
8834
+ Condition => '$$self{BracketSet} < 3',
8835
+ Notes => 'AE and/or Flash Bracketing',
8836
+ PrintConv => \%bracketProgramZ9,
9414
8837
  },
9415
- 18 => [
9416
- {
9417
- Name => 'FlashGroupAOutput',
9418
- Condition => '$$self{FlashGroupAControlMode} >= 0x06',
9419
- ValueConv => '2 ** (-$val/6)',
9420
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9421
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9422
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9423
- },
9424
- {
9425
- Name => 'FlashGroupACompensation',
9426
- Format => 'int8s',
9427
- ValueConv => '-$val/6',
9428
- ValueConvInv => '-6 * $val',
9429
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9430
- PrintConvInv => '$val',
9431
- },
9432
- ],
9433
- 19 => [
9434
- {
9435
- Name => 'FlashGroupBOutput',
9436
- Condition => '$$self{FlashGroupBControlMode} >= 0x60',
9437
- ValueConv => '2 ** (-$val/6)',
9438
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9439
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9440
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
9441
- },
9442
- {
9443
- Name => 'FlashGroupBCompensation',
9444
- Format => 'int8s',
9445
- ValueConv => '-$val/6',
9446
- ValueConvInv => '-6 * $val',
9447
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9448
- PrintConvInv => '$val',
9449
- },
9450
- ],
9451
- 20 => [ #PH
9452
- {
9453
- Name => 'FlashGroupCOutput',
9454
- Condition => '$$self{FlashGroupCControlMode} >= 0x06',
9455
- ValueConv => '2 ** (-$val/6)',
9456
- ValueConvInv => '$val>0 ? -6*log($val)/log(2) : 0',
9457
- PrintConv => '$val>0.99 ? "Full" : sprintf("%.0f%%",$val*100)',
9458
- PrintConvInv => '$val=~/(\d+)/ ? $1/100 : 1',
8838
+ 558 => {
8839
+ Name => 'BracketIncrement',
8840
+ Condition => '$$self{BracketSet} < 3',
8841
+ Notes => 'AE and/or Flash Bracketing',
8842
+ PrintConv => \%bracketIncrementZ9,
8843
+ },
8844
+ 576 => { Name => 'SecondarySlotFunction', PrintConv => \%secondarySlotFunctionZ9 },
8845
+ 592 => { Name => 'DXCropAlert', PrintConv => \%offOn },
8846
+ 594 => { Name => 'SubjectDetection', PrintConv => \%subjectDetectionZ9 },
8847
+ 636 => { Name => 'HighFrequencyFlickerReductionShooting', PrintConv => \%offOn, Unknown => 1 }, # new with firmware 3.0
8848
+ 646 => {
8849
+ Name => 'MovieImageArea',
8850
+ Unknown => 1,
8851
+ Mask => 0x01, # without the mask 4 => 'FX' 5 => DX only the 2nd Z-series field encountered with a mask.
8852
+ PrintConv => \%imageAreaZ9b,
8853
+ },
8854
+ 656 => { Name => 'MovieType', PrintConv => \%movieTypeZ9, Unknown => 1 },
8855
+ 658 => {
8856
+ Name => 'MovieISOAutoHiLimit',
8857
+ Format => 'int16u',
8858
+ Unknown => 1,
8859
+ ValueConv => '($val-104)/8',
8860
+ ValueConvInv => '8 * ($val + 104)',
8861
+ PrintConv => \%iSOAutoHiLimitZ7,
8862
+ },
8863
+ 660 => { Name => 'MovieISOAutoControlManualMode', PrintConv => \%offOn, Unknown => 1 },
8864
+ 662 => {
8865
+ Name => 'MovieISOAutoManualMode',
8866
+ Format => 'int16u',
8867
+ Unknown => 1,
8868
+ ValueConv => '($val-104)/8',
8869
+ ValueConvInv => '8 * ($val + 104)',
8870
+ PrintConv => \%iSOAutoHiLimitZ7,
8871
+ },
8872
+ 736 => { Name => 'MovieActiveD-Lighting', PrintConv => \%activeDLightingZ7, Unknown => 1 },
8873
+ 738 => { Name => 'MovieHighISONoiseReduction', PrintConv => \%offLowNormalHighZ7, Unknown => 1 },
8874
+ 744 => { Name => 'MovieFlickerReduction', PrintConv => \%movieFlickerReductionZ9 },
8875
+ 746 => { Name => 'MovieMeteringMode', PrintConv => \%meteringModeZ7, Unknown => 1 },
8876
+ 748 => { Name => 'MovieFocusMode', PrintConv => \%focusModeZ7, Unknown => 1 },
8877
+ 750 => { Name => 'MovieAFAreaMode', PrintConv => \%aFAreaModeZ9 },
8878
+ 752 => { Name => 'MovieVRMode', PrintConv => \%vRModeZ9, Unknown => 1 },
8879
+ 756 => { Name => 'MovieElectronicVR', PrintConv => \%offOn, Unknown => 1 }, # distinct from MoveieVRMode
8880
+ 758 => { Name => 'MovieSoundRecording', PrintConv => { 0 => 'Off', 1 => 'Auto', 2 => 'Manual' }, Unknown => 1 },
8881
+ 760 => { Name => 'MicrophoneSensitivity', Unknown => 1 }, # 1-20
8882
+ 762 => { Name => 'MicrophoneAttenuator', PrintConv => \%offOn, Unknown => 1 }, # distinct from MoveieVRMode
8883
+ 764 => { Name => 'MicrophoneFrequencyResponse',PrintConv => { 0 => 'Wide Range', 1 => 'Vocal Range' }, Unknown => 1 },
8884
+ 766 => { Name => 'WindNoiseReduction', PrintConv => \%offOn, Unknown => 1 },
8885
+ 788 => { Name => 'MovieToneMap', PrintConv => \%movieToneMapZ9, Unknown => 1 },
8886
+ 794 => { Name => 'MovieFrameSize', PrintConv => \%movieFrameSizeZ9, Unknown => 1 },
8887
+ 796 => { Name => 'MovieFrameRate', PrintConv => \%movieFrameRateZ7, Unknown => 1 },
8888
+ 802 => { Name => 'MicrophoneJackPower', PrintConv => \%offOn, Unknown => 1 },
8889
+ 803 => { Name => 'MovieDXCropAlert', PrintConv => \%offOn, Unknown => 1 },
8890
+ 804 => { Name => 'MovieSubjectDetection', PrintConv => \%subjectDetectionZ9, Unknown => 1 },
8891
+ 812 => { Name => 'MovieHighResZoom', PrintConv => \%offOn, Unknown => 1 },
8892
+ 847 => {
8893
+ Name => 'CustomSettingsZ9',
8894
+ Format => 'undef[608]',
8895
+ SubDirectory => { TagTable => 'Image::ExifTool::NikonCustom::SettingsZ9' },
8896
+ },
8897
+ 1474 => { Name => 'Language', PrintConv => \%languageZ9, Unknown => 1 },
8898
+ 1476 => { Name => 'TimeZone', PrintConv => \%timeZoneZ9 },
8899
+ 1482 => { Name => 'MonitorBrightness', PrintConv => \%monitorBrightnessZ9, Unknown => 1 }, # settings: -5 to +5. Added with firmware 3.0: Lo1, Lo2, Hi1, Hi2
8900
+ 1504 => { Name => 'AFFineTune', PrintConv => \%offOn, Unknown => 1 },
8901
+ 1600 => { Name => 'HDMIOutputResolution', PrintConv => \%hDMIOutputResolutionZ9 },
8902
+ 1613 => { Name => 'SetClockFromLocationData', PrintConv => \%offOn, Unknown => 1 },
8903
+ 1620 => { Name => 'AirplaneMode', PrintConv => \%offOn, Unknown => 1 },
8904
+ 1621 => { Name => 'EmptySlotRelease', PrintConv => { 0 => 'Disable Release', 1 => 'Enable Release' }, Unknown => 1 },
8905
+ 1656 => { Name => 'EnergySavingMode', PrintConv => \%offOn, Unknown => 1 },
8906
+ 1680 => { Name => 'RecordLocationData', PrintConv => \%offOn, Unknown => 1 },
8907
+ 1684 => { Name => 'USBPowerDelivery', PrintConv => \%offOn, Unknown => 1 },
8908
+ 1693 => { Name => 'SensorShield', PrintConv => { 0 => 'Stays Open', 1 => 'Closes' }, Unknown => 1 },
8909
+ 1754 => {
8910
+ Name => 'FocusShiftAutoReset',
8911
+ Unknown => 1,
8912
+ PrintConv => \%offOn,
8913
+ Condition => '$$self{ShutterMode} and $$self{ShutterMode} ne 96 and $$self{FocusShiftShooting} > 0', #not valid for C30/C60/C120
8914
+ },
8915
+ 1810 => { #CSd4-a
8916
+ Name => 'PreReleaseBurstLength',
8917
+ PrintConv => {
8918
+ 0 => 'None',
8919
+ 1 => '0.3 Sec',
8920
+ 2 => '0.5 Sec',
8921
+ 3 => '1 Sec',
9459
8922
  },
9460
- {
9461
- Name => 'FlashGroupCCompensation',
9462
- Format => 'int8s',
9463
- ValueConv => '-$val/6',
9464
- ValueConvInv => '-6 * $val',
9465
- PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
9466
- PrintConvInv => '$val',
8923
+ },
8924
+ 1812 => { #CSd4-b
8925
+ Name => 'PostReleaseBurstLength',
8926
+ PrintConv => {
8927
+ 0 => '1 Sec',
8928
+ 1 => '2 Sec',
8929
+ 2 => '3 Sec',
8930
+ 3 => 'Max',
9467
8931
  },
9468
- ],
8932
+ },
8933
+ #1824 ReleaseTimingIndicatorTypeADelay CSd14-b 0 => '1/200' ... 15 => '1/6'
8934
+ #1826 VerticalISOButton CSf2
8935
+ #1828 ExposureCompensationButton CSf2
8936
+ #1830 ISOButton CSf2
8937
+ #1890 ViewModeShowEffectsOfSettings CSd9-a 0=>'Always', 1=> 'Only When Flash Not Used'
8938
+ #1892 DispButton CSf2
8939
+ #1936 FocusPointDisplayOption3DTrackingColor CSa11-d 0=> 'White', 1= => 'Red'
9469
8940
  );
9470
8941
 
9471
8942
  # Flash information (ref JD)
@@ -10749,6 +10220,21 @@ my %nikonFocalConversions = (
10749
10220
  },
10750
10221
  );
10751
10222
 
10223
+ # MakerNotes0x56 - burst info for Z9
10224
+ %Image::ExifTool::Nikon::MakerNotes0x56 = (
10225
+ %binaryDataAttrs,
10226
+ GROUPS => { 0 => 'MakerNotes' },
10227
+ 0 => {
10228
+ Name => 'FirmwareVersion',
10229
+ Format => 'string[4]',
10230
+ Writable => 0,
10231
+ },
10232
+ 4 => {
10233
+ Name => 'BurstGroupID', #all frames shot within a burst (using CL/CH/C30/C60/C120) will share the same BurstGroupID. Value will be > 0 for all images shot in continuous modes. 0 for single-frame.
10234
+ Format => 'int16u'
10235
+ },
10236
+ );
10237
+
10752
10238
  # extra info found in IFD0 of NEF files (ref PH, Z6/Z7)
10753
10239
  %Image::ExifTool::Nikon::NEFInfo = (
10754
10240
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
@@ -11482,8 +10968,8 @@ my %nikonFocalConversions = (
11482
10968
  Name => 'LensData0201',
11483
10969
  SubDirectory => {
11484
10970
  TagTable => 'Image::ExifTool::Nikon::LensData01',
11485
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11486
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
10971
+ ProcessProc => \&ProcessNikonEncrypted,
10972
+ WriteProc => \&ProcessNikonEncrypted,
11487
10973
  DecryptStart => 4,
11488
10974
  },
11489
10975
  },
@@ -11492,8 +10978,8 @@ my %nikonFocalConversions = (
11492
10978
  Name => 'LensData0204',
11493
10979
  SubDirectory => {
11494
10980
  TagTable => 'Image::ExifTool::Nikon::LensData0204',
11495
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11496
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
10981
+ ProcessProc => \&ProcessNikonEncrypted,
10982
+ WriteProc => \&ProcessNikonEncrypted,
11497
10983
  DecryptStart => 4,
11498
10984
  },
11499
10985
  },
@@ -11502,8 +10988,8 @@ my %nikonFocalConversions = (
11502
10988
  Name => 'LensData0400',
11503
10989
  SubDirectory => {
11504
10990
  TagTable => 'Image::ExifTool::Nikon::LensData0400',
11505
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11506
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
10991
+ ProcessProc => \&ProcessNikonEncrypted,
10992
+ WriteProc => \&ProcessNikonEncrypted,
11507
10993
  DecryptStart => 4,
11508
10994
  },
11509
10995
  },
@@ -11512,8 +10998,8 @@ my %nikonFocalConversions = (
11512
10998
  Name => 'LensData0402',
11513
10999
  SubDirectory => {
11514
11000
  TagTable => 'Image::ExifTool::Nikon::LensData0402',
11515
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11516
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11001
+ ProcessProc => \&ProcessNikonEncrypted,
11002
+ WriteProc => \&ProcessNikonEncrypted,
11517
11003
  DecryptStart => 4,
11518
11004
  },
11519
11005
  },
@@ -11522,8 +11008,8 @@ my %nikonFocalConversions = (
11522
11008
  Name => 'LensData0403',
11523
11009
  SubDirectory => {
11524
11010
  TagTable => 'Image::ExifTool::Nikon::LensData0403',
11525
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11526
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11011
+ ProcessProc => \&ProcessNikonEncrypted,
11012
+ WriteProc => \&ProcessNikonEncrypted,
11527
11013
  DecryptStart => 4,
11528
11014
  },
11529
11015
  },
@@ -11532,8 +11018,8 @@ my %nikonFocalConversions = (
11532
11018
  Name => 'LensData0800',
11533
11019
  SubDirectory => {
11534
11020
  TagTable => 'Image::ExifTool::Nikon::LensData0800',
11535
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11536
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11021
+ ProcessProc => \&ProcessNikonEncrypted,
11022
+ WriteProc => \&ProcessNikonEncrypted,
11537
11023
  DecryptStart => 4,
11538
11024
  ByteOrder => 'LittleEndian',
11539
11025
  # 0x5a0c - NikonMeteringMode for some Z6 ver1.00 samples (ref PH)
@@ -11543,8 +11029,8 @@ my %nikonFocalConversions = (
11543
11029
  Name => 'LensDataUnknown',
11544
11030
  SubDirectory => {
11545
11031
  TagTable => 'Image::ExifTool::Nikon::LensDataUnknown',
11546
- ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11547
- WriteProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
11032
+ ProcessProc => \&ProcessNikonEncrypted,
11033
+ WriteProc => \&ProcessNikonEncrypted,
11548
11034
  DecryptStart => 4,
11549
11035
  },
11550
11036
  },
@@ -11894,6 +11380,7 @@ sub PrintAFPointsLeftRight($$)
11894
11380
  {
11895
11381
  my ($col, $ncol) = @_;
11896
11382
  my $center = 1 + ($ncol + 1)/2;
11383
+ return 'n/a' if $col == 0; #out of focus
11897
11384
  return 'C' if $col == $center;
11898
11385
  return sprintf('%d', $center - $col) . 'L of Center' if $col < $center;
11899
11386
  return sprintf('%d', $col - $center) . 'R of Center' if $col > $center;
@@ -11907,6 +11394,7 @@ sub PrintAFPointsUpDown($$)
11907
11394
  {
11908
11395
  my ($row, $nrow) = @_;
11909
11396
  my $center = 1 + ($nrow + 1)/2;
11397
+ return 'n/a' if $row == 0; #out of focus
11910
11398
  return 'C' if $row == $center;
11911
11399
  return sprintf('%d', $center - $row) . 'U from Center' if $row < $center;
11912
11400
  return sprintf('%d', $row - $center) . 'D from Center' if $row > $center;
@@ -12057,37 +11545,54 @@ my @xlat = (
12057
11545
  0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f ]
12058
11546
  );
12059
11547
 
11548
+ my ($ci0, $cj0, $ck0, $decryptStart); # decryption parameters
11549
+
12060
11550
  # Decrypt Nikon data block (ref 4)
12061
- # Inputs: 0) reference to data block, 1) serial number key, 2) shutter count key
12062
- # 4) optional start offset (default 0)
12063
- # 5) optional number of bytes to decode (default to the end of the data)
11551
+ # Inputs: 0) reference to data block, 1) optional start offset (default 0)
11552
+ # 2) optional number of bytes to decode (default to the end of the data)
11553
+ # 3) optional serial number key (undef to continue previous decryption)
11554
+ # 4) optional shutter count key
12064
11555
  # Returns: data block with specified data decrypted
12065
- sub Decrypt($$$;$$)
11556
+ # Notes: The first time this is called for a given encrypted data block the serial/count
11557
+ # keys must be defined, and $start must be the offset for initialization of the
11558
+ # decryption parameters (ie. the beginning of the encrypted data, which isn't
11559
+ # necessarily inside the data block if $len is zero). Subsequent calls for
11560
+ # the same data block do not specify the serial/count keys, and may be used
11561
+ # to decrypt data at any start point within the full data block.
11562
+ sub Decrypt($;$$$$)
12066
11563
  {
12067
- my ($dataPt, $serial, $count, $start, $len) = @_;
12068
- my ($i, $dat);
11564
+ my ($dataPt, $start, $len, $serial, $count) = @_;
11565
+ my ($ch, $cj, $ck);
12069
11566
 
12070
11567
  $start or $start = 0;
12071
11568
  my $maxLen = length($$dataPt) - $start;
12072
11569
  $len = $maxLen if not defined $len or $len > $maxLen;
12073
- return $$dataPt if $len <= 0;
12074
- my $key = 0;
12075
- for ($i=0; $i<4; ++$i) {
12076
- $key ^= ($count >> ($i*8)) & 0xff;
11570
+ if (defined $serial and defined $count) {
11571
+ # initialize decryption parameters
11572
+ my $key = 0;
11573
+ $key ^= ($count >> ($_*8)) & 0xff foreach 0..3;
11574
+ $ci0 = $xlat[0][$serial & 0xff];
11575
+ $cj0 = $xlat[1][$key];
11576
+ $ck0 = 0x60;
11577
+ undef $decryptStart;
12077
11578
  }
12078
- my $ci = $xlat[0][$serial & 0xff];
12079
- my $cj = $xlat[1][$key];
12080
- my $ck = 0x60;
12081
- my @data = unpack("x${start}C$len", $$dataPt);
12082
- foreach $dat (@data) {
12083
- $cj = ($cj + $ci * $ck) & 0xff;
11579
+ if (defined $decryptStart) {
11580
+ # initialize decryption parameters for this start position
11581
+ my $n = $start - $decryptStart;
11582
+ $cj = ($cj0 + $ci0 * ($n * $ck0 + ($n * ($n - 1))/2)) & 0xff;
11583
+ $ck = ($ck0 + $n) & 0xff;
11584
+ } else {
11585
+ $decryptStart = $start;
11586
+ ($cj, $ck) = ($cj0, $ck0);
11587
+ }
11588
+ return $$dataPt if $len <= 0;
11589
+ my @data = unpack('C*', substr($$dataPt, $start, $len));
11590
+ foreach $ch (@data) {
11591
+ $cj = ($cj + $ci0 * $ck) & 0xff;
12084
11592
  $ck = ($ck + 1) & 0xff;
12085
- $dat ^= $cj;
11593
+ $ch ^= $cj;
12086
11594
  }
12087
- my $end = $start + $len;
12088
- my $pre = $start ? substr($$dataPt, 0, $start) : '';
12089
- my $post = $end < length($$dataPt) ? substr($$dataPt, $end) : '';
12090
- return $pre . pack('C*',@data) . $post;
11595
+ return substr($$dataPt, 0, $start) . pack('C*', @data) . substr($$dataPt, $start+$len);
12091
11596
  }
12092
11597
 
12093
11598
  #------------------------------------------------------------------------------
@@ -12223,6 +11728,110 @@ sub ProcessNikonMOV($$$)
12223
11728
  return 1;
12224
11729
  }
12225
11730
 
11731
+ #------------------------------------------------------------------------------
11732
+ # Prepare to process NIKON_OFFSETS directory and decrypt necessary data
11733
+ # Inputs: 0) ExifTool ref, 1) data ref, 2) tag table ref, 3) decrypt start,
11734
+ # 4) serial key, 5) count key, 6) decrypt mode (0=piecewise,
11735
+ # 1=continuous to end of last known section, 2=all)
11736
+ # Returns: end of decrypted data (or undef for piecewise decryption)
11737
+ sub PrepareNikonOffsets($$$$$$$)
11738
+ {
11739
+ my ($et, $dataPt, $tagTablePtr, $start, $serial, $count, $decryptMode) = @_;
11740
+ my $offset = $$tagTablePtr{VARS}{NIKON_OFFSETS};
11741
+ my $unknown = $et->Options('Unknown');
11742
+ my $dataLen = length $$dataPt;
11743
+ return undef if $offset + 4 > $dataLen or $offset < $start;
11744
+ my $dpos = $offset + 4; # decrypt the first 4 bytes
11745
+ $$dataPt = Decrypt($dataPt, $start, $dpos - $start, $serial, $count);
11746
+ my $numOffsets = Get32u($dataPt, $offset);
11747
+ my $more = $numOffsets * 4;
11748
+ return undef if $offset + 4 + $more > $dataLen;
11749
+ $$dataPt = Decrypt($dataPt, $dpos, $more);
11750
+ $dpos += $more;
11751
+ my $doneAlready = $$tagTablePtr{VARS}{NIKON_OFFSETS_DONE};
11752
+ $$tagTablePtr{VARS}{NIKON_OFFSETS_DONE} = 1;
11753
+ my ($i, @offInfo);
11754
+ for ($i=0; $i<$numOffsets; ++$i) {
11755
+ my $pos = $offset + 4 + 4 * $i;
11756
+ my $off = Get32u($dataPt, $pos) or next;
11757
+ my $tagInfo = $$tagTablePtr{$pos};
11758
+ if ($tagInfo) {
11759
+ if (not $doneAlready and ref $tagInfo eq 'HASH' and
11760
+ not $$tagInfo{Unknown} and $$tagInfo{SubDirectory})
11761
+ {
11762
+ # determine length of subdirectory up to end of last known tag
11763
+ my $subdir = $$tagInfo{SubDirectory};
11764
+ my $tbl = GetTagTable($$subdir{TagTable});
11765
+ my ($last) = sort { $b <=> $a } TagTableKeys($tbl);
11766
+ my $lastInfo = $$tbl{$last};
11767
+ $lastInfo = $$lastInfo[0] if ref $lastInfo eq 'ARRAY';
11768
+ # (can't pre-determine known length of offset-based subdirectories)
11769
+ unless ($$lastInfo{SubDirectory}) {
11770
+ my $fmt = $$lastInfo{Format} || $$tbl{FORMAT} || 'int8u';
11771
+ my $nm = $fmt =~ s/\[(\d+)\]$// ? $1 : 1;
11772
+ my $sz = Image::ExifTool::FormatSize($fmt);
11773
+ $$subdir{KnownLen} = int($last) + $sz * $nm if $sz;
11774
+ }
11775
+ }
11776
+ } elsif ($unknown > 1) {
11777
+ # create new table for unknown information
11778
+ my $tbl = sprintf('Image::ExifTool::Nikon::UnknownInfo%.2x', $pos);
11779
+ no strict 'refs';
11780
+ unless (%$tbl) {
11781
+ %$tbl = ( %binaryDataAttrs, GROUPS => { 0=>'MakerNotes', 2=>'Unknown' } );
11782
+ GetTagTable($tbl);
11783
+ }
11784
+ # add unknown entry in offset table for this subdirectory
11785
+ $tagInfo = AddTagToTable($tagTablePtr, $pos, {
11786
+ Name => sprintf('UnknownOffset%.2x', $pos),
11787
+ Format => 'int32u',
11788
+ SubDirectory => { TagTable => $tbl },
11789
+ Unknown => 2,
11790
+ });
11791
+ }
11792
+ if ($off) {
11793
+ my $known = ($tagInfo and (ref $tagInfo ne 'HASH' or not $$tagInfo{Unknown})) ? 1 : 0;
11794
+ push @offInfo, [ $pos, $off, $known ];
11795
+ }
11796
+ }
11797
+ my $end;
11798
+ # sort offsets in ascending order, and use the differences to calculate
11799
+ # directory lengths and update the SubDirectory DirLen's accordingly
11800
+ my @sorted = sort { $$a[1] <=> $$b[1] or $$a[0] <=> $$b[0] } @offInfo;
11801
+ push @sorted, [ 0, length($$dataPt), 0 ];
11802
+ for ($i=0; $i<@sorted-1; ++$i) {
11803
+ my $pos = $sorted[$i][0];
11804
+ my $len = $sorted[$i+1][1] - $sorted[$i][1];
11805
+ # set DirLen in SubDirectory entry
11806
+ my $tagInfo = $$tagTablePtr{$pos};
11807
+ my $subdir;
11808
+ if (ref $tagInfo eq 'HASH' and defined($subdir=$$tagInfo{SubDirectory})) {
11809
+ $$tagInfo{SubDirectory}{DirLen} = $len;
11810
+ }
11811
+ if ($decryptMode) {
11812
+ # keep track of end of last known directory
11813
+ $end = $sorted[$i+1][1] if $sorted[$i][2];
11814
+ } elsif ($tagInfo and (ref $tagInfo ne 'HASH' or not $$tagInfo{Unknown})) {
11815
+ # decrypt data piecewise as necessary
11816
+ my $n = $len;
11817
+ if ($subdir and $$subdir{KnownLen}) {
11818
+ $n = $$subdir{KnownLen};
11819
+ if ($n > $len) {
11820
+ $et->Warn("Data too short for $$tagInfo{Name}",1);
11821
+ $n = $len;
11822
+ }
11823
+ }
11824
+ $$dataPt = Decrypt($dataPt, $sorted[$i][1], $n);
11825
+ }
11826
+ }
11827
+ if ($decryptMode) {
11828
+ # decrypt the remaining required data
11829
+ $end = length $$dataPt if $decryptMode == 2 or not $end or $end < $dpos;
11830
+ $$dataPt = Decrypt($dataPt, $dpos, $end - $dpos);
11831
+ }
11832
+ return $end;
11833
+ }
11834
+
12226
11835
  #------------------------------------------------------------------------------
12227
11836
  # Read/Write Nikon Encrypted data block
12228
11837
  # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
@@ -12247,15 +11856,17 @@ sub ProcessNikonEncrypted($$$)
12247
11856
  delete $$et{NikonCountKey};
12248
11857
  return 0;
12249
11858
  }
12250
- my $verbose = $$dirInfo{IsWriting} ? 0 : $et->Options('Verbose');
11859
+ my $oldOrder = GetByteOrder();
11860
+ my $isWriting = $$dirInfo{IsWriting};
11861
+ my $verbose = $isWriting ? 0 : $et->Options('Verbose');
12251
11862
  my $tagInfo = $$dirInfo{TagInfo};
12252
11863
  my $dirStart = $$dirInfo{DirStart};
12253
11864
  my $data = substr(${$$dirInfo{DataPt}}, $dirStart, $$dirInfo{DirLen});
12254
11865
 
12255
- my ($start, $len, $more, $offset, $byteOrder, $recrypt, $newSerial, $newCount);
11866
+ my ($start, $len, $offset, $byteOrder, $recrypt, $newSerial, $newCount, $didDecrypt);
12256
11867
 
12257
11868
  # must re-encrypt when writing if serial number or shutter count changes
12258
- if ($$dirInfo{IsWriting}) {
11869
+ if ($isWriting) {
12259
11870
  if ($$et{NewNikonSerialKey}) {
12260
11871
  $newSerial = $$et{NewNikonSerialKey};
12261
11872
  $recrypt = 1;
@@ -12266,46 +11877,32 @@ sub ProcessNikonEncrypted($$$)
12266
11877
  }
12267
11878
  }
12268
11879
  if ($tagInfo and $$tagInfo{SubDirectory}) {
12269
- $start = $$tagInfo{SubDirectory}{DecryptStart};
11880
+ my $subdir = $$tagInfo{SubDirectory};
11881
+ $start = $$subdir{DecryptStart} || 0;
11882
+ # DirOffset, if specified, is relative to start of encrypted data
11883
+ $offset = defined $$subdir{DirOffset} ? $$subdir{DirOffset} + $start : 0;
11884
+ $byteOrder = $$subdir{ByteOrder};
11885
+ SetByteOrder($byteOrder) if $byteOrder;
11886
+ # prepare for processing NIKON_OFFSETS directory if necessary
11887
+ if ($$tagTablePtr{VARS} and $$tagTablePtr{VARS}{NIKON_OFFSETS}) {
11888
+ my $unknown = $et->Options('Verbose') > 2 || $et->Options('Unknown') > 1;
11889
+ # decrypt mode: 0=piecewise, 1=continuous to end of last known section, 2=all
11890
+ my $dMode = $isWriting ? ($recrypt ? 2 : 1) : ($unknown ? 2 : 0);
11891
+ $len = PrepareNikonOffsets($et, \$data, $tagTablePtr, $start, $serial, $count, $dMode);
11892
+ $didDecrypt = 1;
12270
11893
  # may decrypt only part of the information to save time
12271
- if ($verbose < 3 and $et->Options('Unknown') < 2 and not $recrypt) {
12272
- $len = $$tagInfo{SubDirectory}{DecryptLen};
12273
- $more = $$tagInfo{SubDirectory}{DecryptMore};
11894
+ } elsif ($verbose < 3 and $et->Options('Unknown') < 2 and not $recrypt) {
11895
+ $len = $$subdir{DecryptLen};
12274
11896
  }
12275
- $offset = $$tagInfo{SubDirectory}{DirOffset};
12276
- $byteOrder = $$tagInfo{SubDirectory}{ByteOrder};
12277
- }
12278
- $start or $start = 0;
12279
- if (defined $offset) {
12280
- # offset, if specified, is relative to start of encrypted data
12281
- $offset += $start;
12282
11897
  } else {
12283
- $offset = 0;
11898
+ $start = $offset = 0;
12284
11899
  }
12285
11900
  my $maxLen = length($data) - $start;
12286
11901
  # decrypt all the data unless DecryptLen is given
12287
- unless ($len and $len < $maxLen) {
12288
- $len = $maxLen;
12289
- undef $more; # (can't decrypt more than this)
12290
- }
11902
+ $len = $maxLen unless $len and $len < $maxLen;
12291
11903
 
12292
- $data = Decrypt(\$data, $serial, $count, $start, $len);
11904
+ $data = Decrypt(\$data, $start, $len, $serial, $count) unless $didDecrypt;
12293
11905
 
12294
- # set appropriate byte ordering before evaluating DecryptMore
12295
- my $oldOrder = GetByteOrder();
12296
- SetByteOrder($byteOrder) if $byteOrder;
12297
-
12298
- if ($more) {
12299
- #### eval DecryptMore ($data)
12300
- my $moreLen = eval $more;
12301
- $moreLen = $maxLen if $moreLen > $maxLen;
12302
- # re-decrypt with new length
12303
- if ($len < $moreLen) {
12304
- $len = $moreLen;
12305
- $data = substr(${$$dirInfo{DataPt}}, $dirStart, $$dirInfo{DirLen});
12306
- $data = Decrypt(\$data, $serial, $count, $start, $len);
12307
- }
12308
- }
12309
11906
  if ($verbose > 2) {
12310
11907
  $et->VerboseDir("Decrypted $$tagInfo{Name}");
12311
11908
  $et->VerboseDump(\$data,
@@ -12324,7 +11921,7 @@ sub ProcessNikonEncrypted($$$)
12324
11921
  Base => $$dirInfo{Base},
12325
11922
  );
12326
11923
  my $rtnVal;
12327
- if ($$dirInfo{IsWriting}) {
11924
+ if ($isWriting) {
12328
11925
  my $changed = $$et{CHANGED};
12329
11926
  $rtnVal = $et->WriteBinaryData(\%subdirInfo, $tagTablePtr);
12330
11927
  # must re-encrypt if serial number or shutter count changes
@@ -12339,7 +11936,8 @@ sub ProcessNikonEncrypted($$$)
12339
11936
  # add back any un-encrypted data at start
12340
11937
  $rtnVal = substr($data, 0, $offset) . $rtnVal if $offset;
12341
11938
  # re-encrypt data (symmetrical algorithm)
12342
- $rtnVal = Decrypt(\$rtnVal, $serial, $count, $start, $len);
11939
+ $rtnVal = Decrypt(\$rtnVal, $start, $len, $serial, $count);
11940
+ $et->VPrint(2, $$et{INDENT}, " [recrypted $$tagInfo{Name}]");
12343
11941
  }
12344
11942
  } else {
12345
11943
  $rtnVal = $et->ProcessBinaryData(\%subdirInfo, $tagTablePtr);