exiftool-vendored.exe 13.0.0 → 13.16.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 (208) hide show
  1. package/bin/exiftool.exe +0 -0
  2. package/bin/exiftool_files/exiftool.pl +169 -65
  3. package/bin/exiftool_files/lib/File/RandomAccess.pm +1 -1
  4. package/bin/exiftool_files/lib/File/RandomAccess.pod +2 -2
  5. package/bin/exiftool_files/lib/Image/ExifTool/AAC.pm +1 -1
  6. package/bin/exiftool_files/lib/Image/ExifTool/AES.pm +1 -1
  7. package/bin/exiftool_files/lib/Image/ExifTool/AFCP.pm +6 -6
  8. package/bin/exiftool_files/lib/Image/ExifTool/AIFF.pm +2 -2
  9. package/bin/exiftool_files/lib/Image/ExifTool/APE.pm +2 -2
  10. package/bin/exiftool_files/lib/Image/ExifTool/APP12.pm +1 -1
  11. package/bin/exiftool_files/lib/Image/ExifTool/ASF.pm +2 -2
  12. package/bin/exiftool_files/lib/Image/ExifTool/Apple.pm +11 -9
  13. package/bin/exiftool_files/lib/Image/ExifTool/Audible.pm +1 -1
  14. package/bin/exiftool_files/lib/Image/ExifTool/BMP.pm +1 -1
  15. package/bin/exiftool_files/lib/Image/ExifTool/BPG.pm +1 -1
  16. package/bin/exiftool_files/lib/Image/ExifTool/BZZ.pm +1 -1
  17. package/bin/exiftool_files/lib/Image/ExifTool/BigTIFF.pm +1 -1
  18. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +36 -22
  19. package/bin/exiftool_files/lib/Image/ExifTool/CBOR.pm +5 -2
  20. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +66 -27
  21. package/bin/exiftool_files/lib/Image/ExifTool/CanonCustom.pm +1 -1
  22. package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +1 -1
  23. package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +1 -1
  24. package/bin/exiftool_files/lib/Image/ExifTool/CaptureOne.pm +1 -1
  25. package/bin/exiftool_files/lib/Image/ExifTool/Casio.pm +1 -1
  26. package/bin/exiftool_files/lib/Image/ExifTool/Charset.pm +1 -1
  27. package/bin/exiftool_files/lib/Image/ExifTool/DICOM.pm +1 -1
  28. package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +196 -30
  29. package/bin/exiftool_files/lib/Image/ExifTool/DNG.pm +1 -1
  30. package/bin/exiftool_files/lib/Image/ExifTool/DPX.pm +1 -1
  31. package/bin/exiftool_files/lib/Image/ExifTool/DV.pm +1 -1
  32. package/bin/exiftool_files/lib/Image/ExifTool/DarwinCore.pm +1 -1
  33. package/bin/exiftool_files/lib/Image/ExifTool/DjVu.pm +1 -1
  34. package/bin/exiftool_files/lib/Image/ExifTool/EXE.pm +138 -33
  35. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +29 -16
  36. package/bin/exiftool_files/lib/Image/ExifTool/FITS.pm +3 -3
  37. package/bin/exiftool_files/lib/Image/ExifTool/FLAC.pm +1 -1
  38. package/bin/exiftool_files/lib/Image/ExifTool/FLIF.pm +3 -3
  39. package/bin/exiftool_files/lib/Image/ExifTool/FLIR.pm +1 -1
  40. package/bin/exiftool_files/lib/Image/ExifTool/Fixup.pm +1 -1
  41. package/bin/exiftool_files/lib/Image/ExifTool/Flash.pm +1 -1
  42. package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +17 -21
  43. package/bin/exiftool_files/lib/Image/ExifTool/Font.pm +2 -2
  44. package/bin/exiftool_files/lib/Image/ExifTool/FotoStation.pm +1 -1
  45. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +1 -1
  46. package/bin/exiftool_files/lib/Image/ExifTool/GE.pm +1 -1
  47. package/bin/exiftool_files/lib/Image/ExifTool/GIF.pm +144 -93
  48. package/bin/exiftool_files/lib/Image/ExifTool/GIMP.pm +1 -1
  49. package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +1 -1
  50. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +34 -30
  51. package/bin/exiftool_files/lib/Image/ExifTool/GeoTiff.pm +1 -1
  52. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.dat +0 -0
  53. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +19 -9
  54. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +46 -12
  55. package/bin/exiftool_files/lib/Image/ExifTool/GoPro.pm +120 -8
  56. package/bin/exiftool_files/lib/Image/ExifTool/H264.pm +1 -1
  57. package/bin/exiftool_files/lib/Image/ExifTool/HP.pm +2 -2
  58. package/bin/exiftool_files/lib/Image/ExifTool/HTML.pm +1 -1
  59. package/bin/exiftool_files/lib/Image/ExifTool/HtmlDump.pm +1 -1
  60. package/bin/exiftool_files/lib/Image/ExifTool/ICC_Profile.pm +81 -2
  61. package/bin/exiftool_files/lib/Image/ExifTool/ICO.pm +1 -1
  62. package/bin/exiftool_files/lib/Image/ExifTool/ID3.pm +8 -8
  63. package/bin/exiftool_files/lib/Image/ExifTool/IPTC.pm +10 -7
  64. package/bin/exiftool_files/lib/Image/ExifTool/ISO.pm +1 -1
  65. package/bin/exiftool_files/lib/Image/ExifTool/ITC.pm +1 -1
  66. package/bin/exiftool_files/lib/Image/ExifTool/Import.pm +5 -4
  67. package/bin/exiftool_files/lib/Image/ExifTool/InDesign.pm +2 -2
  68. package/bin/exiftool_files/lib/Image/ExifTool/InfiRay.pm +1 -1
  69. package/bin/exiftool_files/lib/Image/ExifTool/JPEG.pm +32 -5
  70. package/bin/exiftool_files/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  71. package/bin/exiftool_files/lib/Image/ExifTool/JSON.pm +1 -1
  72. package/bin/exiftool_files/lib/Image/ExifTool/JVC.pm +1 -1
  73. package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +10 -9
  74. package/bin/exiftool_files/lib/Image/ExifTool/Kodak.pm +1 -1
  75. package/bin/exiftool_files/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  76. package/bin/exiftool_files/lib/Image/ExifTool/LIF.pm +1 -1
  77. package/bin/exiftool_files/lib/Image/ExifTool/LNK.pm +2 -2
  78. package/bin/exiftool_files/lib/Image/ExifTool/Lang/cs.pm +1 -1
  79. package/bin/exiftool_files/lib/Image/ExifTool/Lang/de.pm +1 -1
  80. package/bin/exiftool_files/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  81. package/bin/exiftool_files/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  82. package/bin/exiftool_files/lib/Image/ExifTool/Lang/es.pm +1 -1
  83. package/bin/exiftool_files/lib/Image/ExifTool/Lang/fi.pm +1 -1
  84. package/bin/exiftool_files/lib/Image/ExifTool/Lang/fr.pm +1 -1
  85. package/bin/exiftool_files/lib/Image/ExifTool/Lang/it.pm +1 -1
  86. package/bin/exiftool_files/lib/Image/ExifTool/Lang/ja.pm +1 -1
  87. package/bin/exiftool_files/lib/Image/ExifTool/Lang/ko.pm +1 -1
  88. package/bin/exiftool_files/lib/Image/ExifTool/Lang/nl.pm +1 -1
  89. package/bin/exiftool_files/lib/Image/ExifTool/Lang/pl.pm +1 -1
  90. package/bin/exiftool_files/lib/Image/ExifTool/Lang/ru.pm +1 -1
  91. package/bin/exiftool_files/lib/Image/ExifTool/Lang/sk.pm +1 -1
  92. package/bin/exiftool_files/lib/Image/ExifTool/Lang/sv.pm +1 -1
  93. package/bin/exiftool_files/lib/Image/ExifTool/Lang/tr.pm +1 -1
  94. package/bin/exiftool_files/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  95. package/bin/exiftool_files/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  96. package/bin/exiftool_files/lib/Image/ExifTool/Leaf.pm +1 -1
  97. package/bin/exiftool_files/lib/Image/ExifTool/LigoGPS.pm +409 -0
  98. package/bin/exiftool_files/lib/Image/ExifTool/Lytro.pm +1 -1
  99. package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +57 -18
  100. package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +15 -6
  101. package/bin/exiftool_files/lib/Image/ExifTool/MIEUnits.pod +1 -1
  102. package/bin/exiftool_files/lib/Image/ExifTool/MIFF.pm +1 -1
  103. package/bin/exiftool_files/lib/Image/ExifTool/MISB.pm +1 -1
  104. package/bin/exiftool_files/lib/Image/ExifTool/MNG.pm +1 -1
  105. package/bin/exiftool_files/lib/Image/ExifTool/MOI.pm +1 -1
  106. package/bin/exiftool_files/lib/Image/ExifTool/MPC.pm +1 -1
  107. package/bin/exiftool_files/lib/Image/ExifTool/MPEG.pm +1 -1
  108. package/bin/exiftool_files/lib/Image/ExifTool/MPF.pm +1 -1
  109. package/bin/exiftool_files/lib/Image/ExifTool/MRC.pm +1 -1
  110. package/bin/exiftool_files/lib/Image/ExifTool/MWG.pm +1 -1
  111. package/bin/exiftool_files/lib/Image/ExifTool/MXF.pm +3 -3
  112. package/bin/exiftool_files/lib/Image/ExifTool/MacOS.pm +3 -2
  113. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +1 -1
  114. package/bin/exiftool_files/lib/Image/ExifTool/Matroska.pm +22 -6
  115. package/bin/exiftool_files/lib/Image/ExifTool/Microsoft.pm +2 -2
  116. package/bin/exiftool_files/lib/Image/ExifTool/Minolta.pm +1 -1
  117. package/bin/exiftool_files/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  118. package/bin/exiftool_files/lib/Image/ExifTool/Motorola.pm +1 -1
  119. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +495 -39
  120. package/bin/exiftool_files/lib/Image/ExifTool/NikonCapture.pm +1 -1
  121. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +2 -2
  122. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +1 -1
  123. package/bin/exiftool_files/lib/Image/ExifTool/Nintendo.pm +1 -1
  124. package/bin/exiftool_files/lib/Image/ExifTool/OOXML.pm +8 -8
  125. package/bin/exiftool_files/lib/Image/ExifTool/Ogg.pm +1 -1
  126. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +1 -1
  127. package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +1 -1
  128. package/bin/exiftool_files/lib/Image/ExifTool/Opus.pm +1 -1
  129. package/bin/exiftool_files/lib/Image/ExifTool/Other.pm +1 -1
  130. package/bin/exiftool_files/lib/Image/ExifTool/PCX.pm +1 -1
  131. package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +49 -18
  132. package/bin/exiftool_files/lib/Image/ExifTool/PGF.pm +1 -1
  133. package/bin/exiftool_files/lib/Image/ExifTool/PICT.pm +1 -1
  134. package/bin/exiftool_files/lib/Image/ExifTool/PLIST.pm +4 -4
  135. package/bin/exiftool_files/lib/Image/ExifTool/PLUS.pm +1 -1
  136. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +20 -8
  137. package/bin/exiftool_files/lib/Image/ExifTool/PPM.pm +12 -3
  138. package/bin/exiftool_files/lib/Image/ExifTool/PSP.pm +1 -1
  139. package/bin/exiftool_files/lib/Image/ExifTool/Palm.pm +1 -1
  140. package/bin/exiftool_files/lib/Image/ExifTool/Panasonic.pm +27 -3
  141. package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +1 -1
  142. package/bin/exiftool_files/lib/Image/ExifTool/Parrot.pm +1 -1
  143. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +1 -1
  144. package/bin/exiftool_files/lib/Image/ExifTool/PhaseOne.pm +4 -4
  145. package/bin/exiftool_files/lib/Image/ExifTool/PhotoCD.pm +1 -1
  146. package/bin/exiftool_files/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  147. package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +65 -4
  148. package/bin/exiftool_files/lib/Image/ExifTool/PostScript.pm +1 -1
  149. package/bin/exiftool_files/lib/Image/ExifTool/PrintIM.pm +1 -1
  150. package/bin/exiftool_files/lib/Image/ExifTool/Protobuf.pm +270 -0
  151. package/bin/exiftool_files/lib/Image/ExifTool/Qualcomm.pm +1 -1
  152. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +326 -88
  153. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +199 -195
  154. package/bin/exiftool_files/lib/Image/ExifTool/README +12 -2
  155. package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +21 -6
  156. package/bin/exiftool_files/lib/Image/ExifTool/RSRC.pm +1 -1
  157. package/bin/exiftool_files/lib/Image/ExifTool/RTF.pm +2 -2
  158. package/bin/exiftool_files/lib/Image/ExifTool/Radiance.pm +1 -1
  159. package/bin/exiftool_files/lib/Image/ExifTool/Rawzor.pm +1 -1
  160. package/bin/exiftool_files/lib/Image/ExifTool/Real.pm +1 -1
  161. package/bin/exiftool_files/lib/Image/ExifTool/Reconyx.pm +1 -1
  162. package/bin/exiftool_files/lib/Image/ExifTool/Red.pm +1 -1
  163. package/bin/exiftool_files/lib/Image/ExifTool/Ricoh.pm +4 -4
  164. package/bin/exiftool_files/lib/Image/ExifTool/Samsung.pm +2 -2
  165. package/bin/exiftool_files/lib/Image/ExifTool/Sanyo.pm +1 -1
  166. package/bin/exiftool_files/lib/Image/ExifTool/Scalado.pm +1 -1
  167. package/bin/exiftool_files/lib/Image/ExifTool/Shift.pl +1 -1
  168. package/bin/exiftool_files/lib/Image/ExifTool/Shortcuts.pm +1 -1
  169. package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +1 -1
  170. package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +1 -1
  171. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +5 -4
  172. package/bin/exiftool_files/lib/Image/ExifTool/SonyIDC.pm +1 -1
  173. package/bin/exiftool_files/lib/Image/ExifTool/Stim.pm +1 -1
  174. package/bin/exiftool_files/lib/Image/ExifTool/TagInfoXML.pm +6 -5
  175. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +7023 -6968
  176. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +445 -29
  177. package/bin/exiftool_files/lib/Image/ExifTool/Text.pm +4 -3
  178. package/bin/exiftool_files/lib/Image/ExifTool/Theora.pm +1 -1
  179. package/bin/exiftool_files/lib/Image/ExifTool/Torrent.pm +3 -3
  180. package/bin/exiftool_files/lib/Image/ExifTool/Unknown.pm +1 -1
  181. package/bin/exiftool_files/lib/Image/ExifTool/VCard.pm +3 -3
  182. package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +6 -6
  183. package/bin/exiftool_files/lib/Image/ExifTool/Vivo.pm +124 -0
  184. package/bin/exiftool_files/lib/Image/ExifTool/Vorbis.pm +1 -1
  185. package/bin/exiftool_files/lib/Image/ExifTool/WPG.pm +1 -1
  186. package/bin/exiftool_files/lib/Image/ExifTool/WTV.pm +1 -1
  187. package/bin/exiftool_files/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  188. package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +3 -3
  189. package/bin/exiftool_files/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  190. package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +1 -1
  191. package/bin/exiftool_files/lib/Image/ExifTool/WritePNG.pl +1 -1
  192. package/bin/exiftool_files/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  193. package/bin/exiftool_files/lib/Image/ExifTool/WritePostScript.pl +1 -1
  194. package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +166 -79
  195. package/bin/exiftool_files/lib/Image/ExifTool/WriteRIFF.pl +17 -6
  196. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +3 -3
  197. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +89 -96
  198. package/bin/exiftool_files/lib/Image/ExifTool/XISF.pm +1 -1
  199. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +28 -13
  200. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +103 -1
  201. package/bin/exiftool_files/lib/Image/ExifTool/XMPStruct.pl +2 -3
  202. package/bin/exiftool_files/lib/Image/ExifTool/ZIP.pm +2 -2
  203. package/bin/exiftool_files/lib/Image/ExifTool/ZISRAW.pm +1 -1
  204. package/bin/exiftool_files/lib/Image/ExifTool/iWork.pm +1 -1
  205. package/bin/exiftool_files/lib/Image/ExifTool.pm +335 -163
  206. package/bin/exiftool_files/lib/Image/ExifTool.pod +119 -73
  207. package/bin/exiftool_files/windows_exiftool.txt +96 -51
  208. package/package.json +8 -8
package/bin/exiftool.exe CHANGED
Binary file
@@ -11,7 +11,7 @@ use strict;
11
11
  use warnings;
12
12
  require 5.004;
13
13
 
14
- my $version = '13.00';
14
+ my $version = '13.16';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  my $exePath;
@@ -54,6 +54,7 @@ sub AddSetTagsFile($;$);
54
54
  sub Warning($$);
55
55
  sub DoSetFromFile($$$);
56
56
  sub CleanFilename($);
57
+ sub HasWildcards($);
57
58
  sub SetWindowTitle($);
58
59
  sub ProcessFiles($;$);
59
60
  sub ScanDir($$;$);
@@ -609,6 +610,10 @@ if (@Image::ExifTool::UserDefined::Arguments) {
609
610
  unshift @ARGV, @Image::ExifTool::UserDefined::Arguments;
610
611
  }
611
612
 
613
+ if ($version ne $Image::ExifTool::VERSION) {
614
+ Warn "Application version $version does not match Image::ExifTool library version $Image::ExifTool::VERSION\n";
615
+ }
616
+
612
617
  # parse command-line options in 2 passes...
613
618
  # pass 1: set all of our ExifTool options
614
619
  # pass 2: print all of our help and informational output (-list, -ver, etc)
@@ -649,7 +654,7 @@ for (;;) {
649
654
  }
650
655
  # require MWG module if used in any argument
651
656
  # (note: doesn't cover the -p option because these tags will be parsed on the 2nd pass)
652
- $useMWG = 1 if not $useMWG and grep /^mwg:/i, @tags, @requestTags;
657
+ $useMWG = 1 if not $useMWG and grep /^([--_0-9A-Z]+:)*1?mwg:/i, @tags, @requestTags;
653
658
  if ($useMWG) {
654
659
  require Image::ExifTool::MWG;
655
660
  Image::ExifTool::MWG::Load();
@@ -869,7 +874,7 @@ for (;;) {
869
874
  } else {
870
875
  print "Available API Options:\n";
871
876
  my $availableOptions = Image::ExifTool::AvailableOptions();
872
- printf(" %-17s - %s\n", $$_[0], $$_[2]) foreach @$availableOptions;
877
+ $$_[3] or printf(" %-17s - %s\n", $$_[0], $$_[2]) foreach @$availableOptions;
873
878
  $helped = 1;
874
879
  }
875
880
  next;
@@ -1052,7 +1057,7 @@ for (;;) {
1052
1057
  }
1053
1058
  $trkfile or Error("Expecting file name for -geotag option\n"), $badCmd=1, next;
1054
1059
  # allow wildcards in filename
1055
- if ($trkfile =~ /[*?]/) {
1060
+ if (HasWildcards($trkfile)) {
1056
1061
  # CORE::glob() splits on white space, so use File::Glob if possible
1057
1062
  my @trks;
1058
1063
  if ($^O eq 'MSWin32' and eval { require Win32::FindFile }) {
@@ -1101,7 +1106,7 @@ for (;;) {
1101
1106
  # prevent processing file unnecessarily for simple case of failed '$ok' or 'not $ok'
1102
1107
  $cond =~ /^\s*(not\s*)\$ok\s*$/i and ($1 xor $rtnValPrev) and $failCondition=1;
1103
1108
  # add to list of requested tags
1104
- push @requestTags, $cond =~ /\$\{?((?:[-\w]+:)*[-\w?*]+)/g;
1109
+ push @requestTags, $cond =~ /\$\{?((?:[-_0-9A-Z]+:)*[-_0-9A-Z?*]+)/ig;
1105
1110
  push @condition, $cond;
1106
1111
  next;
1107
1112
  }
@@ -1189,7 +1194,7 @@ for (;;) {
1189
1194
  if ($pass) {
1190
1195
  LoadPrintFormat($fmt, $1 || $binaryOutput);
1191
1196
  # load MWG module now if necessary
1192
- if (not $useMWG and grep /^mwg:/i, @requestTags) {
1197
+ if (not $useMWG and grep /^([-_0-9A-Z]+:)*1?mwg:/i, @requestTags) {
1193
1198
  $useMWG = 1;
1194
1199
  require Image::ExifTool::MWG;
1195
1200
  Image::ExifTool::MWG::Load();
@@ -1388,11 +1393,11 @@ for (;;) {
1388
1393
  push @newValues, { SaveCount => ++$saveCount };
1389
1394
  }
1390
1395
  push @newValues, $_;
1391
- if (/^mwg:/i) {
1396
+ if (/^([-_0-9A-Z]+:)*1?mwg:/i) {
1392
1397
  $useMWG = 1;
1393
- } elsif (/^([-\w]+:)*(filename|directory|testname)\b/i) {
1398
+ } elsif (/^([-_0-9A-Z]+:)*(filename|directory|testname)\b/i) {
1394
1399
  $doSetFileName = 1;
1395
- } elsif (/^([-\w]+:)*(geotag|geotime|geosync|geolocate)\b/i) {
1400
+ } elsif (/^([-_0-9A-Z]+:)*(geotag|geotime|geosync|geolocate)\b/i) {
1396
1401
  if (lc $2 eq 'geotime') {
1397
1402
  $addGeotime = '';
1398
1403
  } else {
@@ -1410,25 +1415,23 @@ for (;;) {
1410
1415
  if ($setTagsFile) {
1411
1416
  push @{$setTags{$setTagsFile}}, $_;
1412
1417
  if ($1 eq '>') {
1413
- $useMWG = 1 if /^(.*>\s*)?mwg:/si;
1418
+ $useMWG = 1 if /^(.*>\s*)?([-_0-9A-Z]+:)*1?mwg:/si;
1414
1419
  if (/\b(filename|directory|testname)#?$/i) {
1415
1420
  $doSetFileName = 1;
1416
1421
  } elsif (/\bgeotime#?$/i) {
1417
1422
  $addGeotime = '';
1418
1423
  }
1419
1424
  } else {
1420
- $useMWG = 1 if /^([^<]+<\s*(.*\$\{?)?)?mwg:/si;
1421
- if (/^([-\w]+:)*(filename|directory|testname)\b/i) {
1425
+ $useMWG = 1 if /^([^<]+<\s*(.*\$\{?)?)?([-_0-9A-Z]+:)*1?mwg:/si;
1426
+ if (/^([-_0-9A-Z]+:)*(filename|directory|testname)\b/i) {
1422
1427
  $doSetFileName = 1;
1423
- } elsif (/^([-\w]+:)*geotime\b/i) {
1428
+ } elsif (/^([-_0-9A-Z]+:)*geotime\b/i) {
1424
1429
  $addGeotime = '';
1425
1430
  }
1426
1431
  }
1427
1432
  } else {
1428
1433
  my $lst = s/^-// ? \@exclude : \@tags;
1429
- unless (/^([-\w*]+:)*([-\w*?]+)#?$/) {
1430
- Warn(qq(Invalid TAG name: "$_"\n));
1431
- }
1434
+ Warn(qq(Invalid TAG name: "$_"\n)) unless /^([-_0-9A-Z*]+:)*([-_0-9A-Z*?]+)#?$/i;
1432
1435
  push @$lst, $_; # (push everything for backward compatibility)
1433
1436
  }
1434
1437
  }
@@ -1438,7 +1441,7 @@ for (;;) {
1438
1441
  push @nextPass, $_;
1439
1442
  next;
1440
1443
  }
1441
- if ($doGlob and /[*?]/) {
1444
+ if ($doGlob and HasWildcards($_)) {
1442
1445
  if ($^O eq 'MSWin32' and eval { require Win32::FindFile }) {
1443
1446
  push @files, FindFileWindows($mt, $_);
1444
1447
  } else {
@@ -1519,6 +1522,7 @@ if (($tagOut or defined $diff) and ($csv or $json or %printFmt or $tabFormat or
1519
1522
  }
1520
1523
 
1521
1524
  if ($csv and $csv eq 'CSV' and not $isWriting) {
1525
+ undef $json; # (not compatible)
1522
1526
  if ($textOut) {
1523
1527
  Warn "Sorry, -w may not be combined with -csv\n";
1524
1528
  $rtnVal = 1;
@@ -1754,9 +1758,11 @@ if (@newValues) {
1754
1758
  $wrn and Warning($mt, $wrn);
1755
1759
  }
1756
1760
  # exclude specified tags
1757
- foreach (@exclude) {
1758
- $mt->SetNewValue($_, undef, Replace => 2);
1759
- $needSave = 1;
1761
+ unless ($csv) {
1762
+ foreach (@exclude) {
1763
+ $mt->SetNewValue($_, undef, Replace => 2);
1764
+ $needSave = 1;
1765
+ }
1760
1766
  }
1761
1767
  unless ($isWriting or $outOpt or @tags) {
1762
1768
  Warn "Nothing to do.\n";
@@ -1772,7 +1778,7 @@ if ($isWriting) {
1772
1778
  if (defined $diff) {
1773
1779
  Error "Can't use -diff option when writing tags\n";
1774
1780
  next;
1775
- } elsif (@tags and not $outOpt) {
1781
+ } elsif (@tags and not $outOpt and not $csv) {
1776
1782
  my ($tg, $s) = @tags > 1 ? ("$tags[0] ...", 's') : ($tags[0], '');
1777
1783
  Warn "Ignored superfluous tag name$s or invalid option$s: -$tg\n";
1778
1784
  }
@@ -1799,7 +1805,7 @@ if ($binaryOutput) {
1799
1805
  }
1800
1806
 
1801
1807
  # sort by groups to look nicer depending on options
1802
- if (defined $showGroup and not (@tags and $allGroup) and ($sortOpt or not defined $sortOpt)) {
1808
+ if (defined $showGroup and not (@tags and ($allGroup or $csv)) and ($sortOpt or not defined $sortOpt)) {
1803
1809
  $mt->Options(Sort => "Group$showGroup");
1804
1810
  }
1805
1811
 
@@ -1837,7 +1843,7 @@ $altEnc = $mt->Options('Charset');
1837
1843
  undef $altEnc if $altEnc eq 'UTF8';
1838
1844
 
1839
1845
  # set flag to fix description lengths if necessary
1840
- if (not $altEnc and $mt->Options('Lang') ne 'en' and eval { require Encode }) {
1846
+ if (not $altEnc and $mt->Options('Lang') ne 'en') {
1841
1847
  # (note that Unicode::GCString is part of the Unicode::LineBreak package)
1842
1848
  $fixLen = eval { require Unicode::GCString } ? 2 : 1;
1843
1849
  }
@@ -1909,7 +1915,7 @@ if (@dbKeys) {
1909
1915
  print $vout "Imported entry for '${_}' (full path: '${absPath}')\n";
1910
1916
  }
1911
1917
  } elsif ($verbose and $verbose > 1) {
1912
- print $vout "Imported entry for '${_}' (non-existent file)\n";
1918
+ print $vout "Imported entry for '${_}' (no full path)\n";
1913
1919
  }
1914
1920
  }
1915
1921
  }
@@ -2163,7 +2169,11 @@ sub GetImageInfo($$)
2163
2169
  }
2164
2170
  # can't make use of $info if verbose because we must reprocess
2165
2171
  # the file anyway to generate the verbose output
2166
- undef $info if $verbose or defined $fastCondition or defined $diff;
2172
+ # (also if writing just to avoid double-incrementing FileSequence)
2173
+ if ($isWriting or $verbose or defined $fastCondition or defined $diff) {
2174
+ undef $info;
2175
+ --$$et{FILE_SEQUENCE};
2176
+ }
2167
2177
  } elsif ($file =~ s/^(\@JSON:)(.*)/$1/) {
2168
2178
  # read JSON file from command line
2169
2179
  my $dat = $2;
@@ -2283,6 +2293,10 @@ sub GetImageInfo($$)
2283
2293
  $et->Options(Duplicates => 1, Sort => "Group$showGroup", Verbose => 0);
2284
2294
  $et2 = Image::ExifTool->new;
2285
2295
  $et2->Options(%{$$et{OPTIONS}});
2296
+ # must set list options specifically because they may have been
2297
+ # set incorrectly from deprecated List settings
2298
+ $et2->Options(ListSep => $$et{OPTIONS}{ListSep});
2299
+ $et2->Options(ListSplit => $$et{OPTIONS}{ListSplit});
2286
2300
  @found2 = @foundTags;
2287
2301
  $info2 = $et2->ImageInfo($file2, \@found2);
2288
2302
  } else {
@@ -2339,14 +2353,15 @@ sub GetImageInfo($$)
2339
2353
 
2340
2354
  # print differences if requested
2341
2355
  if (defined $diff) {
2342
- my (%done2, $wasDiff, @diffs, @groupTags2);
2356
+ my (%done, %done2, $wasDiff, @diffs, @groupTags2);
2343
2357
  my $v = $verbose || 0;
2344
2358
  print $fp "======== diff < $file > $file2\n";
2345
2359
  my ($g2, $same) = (0, 0); # start with $g2 false, but not equal to '' to avoid infinite loop
2346
2360
  for (;;) {
2361
+ my ($g, $tag2, $i, $key, @dupl, $val2, $t2, $equal, %used);
2347
2362
  my $tag = shift @foundTags;
2348
- my ($g, $tag2);
2349
2363
  if (defined $tag) {
2364
+ $done{$tag} = 1;
2350
2365
  $g = $et->GetGroup($tag, $showGroup);
2351
2366
  } else {
2352
2367
  for (;;) {
@@ -2356,7 +2371,6 @@ sub GetImageInfo($$)
2356
2371
  }
2357
2372
  }
2358
2373
  if ($g ne $g2) {
2359
- my $t2;
2360
2374
  # add any outstanding tags from diff file not yet handled in previous group ($g2)
2361
2375
  foreach $t2 (@groupTags2) {
2362
2376
  next if $done2{$t2};
@@ -2387,6 +2401,7 @@ sub GetImageInfo($$)
2387
2401
  ($g2, $same) = ($g, 0);
2388
2402
  # build list of all tags in the new group of the diff file
2389
2403
  @groupTags2 = ();
2404
+ push @groupTags2, $tag2 if defined $tag2;
2390
2405
  foreach $t2 (@found2) {
2391
2406
  $done2{$t2} or $g ne $et2->GetGroup($t2, $showGroup) or push @groupTags2, $t2;
2392
2407
  }
@@ -2395,33 +2410,50 @@ sub GetImageInfo($$)
2395
2410
  my $val = $et->GetValue($tag);
2396
2411
  next unless defined $val; # (just in case)
2397
2412
  my $name = GetTagName($tag);
2398
- # get matching tag key from diff file
2413
+ my $desc = $outFormat < 1 ? $et->GetDescription($tag) : $name;
2414
+ # get matching tag key(s) from diff file
2399
2415
  my @tags2 = grep /^$name( |$)/, @groupTags2;
2400
- $name = $et->GetDescription($tag) if $outFormat < 1;
2401
- my ($val2, $t2);
2402
- foreach $t2 (@tags2) {
2416
+ T2: foreach $t2 (@tags2) {
2403
2417
  next if $done2{$t2};
2404
2418
  $tag2 = $t2;
2405
2419
  $val2 = $et2->GetValue($t2);
2420
+ next unless defined $val2;
2421
+ IsEqual($val, $val2) and $equal = 1, last;
2422
+ # look ahead for upcoming duplicate tags in this group to see
2423
+ # if any would later match this value (and skip those for now)
2424
+ if ($$et{DUPL_TAG}{$name} and not @dupl) {
2425
+ for ($i=0, $key=$name; $i<=$$et{DUPL_TAG}{$name}; ++$i, $key="$name ($i)") {
2426
+ push @dupl, $key unless $done{$key} or $g ne $et->GetGroup($key, $showGroup);
2427
+ }
2428
+ @dupl = sort { $$et{FILE_ORDER}{$a} <=> $$et{FILE_ORDER}{$b} } @dupl if @dupl > 1;
2429
+ }
2430
+ foreach (@dupl) {
2431
+ next if $used{$_};
2432
+ my $v = $et->GetValue($_);
2433
+ next unless defined($v) and IsEqual($v, $val2);
2434
+ $used{$_} = 1; # would match this upcoming tag
2435
+ undef($tag2); undef($val2);
2436
+ next T2;
2437
+ }
2406
2438
  last;
2407
2439
  }
2408
- if (defined $val2 and IsEqual($val, $val2)) {
2440
+ if ($equal) {
2409
2441
  ++$same;
2410
2442
  } else {
2411
- my $len = LengthUTF8($name);
2443
+ my $len = LengthUTF8($desc);
2412
2444
  my $pad = $outFormat < 2 ? ' ' x ($len < 32 ? 32 - $len : 0) : '';
2413
2445
  if ($allGroup) {
2414
2446
  my $grp = "[$g]";
2415
2447
  $grp .= ' ' x (15 - length($grp)) if length($grp) < 15 and $outFormat < 2;
2416
- push @diffs, sprintf "< %s %s%s: %s\n", $grp, $name, $pad, Printable($val);
2448
+ push @diffs, sprintf "< %s %s%s: %s\n", $grp, $desc, $pad, Printable($val);
2417
2449
  if (defined $val2) {
2418
- $grp = ' ' x length($grp), $name = ' ' x $len if $v < 3;
2419
- push @diffs, sprintf "> %s %s%s: %s\n", $grp, $name, $pad, Printable($val2);
2450
+ $grp = ' ' x length($grp), $desc = ' ' x $len if $v < 3;
2451
+ push @diffs, sprintf "> %s %s%s: %s\n", $grp, $desc, $pad, Printable($val2);
2420
2452
  }
2421
2453
  } else {
2422
- push @diffs, sprintf "< %s%s: %s\n", $name, $pad, Printable($val);
2423
- $name = ' ' x $len if $v < 3;
2424
- push @diffs, sprintf "> %s%s %s\n", $name, $pad, Printable($val2) if defined $val2;
2454
+ push @diffs, sprintf "< %s%s: %s\n", $desc, $pad, Printable($val);
2455
+ $desc = ' ' x $len if $v < 3;
2456
+ push @diffs, sprintf "> %s%s: %s\n", $desc, $pad, Printable($val2) if defined $val2;
2425
2457
  }
2426
2458
  }
2427
2459
  $done2{$tag2} = 1 if defined $tag2;
@@ -2618,7 +2650,13 @@ TAG: foreach $tag (@foundTags) {
2618
2650
  # (note that the tag key may look like "TAG #(1)" when the "#" feature is used)
2619
2651
  next if $noDups and $tag =~ /^(.*?) ?\(/ and defined $$info{$1} and
2620
2652
  $group eq $et->GetGroup($1, $showGroup);
2621
- $group = 'Unknown' if not $group and ($xml or $json or $csv);
2653
+ if (not $group and ($xml or $json or $csv)) {
2654
+ if ($showGroup !~ /\b4\b/) {
2655
+ $group = 'Unknown';
2656
+ } elsif ($json and not $allGroup) {
2657
+ $group = 'Copy0';
2658
+ }
2659
+ }
2622
2660
  if ($fp and not ($allGroup or $csv)) {
2623
2661
  if ($lastGroup ne $group) {
2624
2662
  if ($html) {
@@ -2840,6 +2878,17 @@ TAG: foreach $tag (@foundTags) {
2840
2878
  my $num = $et->GetValue($tag, 'ValueConv');
2841
2879
  $$val{num} = $num if defined $num and not IsEqual($num, $$val{val});
2842
2880
  }
2881
+ my $ex = $$et{TAG_EXTRA}{$tag};
2882
+ $$val{'fmt'} = $$ex{G6} if defined $$ex{G6};
2883
+ if (defined $$ex{BinVal}) {
2884
+ my $max = ($$et{OPTIONS}{LimitLongValues} - 5) / 3;
2885
+ if ($max >= 0 and length($$ex{BinVal}) > int($max)) {
2886
+ $max = int $max;
2887
+ $$val{'hex'} = join ' ', unpack("(H2)$max", $$ex{BinVal}), '[...]';
2888
+ } else {
2889
+ $$val{'hex'} = join ' ', unpack '(H2)*', $$ex{BinVal};
2890
+ }
2891
+ }
2843
2892
  }
2844
2893
  }
2845
2894
  FormatJSON($fp, $val, $ind, $quote);
@@ -3117,7 +3166,7 @@ sub SetImageInfo($$$)
3117
3166
  next;
3118
3167
  } elsif (ref $dyFile eq 'SCALAR') {
3119
3168
  # set new values from CSV or JSON database
3120
- my ($f, $found, $tag);
3169
+ my ($f, $found, $csvTag, $tryTag, $tg);
3121
3170
  undef $evalWarning;
3122
3171
  local $SIG{'__WARN__'} = sub { $evalWarning = $_[0] };
3123
3172
  # force UTF-8 if the database was JSON
@@ -3134,10 +3183,44 @@ sub SetImageInfo($$$)
3134
3183
  next unless defined $absPath and $csvInfo = $database{$absPath};
3135
3184
  }
3136
3185
  $found = 1;
3137
- $verbose and print $vout "Setting new values from $csv database\n";
3138
- foreach $tag (OrderedKeys($csvInfo)) {
3139
- next if $tag =~ /\b(SourceFile|Directory|FileName)$/i; # don't write these
3140
- my ($rtn, $wrn) = $et->SetNewValue($tag, $$csvInfo{$tag},
3186
+ if ($verbose) {
3187
+ print $vout "Setting new values from $csv database\n";
3188
+ print $vout 'Including tags: ',join(' ',@tags),"\n" if @tags;
3189
+ print $vout 'Excluding tags: ',join(' ',@exclude),"\n" if @exclude;
3190
+ }
3191
+ my @tryTags = (@exclude, @tags); # (exclude first because it takes priority)
3192
+ foreach (@tryTags) {
3193
+ tr/-0-9a-zA-Z_:#?*//dc; # remove illegal characters
3194
+ s/(^|:)(all:)+/$1/ig; # remove 'all' group names
3195
+ s/(^|:)all(#?)$/$1*$2/i; # convert 'all' tag name to '*'
3196
+ tr/?/./; s/\*/.*/g; # convert wildcards for regex
3197
+ }
3198
+ foreach $csvTag (OrderedKeys($csvInfo)) {
3199
+ # don't write SourceFile, Directory or FileName
3200
+ next if $csvTag =~ /^([-_0-9A-Z]+:)*(SourceFile|Directory|FileName)$/i;
3201
+ if (@tryTags) {
3202
+ my ($i, $tryGrp, $matched);
3203
+ TryMatch: for ($i=0; $i<@tryTags; ++$i) {
3204
+ $tryTag = $tryTags[$i];
3205
+ if ($tryTag =~ /:/) {
3206
+ next unless $csvTag =~ /:/; # db entry must also specify group
3207
+ my @csvGrps = split /:/, $csvTag;
3208
+ my @tryGrps = split /:/, $tryTag;
3209
+ my $tryName = pop @tryGrps;
3210
+ next unless pop(@csvGrps) =~ /^$tryName$/i; # tag name must match
3211
+ foreach $tryGrp (@tryGrps) {
3212
+ # each specified group name must match db entry
3213
+ next TryMatch unless grep /^$tryGrp$/i, @csvGrps;
3214
+ }
3215
+ $matched = 1;
3216
+ last;
3217
+ }
3218
+ # no group specified, so match by tag name only
3219
+ $csvTag =~ /^([-_0-9A-Z]+:)*$tryTag$/i and $matched = 1, last;
3220
+ }
3221
+ next if $matched ? $i < @exclude : @tags;
3222
+ }
3223
+ my ($rtn, $wrn) = $et->SetNewValue($csvTag, $$csvInfo{$csvTag},
3141
3224
  Protected => 1, AddValue => $csvAdd,
3142
3225
  ProtectSaved => $csvSaveCount);
3143
3226
  $wrn and Warn "$wrn\n" if $verbose;
@@ -3604,7 +3687,7 @@ sub EscapeJSON($;$)
3604
3687
  if ($json < 2) { # JSON
3605
3688
  $str =~ tr/\0//d; # remove all nulls
3606
3689
  # escape other control characters with \u
3607
- $str =~ s/([\0-\x1f])/sprintf("\\u%.4X",ord $1)/sge;
3690
+ $str =~ s/([\0-\x1f\x7f])/sprintf("\\u%.4X",ord $1)/sge;
3608
3691
  # JSON strings must be valid UTF8
3609
3692
  Image::ExifTool::XMP::FixUTF8(\$str) unless $altEnc;
3610
3693
  } else { # PHP
@@ -3612,7 +3695,7 @@ sub EscapeJSON($;$)
3612
3695
  # must escape "$" too for PHP
3613
3696
  $str =~ s/\$/\\\$/sg;
3614
3697
  # escape other control characters with \x
3615
- $str =~ s/([\0-\x1f])/sprintf("\\x%.2X",ord $1)/sge;
3698
+ $str =~ s/([\0-\x1f\x7f])/sprintf("\\x%.2X",ord $1)/sge;
3616
3699
  }
3617
3700
  return '"' . $str . '"'; # return the quoted string
3618
3701
  }
@@ -3835,17 +3918,23 @@ sub Printable($)
3835
3918
  sub LengthUTF8($)
3836
3919
  {
3837
3920
  my $str = shift;
3921
+ return length $str unless $fixLen;
3922
+ local $SIG{'__WARN__'} = sub { };
3923
+ if (not $$mt{OPTIONS}{EncodeHangs} and eval { require Encode }) {
3924
+ $str = Encode::decode_utf8($str);
3925
+ } else {
3926
+ $str = pack('U0C*', unpack 'C*', $str);
3927
+ }
3838
3928
  my $len;
3839
- if (not $fixLen) {
3929
+ if ($fixLen == 1) {
3840
3930
  $len = length $str;
3841
- } elsif ($fixLen == 1) {
3842
- $len = length Encode::decode_utf8($str);
3843
3931
  } else {
3844
- my $gcstr = eval { Unicode::GCString->new(Encode::decode_utf8($str)) };
3932
+ my $gcstr = eval { Unicode::GCString->new($str) };
3845
3933
  if ($gcstr) {
3846
3934
  $len = $gcstr->columns;
3847
3935
  } else {
3848
- $len = length Encode::decode_utf8($str);
3936
+ $len = length $str;
3937
+ delete $SIG{'__WARN__'};
3849
3938
  Warning($mt, 'Unicode::GCString problem. Columns may be misaligned');
3850
3939
  $fixLen = 1;
3851
3940
  }
@@ -3948,6 +4037,19 @@ sub CleanFilename($)
3948
4037
  $_[0] =~ tr/\\/\// if Image::ExifTool::IsPC();
3949
4038
  }
3950
4039
 
4040
+ #------------------------------------------------------------------------------
4041
+ # Does path name contain wildcards
4042
+ # Inputs: 0) path name
4043
+ # Returns: true if path contains wildcards
4044
+ sub HasWildcards($)
4045
+ {
4046
+ my $path = shift;
4047
+
4048
+ # if this is a Windows path with the long path prefix, then wildcards are not supported
4049
+ return 0 if $^O eq 'MSWin32' and $path =~ m{^[\\/]{2}\?[\\/]};
4050
+ return $path =~ /[*?]/;
4051
+ }
4052
+
3951
4053
  #------------------------------------------------------------------------------
3952
4054
  # Check for valid UTF-8 of a file name
3953
4055
  # Inputs: 0) string, 1) original encoding
@@ -4068,7 +4170,7 @@ sub ScanDir($$;$)
4068
4170
  return if $ignore{$dir};
4069
4171
  # use Win32::FindFile on Windows if available
4070
4172
  # (ReadDir will croak if there is a wildcard, so check for this)
4071
- if ($^O eq 'MSWin32' and $dir !~ /[*?]/) {
4173
+ if ($^O eq 'MSWin32' and not HasWildcards($dir)) {
4072
4174
  undef $evalWarning;
4073
4175
  local $SIG{'__WARN__'} = sub { $evalWarning = $_[0] };;
4074
4176
  if (CheckUTF8($dir, $enc) >= 0) {
@@ -4112,11 +4214,12 @@ sub ScanDir($$;$)
4112
4214
  }
4113
4215
  $dir =~ /\/$/ or $dir .= '/'; # make sure directory name ends with '/'
4114
4216
  foreach $file (@fileList) {
4217
+ next if $file eq '.' or $file eq '..';
4115
4218
  my $path = "$dir$file";
4116
4219
  if ($et->IsDirectory($path)) {
4117
4220
  next unless $recurse;
4118
4221
  # ignore directories starting with "." by default
4119
- next if $file =~ /^\./ and ($recurse == 1 or $file eq '.' or $file eq '..');
4222
+ next if $file =~ /^\./ and $recurse == 1;
4120
4223
  next if $ignore{$file} or ($ignore{SYMLINKS} and -l $path);
4121
4224
  ScanDir($et, $path, $list);
4122
4225
  last if $end;
@@ -4194,7 +4297,7 @@ sub FindFileWindows($$)
4194
4297
  $wildfile = $et->Decode($wildfile, $enc, undef, 'UTF8') if $enc and $enc ne 'UTF8';
4195
4298
  $wildfile =~ tr/\\/\//; # use forward slashes
4196
4299
  my ($dir, $wildname) = ($wildfile =~ m{(.*[:/])(.*)}) ? ($1, $2) : ('', $wildfile);
4197
- if ($dir =~ /[*?]/) {
4300
+ if (HasWildcards($dir)) {
4198
4301
  Warn "Wildcards don't work in the directory specification\n";
4199
4302
  return ();
4200
4303
  }
@@ -4264,14 +4367,15 @@ sub AbsPath($)
4264
4367
  {
4265
4368
  my $file = shift;
4266
4369
  my $path;
4267
- if (defined $file and eval { require Cwd }) {
4268
- $path = eval { Cwd::abs_path($file) };
4269
- # make the delimiters and case consistent
4270
- # (abs_path is very inconsistent about what it returns in Windows)
4271
- if (defined $path and Image::ExifTool::IsPC()) {
4272
- $path =~ tr/\\/\//;
4273
- $path = lc $path;
4370
+ if (defined $file) {
4371
+ return undef if $file eq '*'; # (CSV SourceFile may be '*' -- no absolute path for that)
4372
+ if ($^O eq 'MSWin32' and $mt->Options('WindowsLongPath')) {
4373
+ $path = $mt->WindowsLongPath($file);
4374
+ } elsif (eval { require Cwd }) {
4375
+ local $SIG{'__WARN__'} = sub { };
4376
+ $path = eval { Cwd::abs_path($file) };
4274
4377
  }
4378
+ $path =~ tr/\\/\// if $^O eq 'MSWin32' and defined $path; # use forward slashes
4275
4379
  }
4276
4380
  return $path;
4277
4381
  }
@@ -4306,7 +4410,7 @@ sub AddPrintFormat($)
4306
4410
  $printFmt{$type} or $printFmt{$type} = [ ];
4307
4411
  push @{$printFmt{$type}}, $expr;
4308
4412
  # add to list of requested tags
4309
- push @requestTags, $expr =~ /\$\{?((?:[-\w]+:)*[-\w?*]+)/g;
4413
+ push @requestTags, $expr =~ /\$\{?((?:[-_0-9A-Z]+:)*[-_0-9A-Z?*]+)/ig;
4310
4414
  $printFmt{SetTags} = 1 if $expr =~ /\bSetTags\b/;
4311
4415
  }
4312
4416
 
@@ -4661,7 +4765,7 @@ sub FilterArgfileLine($)
4661
4765
  $arg =~ s/^\s+//; # remove leading white space
4662
4766
  $arg =~ s/[\x0d\x0a]+$//s; # remove trailing newline
4663
4767
  # remove white space before, and single space after '=', '+=', '-=' or '<='
4664
- $arg =~ s/^(-[-:\w]+#?)\s*([-+<]?=) ?/$1$2/;
4768
+ $arg =~ s/^(-[-_0-9A-Z:]+#?)\s*([-+<]?=) ?/$1$2/i;
4665
4769
  return undef if $arg eq '';
4666
4770
  }
4667
4771
  return $arg;
@@ -29,7 +29,7 @@
29
29
  # Sets internal ERROR member from $! if there is an error reading
30
30
  # the file.
31
31
  #
32
- # Legal: Copyright (c) 2003-2024, Phil Harvey (philharvey66 at gmail.com)
32
+ # Legal: Copyright (c) 2003-2025, Phil Harvey (philharvey66 at gmail.com)
33
33
  # This library is free software; you can redistribute it and/or
34
34
  # modify it under the same terms as Perl itself.
35
35
  #------------------------------------------------------------------------------
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Description: Buffer to support random access reading of sequential file
5
5
  #
6
- # Legal: Copyright (c) 2003-2024, Phil Harvey (philharvey66 at gmail.com)
6
+ # Legal: Copyright (c) 2003-2025, Phil Harvey (philharvey66 at gmail.com)
7
7
  # This library is free software; you can redistribute it and/or
8
8
  # modify it under the same terms as Perl itself.
9
9
  #------------------------------------------------------------------------------
@@ -236,7 +236,7 @@ the end of file is not allowed.
236
236
 
237
237
  =head1 AUTHOR
238
238
 
239
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
239
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
240
240
 
241
241
  This library is free software; you can redistribute it and/or modify it
242
242
  under the same terms as Perl itself.
@@ -163,7 +163,7 @@ based on unofficial sources which may be incomplete, inaccurate or outdated.
163
163
 
164
164
  =head1 AUTHOR
165
165
 
166
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
166
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
167
167
 
168
168
  This library is free software; you can redistribute it and/or modify it
169
169
  under the same terms as Perl itself.
@@ -477,7 +477,7 @@ main purpose of encryption, so this really can't be considered a bug.
477
477
 
478
478
  =head1 AUTHOR
479
479
 
480
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
480
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
481
481
 
482
482
  This library is free software; you can redistribute it and/or modify it
483
483
  under the same terms as Perl itself.
@@ -14,7 +14,7 @@ use strict;
14
14
  use vars qw($VERSION);
15
15
  use Image::ExifTool qw(:DataAccess :Utils);
16
16
 
17
- $VERSION = '1.09';
17
+ $VERSION = '1.10';
18
18
 
19
19
  sub ProcessAFCP($$);
20
20
 
@@ -63,10 +63,10 @@ for the AFCP specification.
63
63
  #------------------------------------------------------------------------------
64
64
  # Read/write AFCP information in a file
65
65
  # Inputs: 0) ExifTool object reference, 1) dirInfo reference
66
- # (Set 'ScanForAFCP' member in dirInfo to scan from current position for AFCP)
66
+ # (Set 'ScanForTrailer' member in dirInfo to scan from current position for AFCP)
67
67
  # Returns: 1 on success, 0 if this file didn't contain AFCP information
68
68
  # -1 on write error or if the offsets were incorrect on reading
69
- # - updates DataPos to point to actual AFCP start if ScanForAFCP is set
69
+ # - updates DataPos to point to actual AFCP start if ScanForTrailer is set
70
70
  # - updates DirLen to trailer length
71
71
  # - returns Fixup reference in dirInfo hash when writing
72
72
  sub ProcessAFCP($$)
@@ -91,8 +91,8 @@ NoAFCP: for (;;) {
91
91
  $fix = 0;
92
92
  } else {
93
93
  $rtnVal = -1;
94
- # look for start of AXS trailer if 'ScanForAFCP'
95
- last unless $$dirInfo{ScanForAFCP} and $raf->Seek($curPos, 0);
94
+ # look for start of AXS trailer if 'ScanForTrailer'
95
+ last unless $$dirInfo{ScanForTrailer} and $raf->Seek($curPos, 0);
96
96
  my $actualPos = $curPos;
97
97
  # first look for header right at current position
98
98
  for (;;) {
@@ -259,7 +259,7 @@ scanning for AFCP information.
259
259
 
260
260
  =head1 AUTHOR
261
261
 
262
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
262
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
263
263
 
264
264
  This library is free software; you can redistribute it and/or modify it
265
265
  under the same terms as Perl itself.
@@ -231,7 +231,7 @@ sub ProcessAIFF($$)
231
231
  $et->Warn('End of processing at large chunk (LargeFileSupport not enabled)');
232
232
  last;
233
233
  } elsif ($et->Options('LargeFileSupport') eq '2') {
234
- $et->WarnOnce('Skipping large chunk (LargeFileSupport is 2)');
234
+ $et->Warn('Skipping large chunk (LargeFileSupport is 2)');
235
235
  }
236
236
  }
237
237
  if ($tagInfo) {
@@ -291,7 +291,7 @@ information from AIFF (Audio Interchange File Format) audio 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.
@@ -217,7 +217,7 @@ sub ProcessAPE($$)
217
217
  $val = \$buf2;
218
218
  # extract cover art description separately (hackitty hack)
219
219
  if ($tag =~ /^Cover Art/) {
220
- $buf2 =~ s/^([\x20-\x7f]*)\0//;
220
+ $buf2 =~ s/^([\x20-\x7e]*)\0//;
221
221
  if ($1) {
222
222
  my $t = "$tag Desc";
223
223
  my $v = $1;
@@ -263,7 +263,7 @@ Currently doesn't parse MAC header unless it is at the start of the file.
263
263
 
264
264
  =head1 AUTHOR
265
265
 
266
- Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
266
+ Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
267
267
 
268
268
  This library is free software; you can redistribute it and/or modify it
269
269
  under the same terms as Perl itself.