exiftool_vendored 13.10.0 → 13.12.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 (212) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +33 -0
  3. data/bin/MANIFEST +1 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +3 -3
  7. data/bin/exiftool +206 -148
  8. data/bin/lib/File/RandomAccess.pm +1 -1
  9. data/bin/lib/File/RandomAccess.pod +2 -2
  10. data/bin/lib/Image/ExifTool/AAC.pm +1 -1
  11. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  12. data/bin/lib/Image/ExifTool/AFCP.pm +1 -1
  13. data/bin/lib/Image/ExifTool/AIFF.pm +1 -1
  14. data/bin/lib/Image/ExifTool/APE.pm +1 -1
  15. data/bin/lib/Image/ExifTool/APP12.pm +1 -1
  16. data/bin/lib/Image/ExifTool/ASF.pm +1 -1
  17. data/bin/lib/Image/ExifTool/Apple.pm +1 -1
  18. data/bin/lib/Image/ExifTool/Audible.pm +1 -1
  19. data/bin/lib/Image/ExifTool/BMP.pm +1 -1
  20. data/bin/lib/Image/ExifTool/BPG.pm +1 -1
  21. data/bin/lib/Image/ExifTool/BZZ.pm +1 -1
  22. data/bin/lib/Image/ExifTool/BigTIFF.pm +1 -1
  23. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +6 -6
  24. data/bin/lib/Image/ExifTool/CBOR.pm +1 -1
  25. data/bin/lib/Image/ExifTool/Canon.pm +8 -4
  26. data/bin/lib/Image/ExifTool/CanonCustom.pm +1 -1
  27. data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  28. data/bin/lib/Image/ExifTool/CanonVRD.pm +1 -1
  29. data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  30. data/bin/lib/Image/ExifTool/Casio.pm +1 -1
  31. data/bin/lib/Image/ExifTool/Charset.pm +1 -1
  32. data/bin/lib/Image/ExifTool/DICOM.pm +1 -1
  33. data/bin/lib/Image/ExifTool/DJI.pm +96 -45
  34. data/bin/lib/Image/ExifTool/DNG.pm +1 -1
  35. data/bin/lib/Image/ExifTool/DPX.pm +1 -1
  36. data/bin/lib/Image/ExifTool/DV.pm +1 -1
  37. data/bin/lib/Image/ExifTool/DarwinCore.pm +1 -1
  38. data/bin/lib/Image/ExifTool/DjVu.pm +1 -1
  39. data/bin/lib/Image/ExifTool/EXE.pm +123 -32
  40. data/bin/lib/Image/ExifTool/Exif.pm +7 -4
  41. data/bin/lib/Image/ExifTool/FITS.pm +1 -1
  42. data/bin/lib/Image/ExifTool/FLAC.pm +1 -1
  43. data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
  44. data/bin/lib/Image/ExifTool/FLIR.pm +1 -1
  45. data/bin/lib/Image/ExifTool/Fixup.pm +1 -1
  46. data/bin/lib/Image/ExifTool/Flash.pm +1 -1
  47. data/bin/lib/Image/ExifTool/FlashPix.pm +1 -1
  48. data/bin/lib/Image/ExifTool/Font.pm +1 -1
  49. data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  50. data/bin/lib/Image/ExifTool/FujiFilm.pm +1 -1
  51. data/bin/lib/Image/ExifTool/GE.pm +1 -1
  52. data/bin/lib/Image/ExifTool/GIF.pm +1 -1
  53. data/bin/lib/Image/ExifTool/GIMP.pm +1 -1
  54. data/bin/lib/Image/ExifTool/GM.pm +1 -1
  55. data/bin/lib/Image/ExifTool/GPS.pm +1 -1
  56. data/bin/lib/Image/ExifTool/GeoTiff.pm +1 -1
  57. data/bin/lib/Image/ExifTool/Geolocation.pm +1 -1
  58. data/bin/lib/Image/ExifTool/Geotag.pm +1 -1
  59. data/bin/lib/Image/ExifTool/GoPro.pm +1 -1
  60. data/bin/lib/Image/ExifTool/H264.pm +1 -1
  61. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  62. data/bin/lib/Image/ExifTool/HTML.pm +1 -1
  63. data/bin/lib/Image/ExifTool/HtmlDump.pm +1 -1
  64. data/bin/lib/Image/ExifTool/ICC_Profile.pm +1 -1
  65. data/bin/lib/Image/ExifTool/ICO.pm +1 -1
  66. data/bin/lib/Image/ExifTool/ID3.pm +1 -1
  67. data/bin/lib/Image/ExifTool/IPTC.pm +8 -5
  68. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  69. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  70. data/bin/lib/Image/ExifTool/Import.pm +5 -4
  71. data/bin/lib/Image/ExifTool/InDesign.pm +1 -1
  72. data/bin/lib/Image/ExifTool/InfiRay.pm +1 -1
  73. data/bin/lib/Image/ExifTool/JPEG.pm +1 -1
  74. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  75. data/bin/lib/Image/ExifTool/JSON.pm +1 -1
  76. data/bin/lib/Image/ExifTool/JVC.pm +1 -1
  77. data/bin/lib/Image/ExifTool/Jpeg2000.pm +1 -1
  78. data/bin/lib/Image/ExifTool/Kodak.pm +1 -1
  79. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  80. data/bin/lib/Image/ExifTool/LIF.pm +1 -1
  81. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  82. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  83. data/bin/lib/Image/ExifTool/Lang/de.pm +1 -1
  84. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  85. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Lang/es.pm +1 -1
  87. data/bin/lib/Image/ExifTool/Lang/fi.pm +1 -1
  88. data/bin/lib/Image/ExifTool/Lang/fr.pm +1 -1
  89. data/bin/lib/Image/ExifTool/Lang/it.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/ja.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/ko.pm +1 -1
  92. data/bin/lib/Image/ExifTool/Lang/nl.pm +1 -1
  93. data/bin/lib/Image/ExifTool/Lang/pl.pm +1 -1
  94. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  95. data/bin/lib/Image/ExifTool/Lang/sk.pm +1 -1
  96. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  97. data/bin/lib/Image/ExifTool/Lang/tr.pm +1 -1
  98. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  99. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  100. data/bin/lib/Image/ExifTool/Leaf.pm +1 -1
  101. data/bin/lib/Image/ExifTool/LigoGPS.pm +408 -0
  102. data/bin/lib/Image/ExifTool/Lytro.pm +1 -1
  103. data/bin/lib/Image/ExifTool/M2TS.pm +22 -13
  104. data/bin/lib/Image/ExifTool/MIE.pm +1 -1
  105. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  106. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  107. data/bin/lib/Image/ExifTool/MISB.pm +1 -1
  108. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  109. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  110. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  111. data/bin/lib/Image/ExifTool/MPEG.pm +1 -1
  112. data/bin/lib/Image/ExifTool/MPF.pm +1 -1
  113. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  114. data/bin/lib/Image/ExifTool/MWG.pm +1 -1
  115. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  116. data/bin/lib/Image/ExifTool/MacOS.pm +1 -1
  117. data/bin/lib/Image/ExifTool/MakerNotes.pm +1 -1
  118. data/bin/lib/Image/ExifTool/Matroska.pm +12 -4
  119. data/bin/lib/Image/ExifTool/Microsoft.pm +1 -1
  120. data/bin/lib/Image/ExifTool/Minolta.pm +1 -1
  121. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  122. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  123. data/bin/lib/Image/ExifTool/Nikon.pm +164 -35
  124. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  125. data/bin/lib/Image/ExifTool/NikonCustom.pm +1 -1
  126. data/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  127. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  128. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  129. data/bin/lib/Image/ExifTool/Ogg.pm +1 -1
  130. data/bin/lib/Image/ExifTool/Olympus.pm +1 -1
  131. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  132. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  133. data/bin/lib/Image/ExifTool/Other.pm +1 -1
  134. data/bin/lib/Image/ExifTool/PCX.pm +1 -1
  135. data/bin/lib/Image/ExifTool/PDF.pm +1 -1
  136. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  137. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  138. data/bin/lib/Image/ExifTool/PLIST.pm +1 -1
  139. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  140. data/bin/lib/Image/ExifTool/PNG.pm +1 -1
  141. data/bin/lib/Image/ExifTool/PPM.pm +1 -1
  142. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  143. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  144. data/bin/lib/Image/ExifTool/Panasonic.pm +20 -2
  145. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +1 -1
  146. data/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  147. data/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  148. data/bin/lib/Image/ExifTool/PhaseOne.pm +1 -1
  149. data/bin/lib/Image/ExifTool/PhotoCD.pm +1 -1
  150. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  151. data/bin/lib/Image/ExifTool/Photoshop.pm +1 -1
  152. data/bin/lib/Image/ExifTool/PostScript.pm +1 -1
  153. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  154. data/bin/lib/Image/ExifTool/Protobuf.pm +24 -14
  155. data/bin/lib/Image/ExifTool/Qualcomm.pm +1 -1
  156. data/bin/lib/Image/ExifTool/QuickTime.pm +46 -17
  157. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +20 -302
  158. data/bin/lib/Image/ExifTool/README +4 -0
  159. data/bin/lib/Image/ExifTool/RIFF.pm +1 -1
  160. data/bin/lib/Image/ExifTool/RSRC.pm +1 -1
  161. data/bin/lib/Image/ExifTool/RTF.pm +1 -1
  162. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  163. data/bin/lib/Image/ExifTool/Rawzor.pm +1 -1
  164. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Reconyx.pm +1 -1
  166. data/bin/lib/Image/ExifTool/Red.pm +1 -1
  167. data/bin/lib/Image/ExifTool/Ricoh.pm +1 -1
  168. data/bin/lib/Image/ExifTool/Samsung.pm +1 -1
  169. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  170. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  171. data/bin/lib/Image/ExifTool/Shift.pl +1 -1
  172. data/bin/lib/Image/ExifTool/Shortcuts.pm +1 -1
  173. data/bin/lib/Image/ExifTool/Sigma.pm +1 -1
  174. data/bin/lib/Image/ExifTool/SigmaRaw.pm +1 -1
  175. data/bin/lib/Image/ExifTool/Sony.pm +1 -1
  176. data/bin/lib/Image/ExifTool/SonyIDC.pm +1 -1
  177. data/bin/lib/Image/ExifTool/Stim.pm +1 -1
  178. data/bin/lib/Image/ExifTool/TagInfoXML.pm +2 -2
  179. data/bin/lib/Image/ExifTool/TagLookup.pm +11 -5
  180. data/bin/lib/Image/ExifTool/TagNames.pod +84 -34
  181. data/bin/lib/Image/ExifTool/Text.pm +1 -1
  182. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  183. data/bin/lib/Image/ExifTool/Torrent.pm +1 -1
  184. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  185. data/bin/lib/Image/ExifTool/VCard.pm +1 -1
  186. data/bin/lib/Image/ExifTool/Validate.pm +1 -1
  187. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  188. data/bin/lib/Image/ExifTool/WPG.pm +1 -1
  189. data/bin/lib/Image/ExifTool/WTV.pm +1 -1
  190. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  191. data/bin/lib/Image/ExifTool/WriteExif.pl +1 -1
  192. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  193. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
  194. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  195. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  196. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -1
  197. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +5 -3
  198. data/bin/lib/Image/ExifTool/WriteRIFF.pl +1 -1
  199. data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  200. data/bin/lib/Image/ExifTool/Writer.pl +9 -8
  201. data/bin/lib/Image/ExifTool/XISF.pm +1 -1
  202. data/bin/lib/Image/ExifTool/XMP.pm +1 -1
  203. data/bin/lib/Image/ExifTool/XMP2.pl +1 -1
  204. data/bin/lib/Image/ExifTool/XMPStruct.pl +1 -1
  205. data/bin/lib/Image/ExifTool/ZIP.pm +1 -1
  206. data/bin/lib/Image/ExifTool/ZISRAW.pm +1 -1
  207. data/bin/lib/Image/ExifTool/iWork.pm +1 -1
  208. data/bin/lib/Image/ExifTool.pm +13 -7
  209. data/bin/lib/Image/ExifTool.pod +14 -5
  210. data/bin/perl-Image-ExifTool.spec +1 -1
  211. data/lib/exiftool_vendored/version.rb +1 -1
  212. metadata +3 -2
@@ -13,6 +13,7 @@
13
13
  # 5) http://msdn.microsoft.com/en-us/library/ms809762.aspx
14
14
  # 6) http://code.google.com/p/pefile/
15
15
  # 7) http://www.codeproject.com/KB/DLL/showver.aspx
16
+ # 8) https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
16
17
  #------------------------------------------------------------------------------
17
18
 
18
19
  package Image::ExifTool::EXE;
@@ -21,7 +22,7 @@ use strict;
21
22
  use vars qw($VERSION);
22
23
  use Image::ExifTool qw(:DataAccess :Utils);
23
24
 
24
- $VERSION = '1.19';
25
+ $VERSION = '1.20';
25
26
 
26
27
  sub ProcessPEResources($$);
27
28
  sub ProcessPEVersion($$);
@@ -171,6 +172,13 @@ my %languageCode = (
171
172
  '100C' => 'French (Swiss)',
172
173
  );
173
174
 
175
+ my %int32uTime = (
176
+ Format => 'int32u',
177
+ Groups => { 0 => 'EXE', 1 => 'EXE', 2 => 'Time' },
178
+ ValueConv => 'ConvertUnixTime($val,1)',
179
+ PrintConv => '$self->ConvertDateTime($val)',
180
+ );
181
+
174
182
  # Information extracted from PE COFF (Windows EXE) file header
175
183
  %Image::ExifTool::EXE::Main = (
176
184
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -215,13 +223,7 @@ my %languageCode = (
215
223
  0xc0ee => 'clr pure MSIL',
216
224
  },
217
225
  },
218
- 2 => {
219
- Name => 'TimeStamp',
220
- Format => 'int32u',
221
- Groups => { 2 => 'Time' },
222
- ValueConv => 'ConvertUnixTime($val,1)',
223
- PrintConv => '$self->ConvertDateTime($val)',
224
- },
226
+ 2 => { Name => 'TimeStamp', %int32uTime },
225
227
  9 => {
226
228
  Name => 'ImageFileCharacteristics',
227
229
  # ref https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_image_file_header
@@ -243,6 +245,10 @@ my %languageCode = (
243
245
  15 => 'Bytes reversed hi',
244
246
  }},
245
247
  },
248
+ #
249
+ # optional header starts at index 10
250
+ # (note: all extracted tags are the same for 32 and 64-bit versions of the optional header)
251
+ #
246
252
  10 => {
247
253
  Name => 'PEType',
248
254
  PrintHex => 1,
@@ -308,6 +314,42 @@ my %languageCode = (
308
314
  },
309
315
  );
310
316
 
317
+ # information extracted from newer CodeView PDB70 ("RSDS") debug entry
318
+ %Image::ExifTool::EXE::DebugRSDS = (
319
+ GROUPS => { 2 => 'Other' },
320
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
321
+ NOTES => 'CodeView RSDS debug information found in some Windows EXE files.',
322
+ 0 => {
323
+ Name => 'PDBModifyDate',
324
+ Notes => 'Taken from debug directory entry pointing to RSDS record.',
325
+ %int32uTime,
326
+ },
327
+ 20 => { Name => 'PDBAge', Format => 'int32u' },
328
+ 24 => { Name => 'PDBFileName', Format => 'string' },
329
+ );
330
+
331
+ # information extracted from older CodeView PDB20 ("NB10") debug entry
332
+ %Image::ExifTool::EXE::DebugNB10 = (
333
+ GROUPS => { 2 => 'Other' },
334
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
335
+ NOTES => 'CodeView NB10 debug information found in some Windows EXE files.',
336
+ 0 => {
337
+ Name => 'PDBModifyDate',
338
+ Notes => 'Taken from debug directory entry pointing to NB10 record.',
339
+ %int32uTime,
340
+ },
341
+ 8 => { Name => 'PDBCreateDate',%int32uTime },
342
+ 12 => { Name => 'PDBAge', Format => 'int32u' },
343
+ 16 => { Name => 'PDBFileName', Format => 'string' },
344
+ );
345
+
346
+ %Image::ExifTool::EXE::Misc = (
347
+ GROUPS => { 2 => 'Other' },
348
+ VARS => { ID_LABEL => 'Index1' },
349
+ NOTES => 'Miscellaneous CodeView debug information in Windows EXE files.',
350
+ 12 => 'EXEFileName',
351
+ );
352
+
311
353
  # PE file version information (ref 6)
312
354
  %Image::ExifTool::EXE::PEVersion = (
313
355
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -974,6 +1016,22 @@ sub ProcessPEVersion($$)
974
1016
  return 1;
975
1017
  }
976
1018
 
1019
+ #------------------------------------------------------------------------------
1020
+ # Get actual file offset given a virtual address in a PE file
1021
+ # Inputs: 0) virtual address, 1) section list ref
1022
+ # Returns: absolute file offset or undef on error
1023
+ sub GetFileOffset($$)
1024
+ {
1025
+ my ($addr, $sections) = @_;
1026
+ my $section;
1027
+ foreach $section (@$sections) {
1028
+ next unless $addr >= $$section{VirtualAddress} and
1029
+ $addr < $$section{VirtualAddress} + $$section{Size};
1030
+ return $addr + $$section{Base} - $$section{VirtualAddress};
1031
+ }
1032
+ return undef;
1033
+ }
1034
+
977
1035
  #------------------------------------------------------------------------------
978
1036
  # Process Windows PE Resources
979
1037
  # Inputs: 0) ExifTool object ref, 1) dirInfo ref
@@ -994,6 +1052,7 @@ sub ProcessPEResources($$)
994
1052
  my $nameEntries = Get16u(\$buff, 12);
995
1053
  my $idEntries = Get16u(\$buff, 14);
996
1054
  my $count = $nameEntries + $idEntries;
1055
+ return 0 if $count > 10000;
997
1056
  $raf->Read($buff, $count * 8) == $count * 8 or return 0;
998
1057
  # loop through all resource entries
999
1058
  for ($item=0; $item<$count; ++$item) {
@@ -1023,18 +1082,12 @@ sub ProcessPEResources($$)
1023
1082
  # get position of this resource in the file
1024
1083
  my $buf2;
1025
1084
  $raf->Seek($entryPos + $base, 0) and $raf->Read($buf2, 16) == 16 or return 0;
1026
- my $off = Get32u(\$buf2, 0);
1085
+ my $addr = Get32u(\$buf2, 0);
1027
1086
  my $len = Get32u(\$buf2, 4);
1028
1087
  # determine which section this is in so we can convert the virtual address
1029
- my ($section, $filePos);
1030
- foreach $section (@{$$dirInfo{Sections}}) {
1031
- next unless $off >= $$section{VirtualAddress} and
1032
- $off < $$section{VirtualAddress} + $$section{Size};
1033
- $filePos = $off + $$section{Base} - $$section{VirtualAddress};
1034
- last;
1035
- }
1036
- return 0 unless $filePos;
1037
- $raf->Seek($filePos, 0) and $raf->Read($buf2, $len) == $len or return 0;
1088
+ my $fileOff = GetFileOffset($addr, $$dirInfo{Sections});
1089
+ return 0 unless $fileOff;
1090
+ $raf->Seek($fileOff, 0) and $raf->Read($buf2, $len) == $len or return 0;
1038
1091
  ProcessPEVersion($et, {
1039
1092
  DataPt => \$buf2,
1040
1093
  DataLen => $len,
@@ -1050,7 +1103,8 @@ sub ProcessPEResources($$)
1050
1103
  #------------------------------------------------------------------------------
1051
1104
  # Process Windows PE file data dictionary
1052
1105
  # Inputs: 0) ExifTool object ref, 1) dirInfo ref
1053
- # Returns: true on success
1106
+ # Returns: true on success or if the PE resources didn't exist, or false on error
1107
+ # processing the PE resources
1054
1108
  sub ProcessPEDict($$)
1055
1109
  {
1056
1110
  my ($et, $dirInfo) = @_;
@@ -1078,6 +1132,7 @@ sub ProcessPEDict($$)
1078
1132
  Sections => \@sections,
1079
1133
  );
1080
1134
  }
1135
+ $$dirInfo{Sections} = \@sections; # return section information
1081
1136
  # process the first resource section
1082
1137
  ProcessPEResources($et, \%dirInfo) or return 0 if %dirInfo;
1083
1138
  return 1;
@@ -1228,11 +1283,12 @@ sub ProcessEXE($$)
1228
1283
  # read the rest of the optional header if necessary
1229
1284
  my $optSize = Get16u(\$buff, 20);
1230
1285
  my $more = $optSize + 24 - $size;
1286
+ my $magic;
1231
1287
  if ($more > 0) {
1232
1288
  if ($raf->Read($buf2, $more) == $more) {
1233
1289
  $buff .= $buf2;
1234
1290
  $size += $more;
1235
- my $magic = Get16u(\$buff, 24);
1291
+ $magic = Get16u(\$buff, 24);
1236
1292
  # verify PE magic number
1237
1293
  unless ($magic == 0x107 or $magic == 0x10b or $magic == 0x20b) {
1238
1294
  $et->Warn('Unknown PE magic number');
@@ -1246,21 +1302,54 @@ sub ProcessEXE($$)
1246
1302
  # process PE COFF file header
1247
1303
  $tagTablePtr = GetTagTable('Image::ExifTool::EXE::Main');
1248
1304
  %dirInfo = (
1249
- DataPt => \$buff,
1250
- DataPos => $raf->Tell() - $size,
1251
- DataLen => $size,
1305
+ DataPt => \$buff,
1306
+ DataPos => $raf->Tell() - $size,
1307
+ DataLen => $size,
1252
1308
  DirStart => 4,
1253
- DirLen => $size - 4,
1309
+ DirLen => $size - 4,
1254
1310
  );
1255
1311
  $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
1256
- # process data dictionary
1257
1312
  my $num = Get16u(\$buff, 6); # NumberOfSections
1258
- if ($raf->Read($buff, 40 * $num) == 40 * $num) {
1259
- %dirInfo = (
1260
- RAF => $raf,
1261
- DataPt => \$buff,
1262
- );
1263
- ProcessPEDict($et, \%dirInfo) or $et->Warn('Error processing PE data dictionary');
1313
+ # image data directory entry for debug info is index 6,
1314
+ # so offset is 4 bytes + 20 byte header + 96 bytes into PE32 optional
1315
+ # header (or 112 bytes for PE32+) + 6 * 8 bytes into data directory
1316
+ my $dirEntry = $magic == 0x20b ? 184 : 168;
1317
+ my ($addr, $len, $pos, $buf2); # virtual address/size of debug section
1318
+ if (length($buff) >= $dirEntry + 8) {
1319
+ $addr = Get32u(\$buff, $dirEntry);
1320
+ $len = Get32u(\$buff, $dirEntry+4);
1321
+ }
1322
+ # process data dictionary
1323
+ # (ref https://www.debuginfo.com/articles/debuginfomatch.html)
1324
+ return 1 unless $raf->Read($buff, 40 * $num) == 40 * $num;
1325
+ %dirInfo = ( RAF => $raf, DataPt => \$buff );
1326
+ ProcessPEDict($et, \%dirInfo) or $et->Warn('Error processing PE resources');
1327
+ # dive into debug section to extract pdb info if available
1328
+ return 1 unless $addr and $len < 2800 and $dirInfo{Sections} and
1329
+ ($magic == 0x10b or $magic == 0x20b);
1330
+ # get file offset for debug section
1331
+ my $off = GetFileOffset($addr, $dirInfo{Sections});
1332
+ return 1 unless $off and $raf->Seek($off,0) and
1333
+ $raf->Read($buff,$len) == $len;
1334
+ for ($pos=0; $pos+28<=$len; $pos+=28) {
1335
+ my $type = Get32u(\$buff,$pos+12);
1336
+ next unless $type == 2 or $type == 4; # (CodeView debug data)
1337
+ my ($n, $of) = (Get32u(\$buff,$pos+16), Get32u(\$buff,$pos+24));
1338
+ next unless $n < 1e4 and $raf->Seek($of,0) and $raf->Read($buf2,$n) == $n;
1339
+ if ($type == 2) { # CodeView debug info
1340
+ next unless $buf2 =~ /^(RSDS|NB10)/;
1341
+ $tagTablePtr = GetTagTable("Image::ExifTool::EXE::Debug$1");
1342
+ substr($buf2,0,4) = substr($buff,$pos+4,4); # use timestamp from debug dir
1343
+ %dirInfo = ( DataPt => \$buf2, DataPos => $of );
1344
+ $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
1345
+ } else { # misc debug info
1346
+ next unless $n > 12;
1347
+ my $exe = substr($buf2,12);
1348
+ $exe = $et->Decode($exe, 'UCS2') if Get32u(\$buf2,8);
1349
+ $exe =~ s/\0.*//; # truncate at null
1350
+ $tagTablePtr = GetTagTable('Image::ExifTool::EXE::Misc');
1351
+ $et->HandleTag($tagTablePtr, 12, $exe, DataPt => \$buf2, DataPos => $of);
1352
+ }
1264
1353
  }
1265
1354
  return 1;
1266
1355
  }
@@ -1454,7 +1543,7 @@ library files.
1454
1543
 
1455
1544
  =head1 AUTHOR
1456
1545
 
1457
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1546
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1458
1547
 
1459
1548
  This library is free software; you can redistribute it and/or modify it
1460
1549
  under the same terms as Perl itself.
@@ -1477,6 +1566,8 @@ under the same terms as Perl itself.
1477
1566
 
1478
1567
  =item L<http://www.codeproject.com/KB/DLL/showver.aspx>
1479
1568
 
1569
+ =item L<https://learn.microsoft.com/en-us/windows/win32/debug/pe-format>
1570
+
1480
1571
  =back
1481
1572
 
1482
1573
  =head1 SEE ALSO
@@ -57,7 +57,7 @@ use vars qw($VERSION $AUTOLOAD @formatSize @formatName %formatNumber %intFormat
57
57
  use Image::ExifTool qw(:DataAccess :Utils);
58
58
  use Image::ExifTool::MakerNotes;
59
59
 
60
- $VERSION = '4.55';
60
+ $VERSION = '4.56';
61
61
 
62
62
  sub ProcessExif($$$);
63
63
  sub WriteExif($$$);
@@ -246,10 +246,13 @@ $formatName[129] = 'utf8'; # (Exif 3.0)
246
246
  # 34888,34889 - ESRI reserved
247
247
  34892 => 'Lossy JPEG', # (DNG 1.4)
248
248
  34925 => 'LZMA2', #LibTiff
249
- 34926 => 'Zstd', #LibTiff
250
- 34927 => 'WebP', #LibTiff
249
+ 34926 => 'Zstd (old)', #LibTiff
250
+ 34927 => 'WebP (old)', #LibTiff
251
251
  34933 => 'PNG', # (TIFF mail list)
252
252
  34934 => 'JPEG XR', # (TIFF mail list)
253
+ 50000 => 'Zstd', #LibTiff 4.7
254
+ 50001 => 'WebP', #LibTiff 4.7
255
+ 50002 => 'JPEG XL (old)', #LibTiff 4.7
253
256
  52546 => 'JPEG XL', # (DNG 1.7)
254
257
  65000 => 'Kodak DCR Compressed', #PH
255
258
  65535 => 'Pentax PEF Compressed', #Jens
@@ -7140,7 +7143,7 @@ EXIF and TIFF meta information.
7140
7143
 
7141
7144
  =head1 AUTHOR
7142
7145
 
7143
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
7146
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
7144
7147
 
7145
7148
  This library is free software; you can redistribute it and/or modify it
7146
7149
  under the same terms as Perl itself.
@@ -137,7 +137,7 @@ information from FITS (Flexible Image Transport System) images.
137
137
 
138
138
  =head1 AUTHOR
139
139
 
140
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
140
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
141
141
 
142
142
  This library is free software; you can redistribute it and/or modify it
143
143
  under the same terms as Perl itself.
@@ -298,7 +298,7 @@ information from Free Lossless Audio Codec (FLAC) audio files.
298
298
 
299
299
  =head1 AUTHOR
300
300
 
301
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
301
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
302
302
 
303
303
  This library is free software; you can redistribute it and/or modify it
304
304
  under the same terms as Perl itself.
@@ -329,7 +329,7 @@ meta information in FLIF (Free Lossless Image Format) images.
329
329
 
330
330
  =head1 AUTHOR
331
331
 
332
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
332
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
333
333
 
334
334
  This library is free software; you can redistribute it and/or modify it
335
335
  under the same terms as Perl itself.
@@ -1633,7 +1633,7 @@ Systems Inc. thermal image files (FFF, FPF and JPEG format).
1633
1633
 
1634
1634
  =head1 AUTHOR
1635
1635
 
1636
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1636
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1637
1637
 
1638
1638
  This library is free software; you can redistribute it and/or modify it
1639
1639
  under the same terms as Perl itself.
@@ -354,7 +354,7 @@ linear list when ApplyFixups() is called.
354
354
 
355
355
  =head1 AUTHOR
356
356
 
357
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
357
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
358
358
 
359
359
  This library is free software; you can redistribute it and/or modify it
360
360
  under the same terms as Perl itself.
@@ -721,7 +721,7 @@ will add AMF3 support.
721
721
 
722
722
  =head1 AUTHOR
723
723
 
724
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
724
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
725
725
 
726
726
  This library is free software; you can redistribute it and/or modify it
727
727
  under the same terms as Perl itself.
@@ -2557,7 +2557,7 @@ JPEG images.
2557
2557
 
2558
2558
  =head1 AUTHOR
2559
2559
 
2560
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2560
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
2561
2561
 
2562
2562
  This library is free software; you can redistribute it and/or modify it
2563
2563
  under the same terms as Perl itself.
@@ -633,7 +633,7 @@ extracted from these formats.
633
633
 
634
634
  =head1 AUTHOR
635
635
 
636
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
636
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
637
637
 
638
638
  This library is free software; you can redistribute it and/or modify it
639
639
  under the same terms as Perl itself.
@@ -243,7 +243,7 @@ write information from the FotoWare FotoStation trailer.
243
243
 
244
244
  =head1 AUTHOR
245
245
 
246
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
246
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
247
247
 
248
248
  This library is free software; you can redistribute it and/or modify it
249
249
  under the same terms as Perl itself.
@@ -1959,7 +1959,7 @@ FujiFilm maker notes in EXIF information, and to read/write FujiFilm RAW
1959
1959
 
1960
1960
  =head1 AUTHOR
1961
1961
 
1962
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1962
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1963
1963
 
1964
1964
  This library is free software; you can redistribute it and/or modify it
1965
1965
  under the same terms as Perl itself.
@@ -68,7 +68,7 @@ General Imaging maker notes.
68
68
 
69
69
  =head1 AUTHOR
70
70
 
71
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
71
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
72
72
 
73
73
  This library is free software; you can redistribute it and/or modify it
74
74
  under the same terms as Perl itself.
@@ -596,7 +596,7 @@ write GIF meta information.
596
596
 
597
597
  =head1 AUTHOR
598
598
 
599
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
599
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
600
600
 
601
601
  This library is free software; you can redistribute it and/or modify it
602
602
  under the same terms as Perl itself.
@@ -270,7 +270,7 @@ GIMP software.
270
270
 
271
271
  =head1 AUTHOR
272
272
 
273
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
273
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
274
274
 
275
275
  This library is free software; you can redistribute it and/or modify it
276
276
  under the same terms as Perl itself.
@@ -531,7 +531,7 @@ metadata from videos written by some GM models such as Corvette and Camero.
531
531
 
532
532
  =head1 AUTHOR
533
533
 
534
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
534
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
535
535
 
536
536
  This library is free software; you can redistribute it and/or modify it
537
537
  under the same terms as Perl itself.
@@ -619,7 +619,7 @@ GPS (Global Positioning System) meta information in EXIF data.
619
619
 
620
620
  =head1 AUTHOR
621
621
 
622
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
622
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
623
623
 
624
624
  This library is free software; you can redistribute it and/or modify it
625
625
  under the same terms as Perl itself.
@@ -2242,7 +2242,7 @@ coordinates.
2242
2242
 
2243
2243
  =head1 AUTHOR
2244
2244
 
2245
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2245
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
2246
2246
 
2247
2247
  This library is free software; you can redistribute it and/or modify it
2248
2248
  under the same terms as Perl itself.
@@ -1006,7 +1006,7 @@ the input arguments of the AddEntry method.
1006
1006
 
1007
1007
  =head1 AUTHOR
1008
1008
 
1009
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1009
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1010
1010
 
1011
1011
  This library is free software; you can redistribute it and/or modify it
1012
1012
  under the same terms as Perl itself. The associated database files are
@@ -1561,7 +1561,7 @@ user-defined tag GPSRoll, must be active.
1561
1561
 
1562
1562
  =head1 AUTHOR
1563
1563
 
1564
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1564
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1565
1565
 
1566
1566
  This library is free software; you can redistribute it and/or modify it
1567
1567
  under the same terms as Perl itself.
@@ -860,7 +860,7 @@ metadata from GoPro MP4 videos.
860
860
 
861
861
  =head1 AUTHOR
862
862
 
863
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
863
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
864
864
 
865
865
  This library is free software; you can redistribute it and/or modify it
866
866
  under the same terms as Perl itself.
@@ -1123,7 +1123,7 @@ information from H.264 video streams.
1123
1123
 
1124
1124
  =head1 AUTHOR
1125
1125
 
1126
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1126
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1127
1127
 
1128
1128
  This library is free software; you can redistribute it and/or modify it
1129
1129
  under the same terms as Perl itself.
@@ -250,7 +250,7 @@ Hewlett-Packard maker notes.
250
250
 
251
251
  =head1 AUTHOR
252
252
 
253
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
253
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
254
254
 
255
255
  This library is free software; you can redistribute it and/or modify it
256
256
  under the same terms as Perl itself.
@@ -555,7 +555,7 @@ meta information from HTML documents.
555
555
 
556
556
  =head1 AUTHOR
557
557
 
558
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
558
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
559
559
 
560
560
  This library is free software; you can redistribute it and/or modify it
561
561
  under the same terms as Perl itself.
@@ -920,7 +920,7 @@ page.
920
920
 
921
921
  =head1 AUTHOR
922
922
 
923
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
923
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
924
924
 
925
925
  This library is free software; you can redistribute it and/or modify it
926
926
  under the same terms as Perl itself.
@@ -1436,7 +1436,7 @@ data created on one device into another device's native color space.
1436
1436
 
1437
1437
  =head1 AUTHOR
1438
1438
 
1439
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1439
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1440
1440
 
1441
1441
  This library is free software; you can redistribute it and/or modify it
1442
1442
  under the same terms as Perl itself.
@@ -121,7 +121,7 @@ information from Windows ICO (icon) and CUR (cursor) files.
121
121
 
122
122
  =head1 AUTHOR
123
123
 
124
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
124
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
125
125
 
126
126
  This library is free software; you can redistribute it and/or modify it
127
127
  under the same terms as Perl itself.
@@ -1746,7 +1746,7 @@ other types of audio files.
1746
1746
 
1747
1747
  =head1 AUTHOR
1748
1748
 
1749
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1749
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1750
1750
 
1751
1751
  This library is free software; you can redistribute it and/or modify it
1752
1752
  under the same terms as Perl itself.
@@ -15,7 +15,7 @@ use strict;
15
15
  use vars qw($VERSION $AUTOLOAD %iptcCharset);
16
16
  use Image::ExifTool qw(:DataAccess :Utils);
17
17
 
18
- $VERSION = '1.58';
18
+ $VERSION = '1.59';
19
19
 
20
20
  %iptcCharset = (
21
21
  "\x1b%G" => 'UTF8',
@@ -1057,7 +1057,7 @@ sub ProcessIPTC($$$)
1057
1057
  my $verbose = $et->Options('Verbose');
1058
1058
  my $validate = $et->Options('Validate');
1059
1059
  my $success = 0;
1060
- my ($lastRec, $recordPtr, $recordName);
1060
+ my ($lastRec, $recordPtr, $recordName, %seen);
1061
1061
 
1062
1062
  $verbose and $dirInfo and $et->VerboseDir('IPTC', 0, $$dirInfo{DirLen});
1063
1063
 
@@ -1083,7 +1083,7 @@ sub ProcessIPTC($$$)
1083
1083
  $et->FoundTag('CurrentIPTCDigest', $md5);
1084
1084
  }
1085
1085
  } else {
1086
- if (($Image::ExifTool::MWG::strict or $et->Options('Validate')) and
1086
+ if (($Image::ExifTool::MWG::strict or $validate) and
1087
1087
  $$et{FILE_TYPE} =~ /^(JPEG|TIFF|PSD)$/)
1088
1088
  {
1089
1089
  if ($Image::ExifTool::MWG::strict) {
@@ -1186,8 +1186,11 @@ sub ProcessIPTC($$$)
1186
1186
  # - no Name so name is generated automatically with decimal tag number
1187
1187
  AddTagToTable($recordPtr, $tag, { Unknown => 1 });
1188
1188
  }
1189
-
1190
1189
  my $tagInfo = $et->GetTagInfo($recordPtr, $tag);
1190
+ if ($validate and not $$tagInfo{List} and not $$tagInfo{Unknown}) {
1191
+ $et->Warn("Multiple IPTC $$tagInfo{Name} tags") if $seen{$tagInfo};
1192
+ $seen{$tagInfo} = 1;
1193
+ }
1191
1194
  my $format;
1192
1195
  # (could use $$recordPtr{FORMAT} if no Format below, but don't do this to
1193
1196
  # be backward compatible with improperly written PhotoMechanic tags)
@@ -1284,7 +1287,7 @@ image files.
1284
1287
 
1285
1288
  =head1 AUTHOR
1286
1289
 
1287
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
1290
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
1288
1291
 
1289
1292
  This library is free software; you can redistribute it and/or modify it
1290
1293
  under the same terms as Perl itself.
@@ -184,7 +184,7 @@ information from ISO 9660 disk images.
184
184
 
185
185
  =head1 AUTHOR
186
186
 
187
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
187
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
188
188
 
189
189
  This library is free software; you can redistribute it and/or modify it
190
190
  under the same terms as Perl itself.
@@ -191,7 +191,7 @@ information (including artwork images) from iTunes Cover Flow files.
191
191
 
192
192
  =head1 AUTHOR
193
193
 
194
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
194
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
195
195
 
196
196
  This library is free software; you can redistribute it and/or modify it
197
197
  under the same terms as Perl itself.