exiftool-vendored.pl 12.84.0 → 12.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/bin/Changes +94 -3
  2. package/bin/MANIFEST +1 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +16 -16
  5. package/bin/README +47 -46
  6. package/bin/build_geolocation +96 -20
  7. package/bin/config_files/example.config +5 -0
  8. package/bin/config_files/onone.config +28 -0
  9. package/bin/exiftool +67 -57
  10. package/bin/lib/Image/ExifTool/AIFF.pm +8 -4
  11. package/bin/lib/Image/ExifTool/ASF.pm +4 -1
  12. package/bin/lib/Image/ExifTool/Apple.pm +2 -1
  13. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +14 -8
  14. package/bin/lib/Image/ExifTool/Canon.pm +100 -7
  15. package/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  16. package/bin/lib/Image/ExifTool/CanonVRD.pm +5 -2
  17. package/bin/lib/Image/ExifTool/DPX.pm +3 -3
  18. package/bin/lib/Image/ExifTool/FujiFilm.pm +46 -4
  19. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  20. package/bin/lib/Image/ExifTool/Geolocation.pm +18 -8
  21. package/bin/lib/Image/ExifTool/ID3.pm +36 -8
  22. package/bin/lib/Image/ExifTool/InDesign.pm +8 -4
  23. package/bin/lib/Image/ExifTool/Jpeg2000.pm +0 -1
  24. package/bin/lib/Image/ExifTool/Lang/de.pm +2 -2
  25. package/bin/lib/Image/ExifTool/Matroska.pm +66 -10
  26. package/bin/lib/Image/ExifTool/MinoltaRaw.pm +2 -2
  27. package/bin/lib/Image/ExifTool/Nikon.pm +21 -2
  28. package/bin/lib/Image/ExifTool/Olympus.pm +27 -17
  29. package/bin/lib/Image/ExifTool/Panasonic.pm +1 -0
  30. package/bin/lib/Image/ExifTool/PanasonicRaw.pm +1 -0
  31. package/bin/lib/Image/ExifTool/Pentax.pm +139 -22
  32. package/bin/lib/Image/ExifTool/QuickTime.pm +70 -16
  33. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +24 -2
  34. package/bin/lib/Image/ExifTool/RIFF.pm +20 -10
  35. package/bin/lib/Image/ExifTool/Samsung.pm +29 -1
  36. package/bin/lib/Image/ExifTool/Sony.pm +21 -11
  37. package/bin/lib/Image/ExifTool/TagLookup.pm +6806 -6782
  38. package/bin/lib/Image/ExifTool/TagNames.pod +124 -34
  39. package/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  40. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +86 -16
  41. package/bin/lib/Image/ExifTool/Writer.pl +8 -6
  42. package/bin/lib/Image/ExifTool/XMP.pm +10 -8
  43. package/bin/lib/Image/ExifTool/XMP2.pl +51 -30
  44. package/bin/lib/Image/ExifTool/ZIP.pm +8 -4
  45. package/bin/lib/Image/ExifTool.pm +78 -45
  46. package/bin/lib/Image/ExifTool.pod +66 -50
  47. package/bin/perl-Image-ExifTool.spec +45 -45
  48. package/bin/pp_build_exe.args +4 -4
  49. package/package.json +3 -3
@@ -58,7 +58,7 @@ use Image::ExifTool::Exif;
58
58
  use Image::ExifTool::GPS;
59
59
  use Image::ExifTool::HP;
60
60
 
61
- $VERSION = '3.46';
61
+ $VERSION = '3.47';
62
62
 
63
63
  sub CryptShutterCount($$);
64
64
  sub PrintFilter($$$);
@@ -2741,8 +2741,8 @@ my %binaryDataAttrs = (
2741
2741
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfo2' },
2742
2742
  },{
2743
2743
  Name => 'AEInfo3',
2744
- # size: K-30=48
2745
- Condition => '$count == 48',
2744
+ # size: K-30=48, K-1mkII,K-70,KP=64
2745
+ Condition => '$count == 48 or $count == 64',
2746
2746
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfo3' },
2747
2747
  },{
2748
2748
  Name => 'AEInfoUnknown',
@@ -2972,10 +2972,14 @@ my %binaryDataAttrs = (
2972
2972
  ByteOrder => 'BigEndian',
2973
2973
  },
2974
2974
  }],
2975
- 0x022b => { #PH (K-5)
2975
+ 0x022b => [{
2976
+ Name => 'LevelInfoK3III',
2977
+ Condition => '$$self{Model} eq "PENTAX K-3 Mark III"',
2978
+ SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LevelInfoK3III' },
2979
+ },{ #PH (K-5)
2976
2980
  Name => 'LevelInfo',
2977
2981
  SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LevelInfo' },
2978
- },
2982
+ }],
2979
2983
  # 0x022c - undef[46] (K-5)
2980
2984
  0x022d => { #28
2981
2985
  Name => 'WBLevels',
@@ -4034,7 +4038,10 @@ my %binaryDataAttrs = (
4034
4038
  %Image::ExifTool::Pentax::AEInfo3 = (
4035
4039
  %binaryDataAttrs,
4036
4040
  GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
4037
- NOTES => 'Auto-exposure information for the K-3, K-30, K-50 and K-500.',
4041
+ NOTES => q{
4042
+ Auto-exposure information for the K-1mkII, K-3, K-30, K-50, K-70, K-500 and
4043
+ KP.
4044
+ },
4038
4045
  # instead of /8, should these be PentaxEv(), as in CameraSettings? - PH
4039
4046
  16 => {
4040
4047
  Name => 'AEExposureTime',
@@ -4060,6 +4067,7 @@ my %binaryDataAttrs = (
4060
4067
  PrintConv => 'int($val + 0.5)',
4061
4068
  PrintConvInv => '$val',
4062
4069
  },
4070
+ # 23 - bit 0 is related to LiveView, but it isn't reliable
4063
4071
  28 => {
4064
4072
  Name => 'AEMaxAperture',
4065
4073
  Notes => 'val = 2**((raw-68)/16)',
@@ -4676,8 +4684,9 @@ my %binaryDataAttrs = (
4676
4684
  # battery grips available for:
4677
4685
  # BG1 (*istD), BG2 (K10D/K20D), BG3 (K200D), BG4 (K-7,K-5)
4678
4686
  # no grip available: K-x
4679
- 0.1 => { #19
4687
+ 0.1 => [{ #19
4680
4688
  Name => 'PowerSource',
4689
+ Condition => '$$self{Model} !~ /K-3 Mark III/',
4681
4690
  Mask => 0x0f,
4682
4691
  # have seen the upper bit set (value of 0x82) for the
4683
4692
  # *istDS and K100D, but I'm not sure what this means - PH
@@ -4688,6 +4697,29 @@ my %binaryDataAttrs = (
4688
4697
  3 => 'Grip Battery',
4689
4698
  4 => 'External Power Supply', #PH
4690
4699
  },
4700
+ },{ #PH (forum15976)
4701
+ Name => 'PowerSource',
4702
+ Mask => 0x0f,
4703
+ Notes => 'K-3III',
4704
+ # have seen the upper bit set (value of 0x82) for the
4705
+ # *istDS and K100D, but I'm not sure what this means - PH
4706
+ # I've also seen: 0x42 (K2000), 0xf2 (K-7,K-r,K-5), 0x12,0x22 (K-x) - PH
4707
+ PrintConv => {
4708
+ 1 => 'Body Battery',
4709
+ 2 => 'Grip Battery',
4710
+ 4 => 'External Power Supply',
4711
+ },
4712
+ }],
4713
+ 0.2 => {
4714
+ Name => 'PowerAvailable',
4715
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4716
+ Notes => 'K-3III',
4717
+ Mask => 0xf0,
4718
+ PrintConv => { BITMASK => {
4719
+ 0 => 'Body Battery',
4720
+ 1 => 'Grip Battery',
4721
+ 3 => 'External Power Supply',
4722
+ }},
4691
4723
  },
4692
4724
  1.1 => [
4693
4725
  {
@@ -4703,8 +4735,8 @@ my %binaryDataAttrs = (
4703
4735
  },
4704
4736
  },{
4705
4737
  Name => 'BodyBatteryState',
4706
- Condition => '$$self{Model} !~ /(K110D|K2000|K-m)\b/',
4707
- Notes => 'other models except the K110D, K2000 and K-m',
4738
+ Condition => '$$self{Model} !~ /(K110D|K2000|K-m|K-3 Mark III)\b/',
4739
+ Notes => 'most other models except the K110D, K2000, K-m and K-3III',
4708
4740
  Mask => 0xf0,
4709
4741
  PrintConv => {
4710
4742
  1 => 'Empty or Missing',
@@ -4713,10 +4745,6 @@ my %binaryDataAttrs = (
4713
4745
  4 => 'Close to Full',
4714
4746
  5 => 'Full',
4715
4747
  },
4716
- },{
4717
- Name => 'BodyBatteryState',
4718
- Notes => 'decoding unknown for other models',
4719
- Mask => 0xf0,
4720
4748
  },
4721
4749
  ],
4722
4750
  1.2 => [
@@ -4731,11 +4759,6 @@ my %binaryDataAttrs = (
4731
4759
  3 => 'Running Low',
4732
4760
  4 => 'Full',
4733
4761
  },
4734
- },{
4735
- Name => 'GripBatteryState',
4736
- Notes => 'decoding unknown for other models',
4737
- Unknown => 1, # (doesn't appear to be valid for the K-5)
4738
- Mask => 0x0f,
4739
4762
  },
4740
4763
  ],
4741
4764
  # internal and grip battery voltage Analogue to Digital measurements,
@@ -4758,7 +4781,7 @@ my %binaryDataAttrs = (
4758
4781
  },
4759
4782
  {
4760
4783
  Name => 'BodyBatteryVoltage1', # (static?)
4761
- Condition => '$$self{Model} !~ /(K100D|K110D|K2000|K-m|Q\d*)\b/',
4784
+ Condition => '$$self{Model} =~ /(645D|645Z|K-(1|01|3|5|7|30|50|70|500|r|x|S[12])|KP)\b/ and $$self{Model} !~ /III/',
4762
4785
  Format => 'int16u',
4763
4786
  ValueConv => '$val / 100',
4764
4787
  ValueConvInv => '$val * 100',
@@ -4771,7 +4794,19 @@ my %binaryDataAttrs = (
4771
4794
  # BodyBatteryVoltage4 6.10 V 7.55 V 7.45 V
4772
4795
  # "Meas" open-circuit voltages with DVM: AB=0V, AC=+8.33V, BC=+8.22V
4773
4796
  # (terminal "C" is closest to edge of battery)
4774
- },
4797
+ },{
4798
+ Name => 'BodyBatteryState',
4799
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4800
+ Notes => 'K-3III',
4801
+ PrintConv => {
4802
+ 0 => 'Empty or Missing',
4803
+ 1 => 'Almost Empty',
4804
+ 2 => 'Running Low',
4805
+ 3 => 'Half Full',
4806
+ 4 => 'Close to Full',
4807
+ 5 => 'Full',
4808
+ },
4809
+ }
4775
4810
  ],
4776
4811
  3 => [
4777
4812
  {
@@ -4787,7 +4822,11 @@ my %binaryDataAttrs = (
4787
4822
  Name => 'BodyBatteryADLoad',
4788
4823
  Description => 'Body Battery A/D Load',
4789
4824
  Condition => '$$self{Model} =~ /(\*ist|K100D|K200D)\b/',
4790
- },
4825
+ },{
4826
+ Name => 'BodyBatteryPercent',
4827
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4828
+ Notes => 'K-3III',
4829
+ }
4791
4830
  ],
4792
4831
  4 => [
4793
4832
  {
@@ -4797,13 +4836,22 @@ my %binaryDataAttrs = (
4797
4836
  },
4798
4837
  {
4799
4838
  Name => 'BodyBatteryVoltage2', # (less than BodyBatteryVoltage1 -- under load?)
4800
- Condition => '$$self{Model} !~ /(K100D|K110D|K2000|K-m|Q\d*)\b/',
4839
+ Condition => '$$self{Model} =~ /(645D|645Z|K-(1|01|3|5|7|30|50|70|500|r|x|S[12])|KP)\b/ and $$self{Model} !~ /III/',
4801
4840
  Format => 'int16u',
4802
4841
  ValueConv => '$val / 100',
4803
4842
  ValueConvInv => '$val * 100',
4804
4843
  PrintConv => 'sprintf("%.2f V", $val)',
4805
4844
  PrintConvInv => '$val =~ s/\s*V$//',
4806
4845
  },
4846
+ {
4847
+ Name => 'BodyBatteryVoltage',
4848
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4849
+ Format => 'int32u',
4850
+ ValueConv => '$val * 4e-8 + 0.27219',
4851
+ ValueConvInv => '($val - 0.27219) / 4e-8',
4852
+ PrintConv => 'sprintf("%.2f V", $val)',
4853
+ PrintConvInv => '$val =~ s/\s*V$//',
4854
+ },
4807
4855
  ],
4808
4856
  5 => {
4809
4857
  Name => 'GripBatteryADLoad',
@@ -4830,6 +4878,34 @@ my %binaryDataAttrs = (
4830
4878
  PrintConv => 'sprintf("%.2f V", $val)',
4831
4879
  PrintConvInv => '$val =~ s/\s*V$//',
4832
4880
  },
4881
+ 16 => {
4882
+ Name => 'GripBatteryState',
4883
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4884
+ Notes => 'K-3III',
4885
+ PrintConv => {
4886
+ 0 => 'Empty or Missing',
4887
+ 1 => 'Almost Empty',
4888
+ 2 => 'Running Low',
4889
+ 3 => 'Half Full',
4890
+ 4 => 'Close to Full',
4891
+ 5 => 'Full',
4892
+ },
4893
+ },
4894
+ 17 => {
4895
+ Name => 'GripBatteryPercent',
4896
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4897
+ Notes => 'K-3III',
4898
+ },
4899
+ 18 => {
4900
+ Name => 'GripBatteryVoltage',
4901
+ Condition => '$$self{Model} =~ /K-3 Mark III/',
4902
+ Notes => 'K-3III',
4903
+ Format => 'int32u',
4904
+ ValueConv => '$val * 4e-8 + 0.27219',
4905
+ ValueConvInv => '($val - 0.27219) / 4e-8',
4906
+ PrintConv => 'sprintf("%.2f V", $val)',
4907
+ PrintConvInv => '$val =~ s/\s*V$//',
4908
+ },
4833
4909
  );
4834
4910
 
4835
4911
  # auto focus information
@@ -4940,6 +5016,12 @@ my %binaryDataAttrs = (
4940
5016
  20 => 'Mid-right',
4941
5017
  },
4942
5018
  },
5019
+ 0x1fa => {
5020
+ Name => 'LiveView',
5021
+ Notes => 'decoded only for the K-3 III',
5022
+ Condition => '$$self{Model} eq "PENTAX K-3 Mark III"', # and other models?
5023
+ PrintConv => { 0 => 'Off', 1 => 'On' },
5024
+ },
4943
5025
  0x1fd => {
4944
5026
  Name => 'AFHold',
4945
5027
  Notes => 'decoded only for the K-3 II',
@@ -5006,6 +5088,10 @@ my %binaryDataAttrs = (
5006
5088
  1 => 'As EV Steps',
5007
5089
  },
5008
5090
  },
5091
+ 3 => { #PH
5092
+ Name => 'LiveView',
5093
+ PrintConv => { 0 => 'Off', 1 => 'On' },
5094
+ },
5009
5095
  );
5010
5096
 
5011
5097
  # shot information? - ref PH (K-5)
@@ -5483,6 +5569,37 @@ my %binaryDataAttrs = (
5483
5569
  },
5484
5570
  );
5485
5571
 
5572
+ %Image::ExifTool::Pentax::LevelInfoK3III = (
5573
+ %binaryDataAttrs,
5574
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
5575
+ FORMAT => 'int8s',
5576
+ NOTES => 'Tags decoded from the electronic level information for the K-3 III.',
5577
+ 1 => {
5578
+ Name => 'CameraOrientation',
5579
+ PrintConv => {
5580
+ 0 => 'Horizontal (normal)',
5581
+ 1 => 'Rotate 270 CW',
5582
+ 2 => 'Rotate 180',
5583
+ 3 => 'Rotate 90 CW',
5584
+ 4 => 'Upwards', # (to the sky)
5585
+ 5 => 'Downwards', # (to the ground)
5586
+ },
5587
+ },
5588
+ 3 => {
5589
+ Name => 'RollAngle',
5590
+ Notes => 'converted to degrees of clockwise camera rotation',
5591
+ Format => 'int16s',
5592
+ ValueConv => '-$val / 2',
5593
+ ValueConvInv => '-$val * 2',
5594
+ },
5595
+ 5 => {
5596
+ Name => 'PitchAngle',
5597
+ Notes => 'converted to degrees of upward camera tilt',
5598
+ Format => 'int16s',
5599
+ ValueConv => '-$val / 2',
5600
+ ValueConvInv => '-$val * 2',
5601
+ },
5602
+ );
5486
5603
  # white balance RGGB levels (ref 28)
5487
5604
  %Image::ExifTool::Pentax::WBLevels = (
5488
5605
  %binaryDataAttrs,
@@ -48,7 +48,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
48
48
  use Image::ExifTool::Exif;
49
49
  use Image::ExifTool::GPS;
50
50
 
51
- $VERSION = '2.96';
51
+ $VERSION = '2.98';
52
52
 
53
53
  sub ProcessMOV($$;$);
54
54
  sub ProcessKeys($$$);
@@ -238,7 +238,11 @@ my %useExt = ( GLV => 'MP4' );
238
238
 
239
239
  # information for int32u date/time tags (time zero is Jan 1, 1904)
240
240
  my %timeInfo = (
241
- Notes => 'converted from UTC to local time if the QuickTimeUTC option is set',
241
+ Notes => q{
242
+ converted from UTC to local time if the QuickTimeUTC option is set. This
243
+ tag is part of a binary data structure so it may not be deleted -- instead
244
+ the value is set to zero if the tag is deleted individually
245
+ },
242
246
  Shift => 'Time',
243
247
  Writable => 1,
244
248
  Permanent => 1,
@@ -503,6 +507,11 @@ my %eeBox2 = (
503
507
  # image types in AVIF and HEIC files
504
508
  my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
505
509
 
510
+ my %userDefined = (
511
+ ALBUMARTISTSORT => 'AlbumArtistSort',
512
+ ASIN => 'ASIN',
513
+ );
514
+
506
515
  # QuickTime atoms
507
516
  %Image::ExifTool::QuickTime::Main = (
508
517
  PROCESS_PROC => \&ProcessMOV,
@@ -2332,6 +2341,14 @@ my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
2332
2341
  Binary => 1,
2333
2342
  }],
2334
2343
  # ---- Ricoh ----
2344
+ RICO => { #PH (G900SE)
2345
+ Name => 'RicohInfo',
2346
+ Condition => '$$valPt =~ /^\xff\xe1..Exif\0\0/s',
2347
+ SubDirectory => {
2348
+ TagTable => 'Image::ExifTool::JPEG::Main',
2349
+ ProcessProc => \&Image::ExifTool::ProcessJPEG,
2350
+ }
2351
+ },
2335
2352
  RTHU => { #PH (GR)
2336
2353
  Name => 'PreviewImage',
2337
2354
  Groups => { 2 => 'Preview' },
@@ -2929,8 +2946,12 @@ my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
2929
2946
  Format => 'int8u',
2930
2947
  Writable => 'int8u',
2931
2948
  Protected => 1,
2932
- ValueConv => '$val * 90',
2933
- ValueConvInv => 'int($val / 90 + 0.5)',
2949
+ PrintConv => {
2950
+ 0 => 'Horizontal (Normal)',
2951
+ 1 => 'Rotate 270 CW',
2952
+ 2 => 'Rotate 180',
2953
+ 3 => 'Rotate 90 CW',
2954
+ },
2934
2955
  },
2935
2956
  ispe => {
2936
2957
  Name => 'ImageSpatialExtent',
@@ -3425,7 +3446,7 @@ my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
3425
3446
  SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::iTunesInfo' },
3426
3447
  },
3427
3448
  aART => { Name => 'AlbumArtist', Groups => { 2 => 'Author' } },
3428
- covr => { Name => 'CoverArt', Groups => { 2 => 'Preview' } },
3449
+ covr => { Name => 'CoverArt', Groups => { 2 => 'Preview' }, Binary => 1 },
3429
3450
  cpil => { #10
3430
3451
  Name => 'Compilation',
3431
3452
  Format => 'int8u', #27 (ref 23 contradicts what AtomicParsley actually writes, which is int8s)
@@ -6497,8 +6518,8 @@ my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
6497
6518
  ownr => 'Owner', #PH (obscure) (ref ChrisAdan private communication)
6498
6519
  'xid ' => 'ISRC', #PH
6499
6520
  # found in DJI Osmo Action4 video
6500
- tnal => { Name => 'ThumbnailImage', Groups => { 2 => 'Preview' } },
6501
- snal => { Name => 'PreviewImage', Groups => { 2 => 'Preview' } },
6521
+ tnal => { Name => 'ThumbnailImage', Binary => 1, Groups => { 2 => 'Preview' } },
6522
+ snal => { Name => 'PreviewImage', Binary => 1, Groups => { 2 => 'Preview' } },
6502
6523
  );
6503
6524
 
6504
6525
  # tag decoded from timed face records
@@ -8255,8 +8276,8 @@ my %isImageData = ( av01 => 1, avc1 => 1, hvc1 => 1, lhv1 => 1, hvt1 => 1 );
8255
8276
  GROUPS => { 2 => 'Video' },
8256
8277
  Rotation => {
8257
8278
  Notes => q{
8258
- writing this tag updates QuickTime MatrixStructure for all tracks with a
8259
- non-zero image size
8279
+ degrees of clockwise camera rotation. Writing this tag updates QuickTime
8280
+ MatrixStructure for all tracks with a non-zero image size
8260
8281
  },
8261
8282
  Require => {
8262
8283
  0 => 'QuickTime:MatrixStructure',
@@ -8971,12 +8992,20 @@ sub HandleItemInfo($)
8971
8992
  if ($$item{Extents} and @{$$item{Extents}}) {
8972
8993
  $len += $$_[2] foreach @{$$item{Extents}};
8973
8994
  }
8974
- $et->VPrint(0, "$$et{INDENT}Item $id) '${type}' ($len bytes)\n");
8995
+ my $enc = $$item{ContentEncoding} ? ", $$item{ContentEncoding} encoded" : '';
8996
+ $et->VPrint(0, "$$et{INDENT}Item $id) '${type}' ($len bytes$enc)\n");
8975
8997
  }
8976
8998
  # get ExifTool name for this item
8977
8999
  my $name = { Exif => 'EXIF', 'application/rdf+xml' => 'XMP', jpeg => 'PreviewImage' }->{$type} || '';
8978
9000
  my ($warn, $extent);
8979
- $warn = "Can't currently decode encoded $type metadata" if $$item{ContentEncoding};
9001
+ if ($$item{ContentEncoding}) {
9002
+ if ($$item{ContentEncoding} ne 'deflate') {
9003
+ # (other possible values are 'gzip' and 'compress', but I don't have samples of these)
9004
+ $warn = "Can't currently decode $$item{ContentEncoding} encoded $type metadata";
9005
+ } elsif (not eval { require Compress::Zlib }) {
9006
+ $warn = "Install Compress::Zlib to decode deflated $type metadata";
9007
+ }
9008
+ }
8980
9009
  $warn = "Can't currently decode protected $type metadata" if $$item{ProtectionIndex};
8981
9010
  $warn = "Can't currently extract $type with construction method $$item{ConstructionMethod}" if $$item{ConstructionMethod};
8982
9011
  $et->WarnOnce($warn) if $warn and $name;
@@ -9036,6 +9065,22 @@ sub HandleItemInfo($)
9036
9065
  next unless defined $buff;
9037
9066
  $buff = $val . $buff if length $val;
9038
9067
  next unless length $buff; # ignore empty directories
9068
+ if ($$item{ContentEncoding}) {
9069
+ my ($v2, $stat);
9070
+ my $inflate = Compress::Zlib::inflateInit();
9071
+ $inflate and ($v2, $stat) = $inflate->inflate($buff);
9072
+ if ($inflate and $stat == Compress::Zlib::Z_STREAM_END()) {
9073
+ $buff = $v2;
9074
+ my $len = length $buff;
9075
+ $et->VPrint(0, "$$et{INDENT}Inflated Item $id) '${type}' ($len bytes)\n");
9076
+ $et->VerboseDump(\$buff);
9077
+ } else {
9078
+ $warn = "Error inflating $name metadata";
9079
+ $et->WarnOnce($warn);
9080
+ $et->VPrint(0, "$$et{INDENT} [not extracted] ($warn)\n") if $verbose > 2;
9081
+ next;
9082
+ }
9083
+ }
9039
9084
  my ($start, $subTable, $proc);
9040
9085
  my $pos = $$item{Extents}[0][1] + $base;
9041
9086
  if ($name eq 'EXIF' and length $buff >= 4) {
@@ -9471,7 +9516,8 @@ sub ProcessMOV($$;$)
9471
9516
  my $dataPt = $$dirInfo{DataPt};
9472
9517
  my $verbose = $et->Options('Verbose');
9473
9518
  my $validate = $$et{OPTIONS}{Validate};
9474
- my $dataPos = $$dirInfo{Base} || 0;
9519
+ my $dirBase = $$dirInfo{Base} || 0;
9520
+ my $dataPos = $dirBase;
9475
9521
  my $dirID = $$dirInfo{DirID} || '';
9476
9522
  my $charsetQuickTime = $et->Options('CharsetQuickTime');
9477
9523
  my ($buff, $tag, $size, $track, $isUserData, %triplet, $doDefaultLang, $index);
@@ -9556,6 +9602,7 @@ sub ProcessMOV($$;$)
9556
9602
  $atomCount = $$tagTablePtr{VARS}{ATOM_COUNT};
9557
9603
  }
9558
9604
  my $lastTag = '';
9605
+ my $lastPos = 0;
9559
9606
  for (;;) {
9560
9607
  my ($eeTag, $ignore);
9561
9608
  last if defined $atomCount and --$atomCount < 0;
@@ -9594,6 +9641,8 @@ sub ProcessMOV($$;$)
9594
9641
  } elsif (not $et->Options('LargeFileSupport')) {
9595
9642
  $warnStr = 'End of processing at large atom (LargeFileSupport not enabled)';
9596
9643
  last;
9644
+ } elsif ($et->Options('LargeFileSupport') eq '2') {
9645
+ $et->WarnOnce('Processing large atom (LargeFileSupport is 2)');
9597
9646
  }
9598
9647
  }
9599
9648
  $size = $hi * 4294967296 + $lo - 16;
@@ -9758,7 +9807,7 @@ ItemID: foreach $id (reverse sort { $a <=> $b } keys %$items) {
9758
9807
  }
9759
9808
  # use value to get tag info if necessary
9760
9809
  $tagInfo or $tagInfo = $et->GetTagInfo($tagTablePtr, $tag, \$val);
9761
- my $hasData = ($$dirInfo{HasData} and $val =~ /\0...data\0/s);
9810
+ my $hasData = ($$dirInfo{HasData} and $val =~ /^....data\0/s);
9762
9811
  if ($verbose and not $hasData) {
9763
9812
  my $tval;
9764
9813
  if ($tagInfo and $$tagInfo{Format}) {
@@ -10068,14 +10117,15 @@ ItemID: foreach $id (reverse sort { $a <=> $b } keys %$items) {
10068
10117
  ) if $verbose;
10069
10118
  if ($size and (not $raf->Seek($size-1, 1) or $raf->Read($buff, 1) != 1)) {
10070
10119
  my $t = PrintableTagID($tag,2);
10071
- $warnStr = "Truncated '${t}' data";
10120
+ $warnStr = sprintf("Truncated '${t}' data at offset 0x%x", $lastPos);
10072
10121
  last;
10073
10122
  }
10074
10123
  }
10075
10124
  $dataPos += $size + 8; # point to start of next atom data
10076
10125
  last if $dirEnd and $dataPos >= $dirEnd; # (note: ignores last value if 0 bytes)
10126
+ $lastPos = $raf->Tell() + $dirBase;
10077
10127
  $raf->Read($buff, 8) == 8 or last;
10078
- $lastTag = $tag if $$tagTablePtr{$tag};
10128
+ $lastTag = $tag if $$tagTablePtr{$tag} and $tag ne 'free'; # (Insta360 sometimes puts free block before trailer)
10079
10129
  ($size, $tag) = unpack('Na4', $buff);
10080
10130
  ++$index if defined $index;
10081
10131
  }
@@ -10085,7 +10135,11 @@ ItemID: foreach $id (reverse sort { $a <=> $b } keys %$items) {
10085
10135
  if (($lastTag eq 'mdat' or $lastTag eq 'moov') and (not $$tagTablePtr{$tag} or
10086
10136
  ref $$tagTablePtr{$tag} eq 'HASH' and $$tagTablePtr{$tag}{Unknown}))
10087
10137
  {
10088
- $et->Warn('Unknown trailer with '.lcfirst($warnStr));
10138
+ if ($size == 0x1000000 - 8 and $tag =~ /^(\x94\xc0\x7e\0|\0\x02\0\0)/) {
10139
+ $et->Warn(sprintf('Insta360 trailer at offset 0x%x', $lastPos), 1);
10140
+ } else {
10141
+ $et->Warn('Unknown trailer with '.lcfirst($warnStr));
10142
+ }
10089
10143
  } else {
10090
10144
  $et->Warn($warnStr);
10091
10145
  }
@@ -143,6 +143,7 @@ my %insvLimit = (
143
143
  ExposureCompensation => { PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)', Groups => { 2 => 'Camera' } },
144
144
  ISO => { Groups => { 2 => 'Camera' } },
145
145
  CameraDateTime=>{ PrintConv => '$self->ConvertDateTime($val)', Groups => { 2 => 'Time' } },
146
+ DateTimeStamp =>{ PrintConv => '$self->ConvertDateTime($val)', Groups => { 2 => 'Time' } },
146
147
  VideoTimeStamp => { Groups => { 2 => 'Video' } },
147
148
  Accelerometer=> { Notes => '3-axis acceleration in units of g' },
148
149
  AccelerometerData => { },
@@ -992,8 +993,29 @@ sub Process_text($$$;$)
992
993
  $tags{Text} = defined $tags{Text} ? $tags{Text} . "\$$tag$dat" : "\$$tag$dat";
993
994
  }
994
995
  }
995
- %tags and HandleTextTags($et, $tagTbl, \%tags), return;
996
-
996
+ if (%tags) {
997
+ unless ($tags{Accelerometer}) { # (probably unnecessary test)
998
+ # check for NextBase 622GW accelerometer data
999
+ # Example data (leading 2-byte length word has been stripped by ProcessSamples):
1000
+ # 0000: 00 00 00 00 32 30 32 32 30 39 30 35 31 36 34 30 [....202209051640]
1001
+ # 0010: 33 33 00 00 29 00 ba ff 48 ff 18 00 f2 07 5a ff [33..)...H.....Z.]
1002
+ # 0020: 64 ff e8 ff 58 ff e8 ff c1 07 43 ff 41 ff d2 ff [d...X.....C.A...]
1003
+ # 0030: 58 ff ea ff dc 07 50 ff 30 ff e0 ff 72 ff d8 ff [X.....P.0...r...]
1004
+ # 0040: f5 07 51 ff 16 ff dc ff 6a ff ca ff 33 08 45 ff [..Q.....j...3.E.]
1005
+ if ($$dataPt =~ /^\0{4}(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\0\0.{2}/s) {
1006
+ $tags{DateTimeStamp} = "$1:$2:$2 $4:$5:$6";
1007
+ my $num = unpack('x20v', $$dataPt); # number of accelerometer readings
1008
+ if ($num and $num * 12 + 22 < length $$dataPt) {
1009
+ $num *= 6;
1010
+ my @acc = unpack("x22v$num", $$dataPt);
1011
+ map { $_ = $_ - 0x10000 if $_ >= 0x8000 } @acc;
1012
+ $tags{AccelerometerData} = "@acc";
1013
+ }
1014
+ }
1015
+ }
1016
+ HandleTextTags($et, $tagTbl, \%tags);
1017
+ return;
1018
+ }
997
1019
  # check for enciphered binary GPS data
998
1020
  # BlueSkySea:
999
1021
  # 0000: 00 00 aa aa aa aa 54 54 98 9a 9b 93 9a 92 98 9a [......TT........]
@@ -30,7 +30,7 @@ use strict;
30
30
  use vars qw($VERSION $AUTOLOAD);
31
31
  use Image::ExifTool qw(:DataAccess :Utils);
32
32
 
33
- $VERSION = '1.67';
33
+ $VERSION = '1.68';
34
34
 
35
35
  sub ConvertTimecode($);
36
36
  sub ProcessSGLT($$$);
@@ -2041,11 +2041,16 @@ sub ProcessRIFF($$)
2041
2041
  last unless $moviEnd;
2042
2042
  # we arrived here because there was a problem parsing the movie data
2043
2043
  # so seek to the end to continue processing
2044
- if ($moviEnd > 0x7fffffff and not $et->Options('LargeFileSupport')) {
2045
- $et->Warn('Possibly corrupt LIST_movi data');
2046
- $et->Warn('Stopped parsing at large LIST_movi chunk (LargeFileSupport not set)');
2047
- undef $err;
2048
- last;
2044
+ if ($moviEnd > 0x7fffffff) {
2045
+ unless ($et->Options('LargeFileSupport')) {
2046
+ $et->Warn('Possibly corrupt LIST_movi data');
2047
+ $et->Warn('Stopped parsing at large LIST_movi chunk (LargeFileSupport not set)');
2048
+ undef $err;
2049
+ last;
2050
+ }
2051
+ if ($et->Options('LargeFileSupport') eq '2') {
2052
+ $et->WarnOnce('Processing large chunk (LargeFileSupport is 2)');
2053
+ }
2049
2054
  }
2050
2055
  if ($validate) {
2051
2056
  # (must actually try to read something after seeking to detect error)
@@ -2159,10 +2164,15 @@ sub ProcessRIFF($$)
2159
2164
  $moviEnd = $raf->Tell() + $len2;
2160
2165
  next; # parse into movi chunk
2161
2166
  } elsif (not $rewind) {
2162
- if ($len > 0x7fffffff and not $et->Options('LargeFileSupport')) {
2163
- $tag =~ s/([\0-\x1f\x7f-\xff])/sprintf('\\x%.2x',ord $1)/eg;
2164
- $et->Warn("Stopped parsing at large $tag chunk (LargeFileSupport not set)");
2165
- last;
2167
+ if ($len > 0x7fffffff) {
2168
+ unless ($et->Options('LargeFileSupport')) {
2169
+ $tag =~ s/([\0-\x1f\x7f-\xff])/sprintf('\\x%.2x',ord $1)/eg;
2170
+ $et->Warn("Stopped parsing at large $tag chunk (LargeFileSupport not set)");
2171
+ last;
2172
+ }
2173
+ if ($et->Options('LargeFileSupport') eq '2') {
2174
+ $et->WarnOnce('Processing large chunk (LargeFileSupport is 2)');
2175
+ }
2166
2176
  }
2167
2177
  if ($validate and $len2) {
2168
2178
  # (must actually try to read something after seeking to detect error)
@@ -979,6 +979,7 @@ my %formatMinMax = (
979
979
  # 0x0800 - unknown (29 bytes) (contains already-extracted EmbeddedAudioFileName)
980
980
  # 0x0830-name - seen '1165724808.pre'
981
981
  # 0x0830 - unknown (164004 bytes)
982
+ # 0x08c0-name - seen 'Auto_Enhance_Info' #forum16086
982
983
  # 0x08d0-name - seen 'Interactive_Panorama_Info'
983
984
  # 0x08d0 - unknown (7984 bytes)
984
985
  # 0x08e0-name - seen 'Panorama_Shot_Info'
@@ -988,6 +989,8 @@ my %formatMinMax = (
988
989
  # 0x0910 - string, seen 'Front_Cam_Selfie_Info'
989
990
  # 0x09e0-name - seen 'Burst_Shot_Info'
990
991
  # 0x09e0 - string, seen '489489125'
992
+ # 0x09e1-name - seen 'BurstShot_Best_Photo_Info' #forum16086
993
+ # 0x09f0-name - seen 'Pro_Mode_Info' #forum16086
991
994
  # 0x0a01-name - seen 'Image_UTC_Data'
992
995
  '0x0a01' => { #forum7161
993
996
  Name => 'TimeStamp',
@@ -999,6 +1002,7 @@ my %formatMinMax = (
999
1002
  '0x0a20' => { Name => 'DualCameraImage', Groups => { 2 => 'Preview' }, Binary => 1 },
1000
1003
  '0x0a30-name' => 'EmbeddedVideoType', # ("MotionPhoto_Data")
1001
1004
  '0x0a30' => { Name => 'EmbeddedVideoFile', Groups => { 2 => 'Video' }, Binary => 1 }, #forum7161
1005
+ # 0x0a41-name - seen 'BackupRestore_Data' #forum16086
1002
1006
  # 0x0aa1-name - seen 'MCC_Data'
1003
1007
  # 0x0aa1 - seen '204','222','234','302','429'
1004
1008
  '0x0aa1' => {
@@ -1254,15 +1258,39 @@ my %formatMinMax = (
1254
1258
  Name => 'DualShotExtra',
1255
1259
  SubDirectory => { TagTable => 'Image::ExifTool::Samsung::DualShotExtra' },
1256
1260
  },
1261
+ # 0x0ab4-name - seen 'DualShot_Core_Info' #forum16086
1257
1262
  # 0x0ac0-name - seen 'ZoomInOut_Info' (SM-N950U)
1258
1263
  # 0x0ac0 - 2048 bytes of interesting stuff including firmware version? (SM-N950U)
1264
+ # 0x0b30-name - seen 'Camera_Sticker_Info' #forum16086
1259
1265
  '0x0b40' => { # (SM-N975X front camera)
1260
1266
  Name => 'SingleShotMeta',
1261
1267
  SubDirectory => { TagTable => 'Image::ExifTool::Samsung::SingleShotMeta' },
1262
1268
  },
1263
1269
  # 0x0b41-name - seen 'SingeShot_DepthMap_1' (Yes, "Singe") (SM-N975X front camera)
1264
1270
  '0x0b41' => { Name => 'SingleShotDepthMap', Binary => 1 },
1265
- # 0x0ba1-name - seen 'Original_Path_Hash_Key', 'PhotoEditor_Re_Edit_Data'
1271
+ # 0x0b51-name - seen 'Intelligent_PhotoEditor_Data' #forum16086
1272
+ # 0x0b60-name - seen 'UltraWide_PhotoEditor_Data' #forum16086
1273
+ # 0x0b90-name - seen 'Document_Scan_Info' #forum16086
1274
+ # 0x0ba1-name - seen 'Original_Path_Hash_Key', 'PhotoEditor_Re_Edit_Data', 'deco_doodle_bitmap', 'deco_sticker_bitmap', 'deco_text_bitmap'
1275
+ # 0x0ba2-name - seen 'Copy_Available_Edit_Info' #forum16086
1276
+ # 0x0bc0-name - seen 'Single_Relighting_Bokeh_Info' #forum16086
1277
+ # 0x0bd0-name - seen 'Dual_Relighting_Bokeh_Info' #forum16086
1278
+ # 0x0be0-name - seen 'Livefocus_JDM_Info' #forum16086
1279
+ # 0x0bf0-name - seen 'Remaster_Info' #forum16086
1280
+ # 0x0c21-name - seen 'Portrait_Effect_Info' #forum16086
1281
+ # 0x0c51-name - seen 'Samsung_Capture_Info' #forum16086
1282
+ # 0x0c61-name - seen 'Camera_Capture_Mode_Info' #forum16086
1283
+ # 0x0c71-name - seen 'Pro_White_Balance_Info' #forum16086
1284
+ # 0x0c81-name - seen 'Watermark_Info' #forum16086
1285
+ # 0x0cc1-name - seen 'Color_Display_P3' #forum16086
1286
+ # 0x0cd2-name - seen 'Photo_HDR_Info' #forum16086
1287
+ # 0x0ce1-name - seen 'Gallery_DC_Data' #forum16086
1288
+ # 0x0d01-name - seen 'Camera_Scene_Info', 'Camera_Scene_Info2', 'Camera_Scene_Info3' #forum16086
1289
+ # 0x0d11-name - seen 'Video_Snapshot_Info' #forum16086
1290
+ # 0x0d21-name - seen 'Camera_Scene_Info' #forum16086
1291
+ # 0x0d31-name - seen 'Food_Blur_Effect_Info' #forum16086
1292
+ # 0x0d91-name - seen 'PEg_Info' #forum16086
1293
+ # 0x0da1-name - seen 'Captured_App_Info' #forum16086
1266
1294
  # 0xa050-name - seen 'Jpeg360_2D_Info' (Samsung Gear 360)
1267
1295
  # 0xa050 - seen 'Jpeg3602D' (Samsung Gear 360)
1268
1296
  # 0x0c81-name - seen 'Watermark_Info'