exiftool-vendored.pl 13.0.1 → 13.17.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 (216) hide show
  1. package/bin/Changes +269 -20
  2. package/bin/MANIFEST +10 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +3 -3
  6. package/bin/arg_files/exif2xmp.args +4 -0
  7. package/bin/arg_files/xmp2exif.args +2 -1
  8. package/bin/build_geolocation +1 -1
  9. package/bin/exiftool +356 -213
  10. package/bin/lib/File/RandomAccess.pm +1 -1
  11. package/bin/lib/File/RandomAccess.pod +2 -2
  12. package/bin/lib/Image/ExifTool/AAC.pm +1 -1
  13. package/bin/lib/Image/ExifTool/AES.pm +1 -1
  14. package/bin/lib/Image/ExifTool/AFCP.pm +6 -6
  15. package/bin/lib/Image/ExifTool/AIFF.pm +2 -2
  16. package/bin/lib/Image/ExifTool/APE.pm +2 -2
  17. package/bin/lib/Image/ExifTool/APP12.pm +1 -1
  18. package/bin/lib/Image/ExifTool/ASF.pm +2 -2
  19. package/bin/lib/Image/ExifTool/Apple.pm +11 -9
  20. package/bin/lib/Image/ExifTool/Audible.pm +1 -1
  21. package/bin/lib/Image/ExifTool/BMP.pm +1 -1
  22. package/bin/lib/Image/ExifTool/BPG.pm +1 -1
  23. package/bin/lib/Image/ExifTool/BZZ.pm +1 -1
  24. package/bin/lib/Image/ExifTool/BigTIFF.pm +1 -1
  25. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +46 -26
  26. package/bin/lib/Image/ExifTool/CBOR.pm +5 -2
  27. package/bin/lib/Image/ExifTool/Canon.pm +68 -28
  28. package/bin/lib/Image/ExifTool/CanonCustom.pm +1 -1
  29. package/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  30. package/bin/lib/Image/ExifTool/CanonVRD.pm +1 -1
  31. package/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  32. package/bin/lib/Image/ExifTool/Casio.pm +1 -1
  33. package/bin/lib/Image/ExifTool/Charset.pm +1 -1
  34. package/bin/lib/Image/ExifTool/DICOM.pm +1 -1
  35. package/bin/lib/Image/ExifTool/DJI.pm +196 -30
  36. package/bin/lib/Image/ExifTool/DNG.pm +1 -1
  37. package/bin/lib/Image/ExifTool/DPX.pm +1 -1
  38. package/bin/lib/Image/ExifTool/DV.pm +1 -1
  39. package/bin/lib/Image/ExifTool/DarwinCore.pm +1 -1
  40. package/bin/lib/Image/ExifTool/DjVu.pm +1 -1
  41. package/bin/lib/Image/ExifTool/EXE.pm +138 -33
  42. package/bin/lib/Image/ExifTool/Exif.pm +29 -16
  43. package/bin/lib/Image/ExifTool/FITS.pm +3 -3
  44. package/bin/lib/Image/ExifTool/FLAC.pm +1 -1
  45. package/bin/lib/Image/ExifTool/FLIF.pm +3 -3
  46. package/bin/lib/Image/ExifTool/FLIR.pm +1 -1
  47. package/bin/lib/Image/ExifTool/Fixup.pm +1 -1
  48. package/bin/lib/Image/ExifTool/Flash.pm +1 -1
  49. package/bin/lib/Image/ExifTool/FlashPix.pm +17 -21
  50. package/bin/lib/Image/ExifTool/Font.pm +2 -2
  51. package/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  52. package/bin/lib/Image/ExifTool/FujiFilm.pm +1 -1
  53. package/bin/lib/Image/ExifTool/GE.pm +1 -1
  54. package/bin/lib/Image/ExifTool/GIF.pm +144 -93
  55. package/bin/lib/Image/ExifTool/GIMP.pm +1 -1
  56. package/bin/lib/Image/ExifTool/GM.pm +1 -1
  57. package/bin/lib/Image/ExifTool/GPS.pm +34 -30
  58. package/bin/lib/Image/ExifTool/GeoTiff.pm +1 -1
  59. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  60. package/bin/lib/Image/ExifTool/Geolocation.pm +19 -9
  61. package/bin/lib/Image/ExifTool/Geotag.pm +46 -12
  62. package/bin/lib/Image/ExifTool/GoPro.pm +120 -8
  63. package/bin/lib/Image/ExifTool/H264.pm +1 -1
  64. package/bin/lib/Image/ExifTool/HP.pm +2 -2
  65. package/bin/lib/Image/ExifTool/HTML.pm +1 -1
  66. package/bin/lib/Image/ExifTool/HtmlDump.pm +1 -1
  67. package/bin/lib/Image/ExifTool/ICC_Profile.pm +81 -2
  68. package/bin/lib/Image/ExifTool/ICO.pm +1 -1
  69. package/bin/lib/Image/ExifTool/ID3.pm +8 -8
  70. package/bin/lib/Image/ExifTool/IPTC.pm +10 -7
  71. package/bin/lib/Image/ExifTool/ISO.pm +1 -1
  72. package/bin/lib/Image/ExifTool/ITC.pm +1 -1
  73. package/bin/lib/Image/ExifTool/Import.pm +5 -4
  74. package/bin/lib/Image/ExifTool/InDesign.pm +2 -2
  75. package/bin/lib/Image/ExifTool/InfiRay.pm +1 -1
  76. package/bin/lib/Image/ExifTool/JPEG.pm +38 -5
  77. package/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  78. package/bin/lib/Image/ExifTool/JSON.pm +1 -1
  79. package/bin/lib/Image/ExifTool/JVC.pm +1 -1
  80. package/bin/lib/Image/ExifTool/Jpeg2000.pm +10 -9
  81. package/bin/lib/Image/ExifTool/Kodak.pm +1 -1
  82. package/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  83. package/bin/lib/Image/ExifTool/LIF.pm +1 -1
  84. package/bin/lib/Image/ExifTool/LNK.pm +2 -2
  85. package/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  86. package/bin/lib/Image/ExifTool/Lang/de.pm +1 -1
  87. package/bin/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  88. package/bin/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  89. package/bin/lib/Image/ExifTool/Lang/es.pm +1 -1
  90. package/bin/lib/Image/ExifTool/Lang/fi.pm +1 -1
  91. package/bin/lib/Image/ExifTool/Lang/fr.pm +1 -1
  92. package/bin/lib/Image/ExifTool/Lang/it.pm +1 -1
  93. package/bin/lib/Image/ExifTool/Lang/ja.pm +1 -1
  94. package/bin/lib/Image/ExifTool/Lang/ko.pm +1 -1
  95. package/bin/lib/Image/ExifTool/Lang/nl.pm +1 -1
  96. package/bin/lib/Image/ExifTool/Lang/pl.pm +1 -1
  97. package/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  98. package/bin/lib/Image/ExifTool/Lang/sk.pm +1 -1
  99. package/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  100. package/bin/lib/Image/ExifTool/Lang/tr.pm +1 -1
  101. package/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  102. package/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  103. package/bin/lib/Image/ExifTool/Leaf.pm +1 -1
  104. package/bin/lib/Image/ExifTool/LigoGPS.pm +409 -0
  105. package/bin/lib/Image/ExifTool/Lytro.pm +1 -1
  106. package/bin/lib/Image/ExifTool/M2TS.pm +57 -18
  107. package/bin/lib/Image/ExifTool/MIE.pm +15 -6
  108. package/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  109. package/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  110. package/bin/lib/Image/ExifTool/MISB.pm +1 -1
  111. package/bin/lib/Image/ExifTool/MNG.pm +1 -1
  112. package/bin/lib/Image/ExifTool/MOI.pm +1 -1
  113. package/bin/lib/Image/ExifTool/MPC.pm +1 -1
  114. package/bin/lib/Image/ExifTool/MPEG.pm +1 -1
  115. package/bin/lib/Image/ExifTool/MPF.pm +1 -1
  116. package/bin/lib/Image/ExifTool/MRC.pm +1 -1
  117. package/bin/lib/Image/ExifTool/MWG.pm +1 -1
  118. package/bin/lib/Image/ExifTool/MXF.pm +3 -3
  119. package/bin/lib/Image/ExifTool/MacOS.pm +3 -2
  120. package/bin/lib/Image/ExifTool/MakerNotes.pm +1 -1
  121. package/bin/lib/Image/ExifTool/Matroska.pm +22 -6
  122. package/bin/lib/Image/ExifTool/Microsoft.pm +2 -2
  123. package/bin/lib/Image/ExifTool/Minolta.pm +1 -1
  124. package/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  125. package/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  126. package/bin/lib/Image/ExifTool/Nikon.pm +457 -103
  127. package/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  128. package/bin/lib/Image/ExifTool/NikonCustom.pm +6 -6
  129. package/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  130. package/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  131. package/bin/lib/Image/ExifTool/OOXML.pm +8 -8
  132. package/bin/lib/Image/ExifTool/Ogg.pm +1 -1
  133. package/bin/lib/Image/ExifTool/Olympus.pm +1 -1
  134. package/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  135. package/bin/lib/Image/ExifTool/Opus.pm +1 -1
  136. package/bin/lib/Image/ExifTool/Other.pm +1 -1
  137. package/bin/lib/Image/ExifTool/PCX.pm +1 -1
  138. package/bin/lib/Image/ExifTool/PDF.pm +49 -18
  139. package/bin/lib/Image/ExifTool/PGF.pm +1 -1
  140. package/bin/lib/Image/ExifTool/PICT.pm +1 -1
  141. package/bin/lib/Image/ExifTool/PLIST.pm +4 -4
  142. package/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  143. package/bin/lib/Image/ExifTool/PNG.pm +20 -8
  144. package/bin/lib/Image/ExifTool/PPM.pm +12 -3
  145. package/bin/lib/Image/ExifTool/PSP.pm +1 -1
  146. package/bin/lib/Image/ExifTool/Palm.pm +1 -1
  147. package/bin/lib/Image/ExifTool/Panasonic.pm +27 -3
  148. package/bin/lib/Image/ExifTool/PanasonicRaw.pm +1 -1
  149. package/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  150. package/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  151. package/bin/lib/Image/ExifTool/PhaseOne.pm +4 -4
  152. package/bin/lib/Image/ExifTool/PhotoCD.pm +1 -1
  153. package/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  154. package/bin/lib/Image/ExifTool/Photoshop.pm +65 -4
  155. package/bin/lib/Image/ExifTool/PostScript.pm +1 -1
  156. package/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  157. package/bin/lib/Image/ExifTool/Protobuf.pm +270 -0
  158. package/bin/lib/Image/ExifTool/Qualcomm.pm +1 -1
  159. package/bin/lib/Image/ExifTool/QuickTime.pm +327 -88
  160. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +199 -195
  161. package/bin/lib/Image/ExifTool/README +12 -2
  162. package/bin/lib/Image/ExifTool/RIFF.pm +21 -6
  163. package/bin/lib/Image/ExifTool/RSRC.pm +1 -1
  164. package/bin/lib/Image/ExifTool/RTF.pm +2 -2
  165. package/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  166. package/bin/lib/Image/ExifTool/Rawzor.pm +1 -1
  167. package/bin/lib/Image/ExifTool/Real.pm +1 -1
  168. package/bin/lib/Image/ExifTool/Reconyx.pm +1 -1
  169. package/bin/lib/Image/ExifTool/Red.pm +1 -1
  170. package/bin/lib/Image/ExifTool/Ricoh.pm +4 -4
  171. package/bin/lib/Image/ExifTool/Samsung.pm +6 -2
  172. package/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  173. package/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  174. package/bin/lib/Image/ExifTool/Shift.pl +1 -1
  175. package/bin/lib/Image/ExifTool/Shortcuts.pm +1 -1
  176. package/bin/lib/Image/ExifTool/Sigma.pm +1 -1
  177. package/bin/lib/Image/ExifTool/SigmaRaw.pm +1 -1
  178. package/bin/lib/Image/ExifTool/Sony.pm +6 -5
  179. package/bin/lib/Image/ExifTool/SonyIDC.pm +1 -1
  180. package/bin/lib/Image/ExifTool/Stim.pm +1 -1
  181. package/bin/lib/Image/ExifTool/TagInfoXML.pm +6 -5
  182. package/bin/lib/Image/ExifTool/TagLookup.pm +7028 -6968
  183. package/bin/lib/Image/ExifTool/TagNames.pod +12079 -11630
  184. package/bin/lib/Image/ExifTool/Text.pm +4 -3
  185. package/bin/lib/Image/ExifTool/Theora.pm +1 -1
  186. package/bin/lib/Image/ExifTool/Torrent.pm +3 -3
  187. package/bin/lib/Image/ExifTool/Trailer.pm +318 -0
  188. package/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  189. package/bin/lib/Image/ExifTool/VCard.pm +3 -3
  190. package/bin/lib/Image/ExifTool/Validate.pm +6 -6
  191. package/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  192. package/bin/lib/Image/ExifTool/WPG.pm +1 -1
  193. package/bin/lib/Image/ExifTool/WTV.pm +1 -1
  194. package/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  195. package/bin/lib/Image/ExifTool/WriteExif.pl +3 -3
  196. package/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  197. package/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
  198. package/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  199. package/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  200. package/bin/lib/Image/ExifTool/WritePostScript.pl +1 -1
  201. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +170 -79
  202. package/bin/lib/Image/ExifTool/WriteRIFF.pl +17 -6
  203. package/bin/lib/Image/ExifTool/WriteXMP.pl +3 -3
  204. package/bin/lib/Image/ExifTool/Writer.pl +89 -96
  205. package/bin/lib/Image/ExifTool/XISF.pm +1 -1
  206. package/bin/lib/Image/ExifTool/XMP.pm +28 -13
  207. package/bin/lib/Image/ExifTool/XMP2.pl +106 -3
  208. package/bin/lib/Image/ExifTool/XMPStruct.pl +2 -3
  209. package/bin/lib/Image/ExifTool/ZIP.pm +2 -2
  210. package/bin/lib/Image/ExifTool/ZISRAW.pm +1 -1
  211. package/bin/lib/Image/ExifTool/iWork.pm +1 -1
  212. package/bin/lib/Image/ExifTool.pm +467 -228
  213. package/bin/lib/Image/ExifTool.pod +118 -72
  214. package/bin/perl-Image-ExifTool.spec +1 -1
  215. package/bin/windows_exiftool.txt +96 -51
  216. package/package.json +6 -6
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.82';
91
+ $VERSION = '4.89';
92
92
 
93
93
  # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
94
94
  # (or is it? Ref 32 shows 5 non-USM L-type lenses)
@@ -527,7 +527,8 @@ $VERSION = '4.82';
527
527
  748 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x or Tamron Lens', #JR (1.4x Mk III)
528
528
  748.1 => 'Tamron 100-400mm f/4.5-6.3 Di VC USD A035E + 1.4x', #IB
529
529
  748.2 => 'Tamron 70-210mm f/4 Di VC USD (A034) + 2x', #IB
530
- 749 => 'Tamron 100-400mm f/4.5-6.3 Di VC USD A035E + 2x', #IB
530
+ 749 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM + 2x or Tamron Lens', #PH
531
+ 749.1 => 'Tamron 100-400mm f/4.5-6.3 Di VC USD A035E + 2x', #IB
531
532
  750 => 'Canon EF 35mm f/1.4L II USM or Tamron Lens', #42
532
533
  750.1 => 'Tamron SP 85mm f/1.8 Di VC USD (F016)', #Exiv2#1072
533
534
  750.2 => 'Tamron SP 45mm f/1.8 Di VC USD (F013)', #PH
@@ -631,6 +632,12 @@ $VERSION = '4.82';
631
632
  '61182.54' => 'Canon RF 24-105mm F2.8 L IS USM Z', #42
632
633
  '61182.55' => 'Canon RF-S 10-18mm F4.5-6.3 IS STM', #42
633
634
  '61182.56' => 'Canon RF 35mm F1.4 L VCM', #42
635
+ '61182.57' => 'Canon RF 70-200mm F2.8 L IS USM Z', #42
636
+ '61182.58' => 'Canon RF 70-200mm F2.8 L IS USM Z + RF1.4x', #42
637
+ '61182.59' => 'Canon RF 70-200mm F2.8 L IS USM Z + RF2x', #42
638
+ '61182.60' => 'Canon RF 16-28mm F2.8 IS STM', #42
639
+ '61182.61' => 'Canon RF 50mm F1.4 L VCM', #42
640
+ '61182.62' => 'Canon RF 24mm F1.4 L VCM', #42
634
641
  65535 => 'n/a',
635
642
  );
636
643
 
@@ -1401,6 +1408,11 @@ my %offOn = ( 0 => 'Off', 1 => 'On' );
1401
1408
  Condition => '$$self{Model} =~ /\bEOS R[56]$/',
1402
1409
  SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoR6' },
1403
1410
  },
1411
+ {
1412
+ Name => 'CanonCameraInfoR6m2',
1413
+ Condition => '$$self{Model} =~ /\bEOS R6m2$/',
1414
+ SubDirectory => { TagTable => 'Image::ExifTool::Canon::CameraInfoR6m2' },
1415
+ },
1404
1416
  {
1405
1417
  Name => 'CanonCameraInfoG5XII',
1406
1418
  Condition => '$$self{Model} =~ /\bG5 X Mark II$/',
@@ -4749,6 +4761,19 @@ my %ciMaxFocal = (
4749
4761
  # 0x0bb7 - counts down during focus stack (ref forum16111)
4750
4762
  );
4751
4763
 
4764
+ %Image::ExifTool::Canon::CameraInfoR6m2 = (
4765
+ %binaryDataAttrs,
4766
+ FIRST_ENTRY => 0,
4767
+ PRIORITY => 0,
4768
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
4769
+ NOTES => 'CameraInfo tags for the EOS R6 Mark II.',
4770
+ 0x0d29 => { #AgostonKapitany
4771
+ Name => 'ShutterCount',
4772
+ Format => 'int32u',
4773
+ Notes => 'includes electronic + mechanical shutter',
4774
+ },
4775
+ );
4776
+
4752
4777
  # ref https://exiftool.org/forum/index.php?topic=15356.0
4753
4778
  %Image::ExifTool::Canon::CameraInfoG5XII = (
4754
4779
  %binaryDataAttrs,
@@ -7001,6 +7026,12 @@ my %ciMaxFocal = (
7001
7026
  316 => 'Canon RF 35mm F1.4 L VCM', #42
7002
7027
  317 => 'Canon RF-S 3.9mm F3.5 STM DUAL FISHEYE', #42
7003
7028
  318 => 'Canon RF 28-70mm F2.8 IS STM', #42
7029
+ 319 => 'Canon RF 70-200mm F2.8 L IS USM Z', #42
7030
+ 320 => 'Canon RF 70-200mm F2.8 L IS USM Z + RF1.4x', #42
7031
+ 321 => 'Canon RF 70-200mm F2.8 L IS USM Z + RF2x', #42
7032
+ 323 => 'Canon RF 16-28mm F2.8 IS STM', #42
7033
+ 325 => 'Canon RF 50mm F1.4 L VCM', #42
7034
+ 326 => 'Canon RF 24mm F1.4 L VCM', #42
7004
7035
  # Note: add new RF lenses to %canonLensTypes with ID 61182
7005
7036
  },
7006
7037
  },
@@ -9830,35 +9861,39 @@ sub LensWithTC($$)
9830
9861
 
9831
9862
  #------------------------------------------------------------------------------
9832
9863
  # Attempt to calculate sensor size for Canon cameras
9833
- # Inputs: 0/1) rational values for FocalPlaneX/YResolution
9864
+ # Inputs: 0) ExifTool ref
9834
9865
  # Returns: Sensor diagonal size in mm, or undef
9835
9866
  # Notes: This algorithm is fairly reliable, but has been found to give incorrect
9836
9867
  # values for some firmware versions of the EOS 20D, A310, SD40 and IXUS 65
9837
9868
  # (ref http://wyw.dcweb.cn/download.asp?path=&file=jhead-2.96-ccdwidth_hack.zip)
9838
- sub CalcSensorDiag($$)
9869
+ sub CalcSensorDiag($)
9839
9870
  {
9840
- my ($xres, $yres) = @_;
9841
- # most Canon cameras store the sensor size in the denominator
9842
- if ($xres and $yres) {
9843
- # assumptions: 1) numerators are image width/height * 1000
9844
- # 2) denominators are sensor width/height in inches * 1000
9845
- my @xres = split /[ \/]/, $xres;
9846
- my @yres = split /[ \/]/, $yres;
9847
- # verify assumptions as best we can:
9848
- # numerators are always divisible by 1000
9849
- if ($xres[0] % 1000 == 0 and $yres[0] % 1000 == 0 and
9850
- # at least 640x480 pixels (DC models - PH)
9851
- $xres[0] >= 640000 and $yres[0] >= 480000 and
9852
- # ... but not too big!
9853
- $xres[0] < 10000000 and $yres[0] < 10000000 and
9854
- # minimum sensor size is 0.061 inches (DC models - PH)
9855
- $xres[1] >= 61 and $xres[1] < 1500 and
9856
- $yres[1] >= 61 and $yres[1] < 1000 and
9857
- # sensor isn't square (may happen if rationals have been reduced)
9858
- $xres[1] != $yres[1])
9859
- {
9860
- return sqrt($xres[1]*$xres[1] + $yres[1]*$yres[1]) * 0.0254;
9861
- }
9871
+ my $et = shift;
9872
+ # calculation is based on the rational value of FocalPlaneX/YResolution
9873
+ # (most Canon cameras store the sensor size in the denominator)
9874
+ return undef unless $$et{TAG_EXTRA}{FocalPlaneXResolution} and
9875
+ $$et{TAG_EXTRA}{FocalPlaneYResolution};
9876
+ my $xres = $$et{TAG_EXTRA}{FocalPlaneXResolution}{Rational};
9877
+ my $yres = $$et{TAG_EXTRA}{FocalPlaneYResolution}{Rational};
9878
+ return undef unless $xres and $yres;
9879
+ # assumptions: 1) numerators are image width/height * 1000
9880
+ # 2) denominators are sensor width/height in inches * 1000
9881
+ my @xres = split /[ \/]/, $xres;
9882
+ my @yres = split /[ \/]/, $yres;
9883
+ # verify assumptions as best we can:
9884
+ # numerators are always divisible by 1000
9885
+ if ($xres[0] % 1000 == 0 and $yres[0] % 1000 == 0 and
9886
+ # at least 640x480 pixels (DC models - PH)
9887
+ $xres[0] >= 640000 and $yres[0] >= 480000 and
9888
+ # ... but not too big!
9889
+ $xres[0] < 10000000 and $yres[0] < 10000000 and
9890
+ # minimum sensor size is 0.061 inches (DC models - PH)
9891
+ $xres[1] >= 61 and $xres[1] < 1500 and
9892
+ $yres[1] >= 61 and $yres[1] < 1000 and
9893
+ # sensor isn't square (may happen if rationals have been reduced)
9894
+ $xres[1] != $yres[1])
9895
+ {
9896
+ return sqrt($xres[1]*$xres[1] + $yres[1]*$yres[1]) * 0.0254;
9862
9897
  }
9863
9898
  return undef;
9864
9899
  }
@@ -10251,7 +10286,11 @@ sub ProcessSerialData($$$)
10251
10286
  $et->ProcessDirectory(\%dirInfo, $subTablePtr);
10252
10287
  } elsif (not $$tagInfo{Unknown} or $unknown) {
10253
10288
  # don't extract zero-length information
10254
- $et->FoundTag($tagInfo, $val) if $count;
10289
+ my $key = $et->FoundTag($tagInfo, $val) if $count;
10290
+ if ($key) {
10291
+ $$et{TAG_EXTRA}{$key}{G6} = $format if $$et{OPTIONS}{SaveFormat};
10292
+ $$et{TAG_EXTRA}{$key}{BinVal} = substr($$dataPt, $pos+$offset, $len) if $$et{OPTIONS}{SaveBin};
10293
+ }
10255
10294
  }
10256
10295
  $pos += $len;
10257
10296
  }
@@ -10448,6 +10487,7 @@ sub ProcessCTMD($$$)
10448
10487
  Start => $pos + 6,
10449
10488
  Addr => $$dirInfo{Base} + $pos + 6,
10450
10489
  Prefix => $$et{INDENT},
10490
+ Out => $et->Options('TextOut'),
10451
10491
  ) if $verbose > 2;
10452
10492
  if ($$tagTablePtr{$type}) {
10453
10493
  $et->HandleTag($tagTablePtr, $type, undef,
@@ -10558,7 +10598,7 @@ Canon maker notes in EXIF information.
10558
10598
 
10559
10599
  =head1 AUTHOR
10560
10600
 
10561
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
10601
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
10562
10602
 
10563
10603
  This library is free software; you can redistribute it and/or modify it
10564
10604
  under the same terms as Perl itself.
@@ -2873,7 +2873,7 @@ Image::ExifTool to read this information.
2873
2873
 
2874
2874
  =head1 AUTHOR
2875
2875
 
2876
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2876
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
2877
2877
 
2878
2878
  This library is free software; you can redistribute it and/or modify it
2879
2879
  under the same terms as Perl itself.
@@ -888,7 +888,7 @@ tags.)
888
888
 
889
889
  =head1 AUTHOR
890
890
 
891
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
891
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
892
892
 
893
893
  This library is free software; you can redistribute it and/or modify it
894
894
  under the same terms as Perl itself.
@@ -2288,7 +2288,7 @@ files, and as a trailer in JPEG, CRW, CR2 and TIFF images.
2288
2288
 
2289
2289
  =head1 AUTHOR
2290
2290
 
2291
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2291
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
2292
2292
 
2293
2293
  This library is free software; you can redistribute it and/or modify it
2294
2294
  under the same terms as Perl itself.
@@ -221,7 +221,7 @@ settings files (COS).
221
221
 
222
222
  =head1 AUTHOR
223
223
 
224
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
224
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
225
225
 
226
226
  This library is free software; you can redistribute it and/or modify it
227
227
  under the same terms as Perl itself.
@@ -2034,7 +2034,7 @@ Casio maker notes in EXIF information.
2034
2034
 
2035
2035
  =head1 AUTHOR
2036
2036
 
2037
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2037
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
2038
2038
 
2039
2039
  This library is free software; you can redistribute it and/or modify it
2040
2040
  under the same terms as Perl itself.
@@ -422,7 +422,7 @@ when decoding certain types of information.
422
422
 
423
423
  =head1 AUTHOR
424
424
 
425
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
425
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
426
426
 
427
427
  This library is free software; you can redistribute it and/or modify it
428
428
  under the same terms as Perl itself.
@@ -3853,7 +3853,7 @@ No translation of special characters sets is done.
3853
3853
 
3854
3854
  =head1 AUTHOR
3855
3855
 
3856
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
3856
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
3857
3857
 
3858
3858
  This library is free software; you can redistribute it and/or modify it
3859
3859
  under the same terms as Perl itself.
@@ -5,21 +5,29 @@
5
5
  #
6
6
  # Revisions: 2016-07-25 - P. Harvey Created
7
7
  # 2017-06-23 - PH Added XMP tags
8
+ # 2024-12-04 - PH Added protobuf tags
8
9
  #------------------------------------------------------------------------------
9
10
 
10
11
  package Image::ExifTool::DJI;
11
12
 
12
13
  use strict;
13
- use vars qw($VERSION);
14
+ use vars qw($VERSION %knownProtocol);
14
15
  use Image::ExifTool qw(:DataAccess :Utils);
15
16
  use Image::ExifTool::Exif;
16
17
  use Image::ExifTool::XMP;
17
18
  use Image::ExifTool::GPS;
19
+ use Image::ExifTool::Protobuf;
18
20
 
19
- $VERSION = '1.09';
21
+ $VERSION = '1.12';
20
22
 
21
23
  sub ProcessDJIInfo($$$);
22
- sub Process_djmd($$$);
24
+
25
+ %knownProtocol = (
26
+ 'dvtm_ac203.proto' => 1, # Osmo Action 4
27
+ 'dvtm_ac204.proto' => 1, # Osmo Action 5
28
+ 'dvtm_AVATA2.proto' => 1, # Avanta 2
29
+ 'dvtm_wm265e.proto' => 1, # Mavic 3
30
+ );
23
31
 
24
32
  my %convFloat2 = (
25
33
  PrintConv => 'sprintf("%+.2f", $val)',
@@ -187,33 +195,191 @@ my %convFloat2 = (
187
195
  },
188
196
  );
189
197
 
190
- # TODO - eventually add ability to decode this?
191
- %Image::ExifTool::DJI::djmd = (
192
- PROCESS_PROC => \&Process_djmd,
198
+ # metadata in protobuf format (djmd and dbgi meta types, ref PH)
199
+ %Image::ExifTool::DJI::Protobuf = (
200
+ GROUPS => { 0 => 'Protobuf', 1 => 'DJI', 2 => 'Camera' },
201
+ TAG_PREFIX => '',
202
+ PROCESS_PROC => \&Image::ExifTool::Protobuf::ProcessProtobuf,
203
+ NOTES => q{
204
+ Tags found in protobuf-format DJI djmd and dbgi timed metadata. The known
205
+ tags listed below are extracted by default, but unknown djmd tags may be
206
+ extracted as well by setting the Unknown option to 1, or 2 to also extract
207
+ unknown dbgi debug tags. Tag ID's are composed of the corresponding .proto
208
+ file name combined with the hierarchical protobuf field numbers.
209
+
210
+ ExifTool currently extracts timed GPS plus a few other tags from DJI devices
211
+ which use the following protocols: dvtm_AVATA2.proto (Avanta 2),
212
+ dvtm_ac203.proto (Osmo Action 4), dvtm_ac204.proto (Osmo Action 5) and
213
+ dvtm_wm265e.proto (Mavic 3).
214
+
215
+ Note that with the protobuf format, numerical tags missing from the output
216
+ for a given protocol should be considered to have the default value of 0.
217
+ },
218
+ Protocol => {
219
+ RawConv => q{
220
+ unless ($Image::ExifTool::DJI::knownProtocol{$val}) {
221
+ $self->Warn("Unknown protocol $val (please submit sample for testing)");
222
+ }
223
+ return $val;
224
+ },
225
+ },
226
+ #
227
+ # Osmo Action 4
228
+ #
229
+ 'dvtm_ac203_1-1-5' => 'SerialNumber', # (NC)
230
+ # dvtm_ac203_1-1-6 - some version number
231
+ 'dvtm_ac203_1-1-10' => 'Model',
232
+ 'dvtm_ac203_2-3' => {
233
+ Name => 'FrameInfo',
234
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::FrameInfo' },
235
+ },
236
+ # dvtm_ac203_3-4-1-4 - model code?
237
+ 'dvtm_ac203_3-4-2-1' => {
238
+ Name => 'GPSInfo',
239
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::GPSInfo' },
240
+ },
241
+ 'dvtm_ac203_3-4-2-2' => {
242
+ Name => 'GPSAltitude',
243
+ Groups => { 2 => 'Location' },
244
+ Format => 'unsigned',
245
+ ValueConv => '$val / 1000',
246
+ },
247
+ 'dvtm_ac203_3-4-2-6-1' => {
248
+ Name => 'GPSDateTime',
249
+ Format => 'string',
250
+ Groups => { 2 => 'Time' },
251
+ RawConv => '$$self{GPSDateTime} = $val',
252
+ ValueConv => '$val =~ tr/-/:/; $val',
253
+ PrintConv => '$self->ConvertDateTime($val)',
254
+ },
255
+ #
256
+ # Osmo Action 5
257
+ #
258
+ 'dvtm_ac204_1-1-5' => 'SerialNumber', # (NC)
259
+ # dvtm_ac204_1-1-6 - some version number
260
+ 'dvtm_ac204_1-1-10' => 'Model',
261
+ 'dvtm_ac204_2-3' => {
262
+ Name => 'FrameInfo',
263
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::FrameInfo' },
264
+ },
265
+ # dvtm_ac204_3-4-1-4 - model code?
266
+ 'dvtm_ac204_3-4-2-1' => {
267
+ Name => 'GPSInfo',
268
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::GPSInfo' },
269
+ },
270
+ # dvtm_ac204_3-2-4-1 - shutter speed? (rational)
271
+ 'dvtm_ac204_3-4-2-2' => {
272
+ Name => 'GPSAltitude',
273
+ Groups => { 2 => 'Location' },
274
+ Format => 'unsigned',
275
+ ValueConv => '$val / 1000',
276
+ },
277
+ 'dvtm_ac204_3-4-2-6-1' => {
278
+ Name => 'GPSDateTime',
279
+ Format => 'string',
280
+ Groups => { 2 => 'Time' },
281
+ RawConv => '$$self{GPSDateTime} = $val',
282
+ ValueConv => '$val =~ tr/-/:/; $val',
283
+ PrintConv => '$self->ConvertDateTime($val)',
284
+ },
285
+ #
286
+ # Avanta 2
287
+ #
288
+ # dvtm_AVATA2_1-1-2 - some version number
289
+ # dvtm_AVATA2_1-1-3 - some version number
290
+ 'dvtm_AVATA2_1-1-5' => 'SerialNumber', # (NC)
291
+ 'dvtm_AVATA2_1-1-10' => 'Model',
292
+ # dvtm_AVATA2_2-2-1-4 - model code?
293
+ 'dvtm_AVATA2_2-2-3-1' => 'SerialNumber2', # (NC)
294
+ 'dvtm_AVATA2_2-3' => {
295
+ Name => 'FrameInfo',
296
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::FrameInfo' },
297
+ },
298
+ # dvtm_AVATA2_3-1-1 - frame number (starting at 1)
299
+ 'dvtm_AVATA2_3-1-2' => { # (also 3-2-1-6 and 3-4-1-6)
300
+ Name => 'TimeStamp',
301
+ Groups => { 2 => 'Time' },
302
+ Format => 'unsigned',
303
+ # milliseconds, but I don't know what the zero is
304
+ ValueConv => '$val / 1e6',
305
+ },
306
+ # dvtm_AVATA2_3-2-1-4 - model code?
307
+ # dvtm_AVATA2_3-2-1-5 - frame rate?
308
+ # dvtm_AVATA2_3-2-4-1 - shutter speed? (rational)
309
+ # dvtm_AVATA2_3-4-1-4 - model code?
310
+ # dvtm_AVATA2_3-4-3-1,2,3 - YPR? (int64s)
311
+ 'dvtm_AVATA2_3-4-4-1' => {
312
+ Name => 'GPSInfo',
313
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::GPSInfo' },
314
+ },
315
+ #
316
+ # Mavic 3
317
+ #
318
+ 'dvtm_wm265e_1-1-5' => 'SerialNumber', # (confirmed)
319
+ 'dvtm_wm265e_1-1-10' => 'Model',
320
+ 'dvtm_wm265e_2-2' => {
321
+ Name => 'FrameInfo',
322
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::FrameInfo' },
323
+ },
324
+ # dvtm_wm265e_3-2-1-4 - model code?
325
+ 'dvtm_wm265e_3-2-2-1' => { Name => 'ISO', Format => 'float' },
326
+ 'dvtm_wm265e_3-2-3-1' => {
327
+ Name => 'ShutterSpeed',
328
+ Format => 'rational',
329
+ ValueConv => '$val =~ m{(.*)/(.*)} ? $1 / $2 : $val',
330
+ PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
331
+ },
332
+ # dvtm_wm265e_3-2-5-1 - unknown rational (xxxx / 1000)
333
+ 'dvtm_wm265e_3-2-6-1' => { Name => 'DigitalZoom', Format => 'float' },
334
+ 'dvtm_wm265e_3-3-4-1' => {
335
+ Name => 'GPSInfo',
336
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::GPSInfo' },
337
+ },
338
+ 'dvtm_wm265e_3-3-3-1' => { Name => 'DroneRoll', Format => 'int64s', ValueConv => '$val/10' },
339
+ 'dvtm_wm265e_3-3-3-2' => { Name => 'DronePitch', Format => 'int64s', ValueConv => '$val/10' },
340
+ 'dvtm_wm265e_3-3-3-3' => { Name => 'DroneYaw', Format => 'int64s', ValueConv => '$val/10' },
341
+ 'dvtm_wm265e_3-3-4-2' => { Name => 'AbsoluteAltitude', ValueConv => '$val / 1000' },
342
+ 'dvtm_wm265e_3-3-5-1' => { Name => 'RelativeAltitude', Format => 'float', ValueConv => '$val / 1000' },
343
+ 'dvtm_wm265e_3-4-3-1' => { Name => 'GimbalPitch',Format => 'int64s', ValueConv => '$val / 10' },
344
+ 'dvtm_wm265e_3-4-3-2' => { Name => 'GimbalRoll', Format => 'int64s', ValueConv => '$val / 10' },
345
+ 'dvtm_wm265e_3-4-3-3' => { Name => 'GimbalYaw', Format => 'int64s', ValueConv => '$val / 10' },
346
+ );
347
+
348
+ %Image::ExifTool::DJI::FrameInfo = (
349
+ GROUPS => { 0 => 'Protobuf', 1 => 'DJI', 2 => 'Video' },
350
+ PROCESS_PROC => \&Image::ExifTool::Protobuf::ProcessProtobuf,
351
+ VARS => { HEX_ID => 0 },
352
+ 1 => { Name => 'FrameWidth', Format => 'unsigned' },
353
+ 2 => { Name => 'FrameHeight', Format => 'unsigned' },
354
+ 3 => { Name => 'FrameRate', Format => 'float' },
193
355
  );
194
356
 
195
- #------------------------------------------------------------------------------
196
- # Process DJI djmd timed data from Action4 videos (ref PH)
197
- # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
198
- # Returns: 1 on success
199
- # TODO: work in progress
200
- sub Process_djmd($$$)
201
- {
202
- my ($et, $dirInfo, $tagTbl) = @_;
203
- my $dataPt = $$dirInfo{DataPt};
204
- my ($pos, $bit, $val) = (6, 0, 0);
205
- for (;;) {
206
- my $v = Get8u($dataPt, $pos);
207
- $val += ($v & 0x7f) << $bit;
208
- last unless $v & 0x80;
209
- ++$pos;
210
- $bit += 7;
211
- }
212
- $pos += 49;
213
- my @a = unpack("x${pos}fxfxfxfx3fxfxf", $$dataPt);
214
- print "$val @a\n";
215
- return 1;
216
- }
357
+ %Image::ExifTool::DJI::GPSInfo = (
358
+ GROUPS => { 0 => 'Protobuf', 1 => 'DJI', 2 => 'Location' },
359
+ PROCESS_PROC => \&Image::ExifTool::Protobuf::ProcessProtobuf,
360
+ VARS => { HEX_ID => 0 },
361
+ 1 => {
362
+ Name => 'CoordinateUnits',
363
+ Format => 'unsigned',
364
+ Notes => 'not extracted, but used internally to convert coordinates to degrees',
365
+ # don't extract this -- just convert to degrees
366
+ RawConv => '$$self{CoordUnits} = $val; undef',
367
+ # PrintConv => { 0 => 'Radians', 1 => 'Degrees' },
368
+ },
369
+ 2 => {
370
+ Name => 'GPSLatitude',
371
+ Format => 'double',
372
+ # set ExifTool GPSLatitude/GPSLongitude members so GPSDateTime will be generated if necessary
373
+ RawConv => '$$self{GPSLatitude} = $$self{CoordUnits} ? $val : $val * 180 / 3.141592653589793', # (NC)
374
+ PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "N")',
375
+ },
376
+ 3 => {
377
+ Name => 'GPSLongitude',
378
+ Format => 'double',
379
+ RawConv => '$$self{GPSLongitude} = $$self{CoordUnits} ? $val : $val * 180 / 3.141592653589793', # (NC)
380
+ PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")',
381
+ },
382
+ );
217
383
 
218
384
  #------------------------------------------------------------------------------
219
385
  # Process DJI info (ref PH)
@@ -233,7 +399,7 @@ sub ProcessDJIInfo($$$)
233
399
  while ($$dataPt =~ /\G\[(.*?)\](?=(\[|$))/sg) {
234
400
  my ($tag, $val) = split /:/, $1, 2;
235
401
  next unless defined $tag and defined $val;
236
- if ($val =~ /^([\x20-\x7f]+)\0*$/) {
402
+ if ($val =~ /^([\x20-\x7e]+)\0*$/) {
237
403
  $val = $1;
238
404
  } else {
239
405
  my $buff = $val;
@@ -266,7 +432,7 @@ the maker notes in images from some DJI Phantom drones.
266
432
 
267
433
  =head1 AUTHOR
268
434
 
269
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
435
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
270
436
 
271
437
  This library is free software; you can redistribute it and/or modify it
272
438
  under the same terms as Perl itself.
@@ -849,7 +849,7 @@ information in DNG (Digital Negative) images.
849
849
 
850
850
  =head1 AUTHOR
851
851
 
852
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
852
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
853
853
 
854
854
  This library is free software; you can redistribute it and/or modify it
855
855
  under the same terms as Perl itself.
@@ -225,7 +225,7 @@ metadata from DPX (Digital Picture Exchange) images.
225
225
 
226
226
  =head1 AUTHOR
227
227
 
228
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
228
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
229
229
 
230
230
  This library is free software; you can redistribute it and/or modify it
231
231
  under the same terms as Perl itself.
@@ -291,7 +291,7 @@ information from DV (raw Digital Video) files.
291
291
 
292
292
  =head1 AUTHOR
293
293
 
294
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
294
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
295
295
 
296
296
  This library is free software; you can redistribute it and/or modify it
297
297
  under the same terms as Perl itself.
@@ -372,7 +372,7 @@ This file contains tag definitions for the Darwin Core XMP namespace.
372
372
 
373
373
  =head1 AUTHOR
374
374
 
375
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
375
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
376
376
 
377
377
  This library is free software; you can redistribute it and/or modify it
378
378
  under the same terms as Perl itself.
@@ -353,7 +353,7 @@ Image::ExifTool::AIFF.
353
353
 
354
354
  =head1 AUTHOR
355
355
 
356
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
356
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
357
357
 
358
358
  This library is free software; you can redistribute it and/or modify it
359
359
  under the same terms as Perl itself.