exiftool_vendored 12.72.0 → 12.74.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +42 -0
  3. data/bin/META.json +1 -1
  4. data/bin/META.yml +1 -1
  5. data/bin/README +3 -3
  6. data/bin/exiftool +75 -53
  7. data/bin/lib/File/RandomAccess.pm +32 -6
  8. data/bin/lib/File/RandomAccess.pod +6 -6
  9. data/bin/lib/Image/ExifTool/7Z.pm +3 -3
  10. data/bin/lib/Image/ExifTool/AAC.pm +8 -6
  11. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  12. data/bin/lib/Image/ExifTool/AFCP.pm +3 -3
  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 +3 -3
  22. data/bin/lib/Image/ExifTool/BigTIFF.pm +1 -1
  23. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -7
  24. data/bin/lib/Image/ExifTool/CBOR.pm +1 -1
  25. data/bin/lib/Image/ExifTool/Canon.pm +4 -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 +3 -3
  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 +3 -3
  33. data/bin/lib/Image/ExifTool/DJI.pm +1 -1
  34. data/bin/lib/Image/ExifTool/DNG.pm +5 -5
  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 +1 -1
  40. data/bin/lib/Image/ExifTool/Exif.pm +3 -3
  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 +3 -3
  45. data/bin/lib/Image/ExifTool/Fixup.pm +4 -4
  46. data/bin/lib/Image/ExifTool/Flash.pm +1 -1
  47. data/bin/lib/Image/ExifTool/FlashPix.pm +61 -8
  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 +9 -4
  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/GPS.pm +1 -1
  55. data/bin/lib/Image/ExifTool/GeoTiff.pm +1 -1
  56. data/bin/lib/Image/ExifTool/Geotag.pm +4 -4
  57. data/bin/lib/Image/ExifTool/GoPro.pm +1 -1
  58. data/bin/lib/Image/ExifTool/H264.pm +1 -1
  59. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  60. data/bin/lib/Image/ExifTool/HTML.pm +1 -1
  61. data/bin/lib/Image/ExifTool/HtmlDump.pm +3 -3
  62. data/bin/lib/Image/ExifTool/ICC_Profile.pm +1 -1
  63. data/bin/lib/Image/ExifTool/ICO.pm +1 -1
  64. data/bin/lib/Image/ExifTool/ID3.pm +3 -3
  65. data/bin/lib/Image/ExifTool/IPTC.pm +1 -1
  66. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  67. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  68. data/bin/lib/Image/ExifTool/Import.pm +6 -6
  69. data/bin/lib/Image/ExifTool/InDesign.pm +1 -1
  70. data/bin/lib/Image/ExifTool/InfiRay.pm +1 -1
  71. data/bin/lib/Image/ExifTool/JPEG.pm +5 -2
  72. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  73. data/bin/lib/Image/ExifTool/JSON.pm +3 -3
  74. data/bin/lib/Image/ExifTool/JVC.pm +3 -3
  75. data/bin/lib/Image/ExifTool/Jpeg2000.pm +18 -7
  76. data/bin/lib/Image/ExifTool/Kodak.pm +1 -1
  77. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  78. data/bin/lib/Image/ExifTool/LIF.pm +1 -1
  79. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  80. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  81. data/bin/lib/Image/ExifTool/Lang/de.pm +1 -1
  82. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  83. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  84. data/bin/lib/Image/ExifTool/Lang/es.pm +4 -4
  85. data/bin/lib/Image/ExifTool/Lang/fi.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Lang/fr.pm +4 -5
  87. data/bin/lib/Image/ExifTool/Lang/it.pm +3 -3
  88. data/bin/lib/Image/ExifTool/Lang/ja.pm +1 -1
  89. data/bin/lib/Image/ExifTool/Lang/ko.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/nl.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/pl.pm +1 -1
  92. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  93. data/bin/lib/Image/ExifTool/Lang/sk.pm +1 -1
  94. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  95. data/bin/lib/Image/ExifTool/Lang/tr.pm +1 -1
  96. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  97. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  98. data/bin/lib/Image/ExifTool/Leaf.pm +3 -3
  99. data/bin/lib/Image/ExifTool/Lytro.pm +1 -1
  100. data/bin/lib/Image/ExifTool/M2TS.pm +1 -1
  101. data/bin/lib/Image/ExifTool/MIE.pm +5 -5
  102. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  103. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  104. data/bin/lib/Image/ExifTool/MISB.pm +1 -1
  105. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  106. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  107. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  108. data/bin/lib/Image/ExifTool/MPEG.pm +1 -1
  109. data/bin/lib/Image/ExifTool/MPF.pm +1 -1
  110. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  111. data/bin/lib/Image/ExifTool/MWG.pm +1 -1
  112. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  113. data/bin/lib/Image/ExifTool/MacOS.pm +1 -1
  114. data/bin/lib/Image/ExifTool/MakerNotes.pm +1 -1
  115. data/bin/lib/Image/ExifTool/Matroska.pm +1 -1
  116. data/bin/lib/Image/ExifTool/Microsoft.pm +1 -1
  117. data/bin/lib/Image/ExifTool/Minolta.pm +1 -1
  118. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +3 -3
  119. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  120. data/bin/lib/Image/ExifTool/Nikon.pm +11 -8
  121. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  122. data/bin/lib/Image/ExifTool/NikonCustom.pm +4 -4
  123. data/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  124. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  125. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  126. data/bin/lib/Image/ExifTool/Ogg.pm +3 -3
  127. data/bin/lib/Image/ExifTool/Olympus.pm +1 -1
  128. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  129. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  130. data/bin/lib/Image/ExifTool/Other.pm +1 -1
  131. data/bin/lib/Image/ExifTool/PCX.pm +1 -1
  132. data/bin/lib/Image/ExifTool/PDF.pm +1 -1
  133. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  134. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  135. data/bin/lib/Image/ExifTool/PLIST.pm +4 -4
  136. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  137. data/bin/lib/Image/ExifTool/PNG.pm +24 -2
  138. data/bin/lib/Image/ExifTool/PPM.pm +1 -1
  139. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  140. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  141. data/bin/lib/Image/ExifTool/Panasonic.pm +27 -2
  142. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +4 -4
  143. data/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  144. data/bin/lib/Image/ExifTool/Pentax.pm +32 -11
  145. data/bin/lib/Image/ExifTool/PhaseOne.pm +6 -6
  146. data/bin/lib/Image/ExifTool/PhotoCD.pm +1 -1
  147. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  148. data/bin/lib/Image/ExifTool/Photoshop.pm +4 -4
  149. data/bin/lib/Image/ExifTool/PostScript.pm +3 -3
  150. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  151. data/bin/lib/Image/ExifTool/Qualcomm.pm +1 -1
  152. data/bin/lib/Image/ExifTool/QuickTime.pm +54 -101
  153. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +97 -7
  154. data/bin/lib/Image/ExifTool/RIFF.pm +1 -1
  155. data/bin/lib/Image/ExifTool/RSRC.pm +3 -3
  156. data/bin/lib/Image/ExifTool/RTF.pm +1 -1
  157. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  158. data/bin/lib/Image/ExifTool/Rawzor.pm +1 -1
  159. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  160. data/bin/lib/Image/ExifTool/Reconyx.pm +1 -1
  161. data/bin/lib/Image/ExifTool/Red.pm +1 -1
  162. data/bin/lib/Image/ExifTool/Ricoh.pm +3 -3
  163. data/bin/lib/Image/ExifTool/Samsung.pm +5 -5
  164. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  166. data/bin/lib/Image/ExifTool/Shift.pl +2 -2
  167. data/bin/lib/Image/ExifTool/Shortcuts.pm +1 -1
  168. data/bin/lib/Image/ExifTool/Sigma.pm +1 -1
  169. data/bin/lib/Image/ExifTool/SigmaRaw.pm +4 -4
  170. data/bin/lib/Image/ExifTool/Sony.pm +5 -5
  171. data/bin/lib/Image/ExifTool/SonyIDC.pm +1 -1
  172. data/bin/lib/Image/ExifTool/Stim.pm +1 -1
  173. data/bin/lib/Image/ExifTool/TagInfoXML.pm +4 -4
  174. data/bin/lib/Image/ExifTool/TagLookup.pm +3876 -3862
  175. data/bin/lib/Image/ExifTool/TagNames.pod +11420 -11382
  176. data/bin/lib/Image/ExifTool/Text.pm +1 -1
  177. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  178. data/bin/lib/Image/ExifTool/Torrent.pm +1 -1
  179. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  180. data/bin/lib/Image/ExifTool/VCard.pm +1 -1
  181. data/bin/lib/Image/ExifTool/Validate.pm +1 -1
  182. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  183. data/bin/lib/Image/ExifTool/WPG.pm +1 -1
  184. data/bin/lib/Image/ExifTool/WTV.pm +1 -1
  185. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +2 -2
  186. data/bin/lib/Image/ExifTool/WriteExif.pl +16 -16
  187. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  188. data/bin/lib/Image/ExifTool/WritePDF.pl +2 -2
  189. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  190. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  191. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -1
  192. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +5 -2
  193. data/bin/lib/Image/ExifTool/WriteRIFF.pl +1 -1
  194. data/bin/lib/Image/ExifTool/WriteXMP.pl +9 -5
  195. data/bin/lib/Image/ExifTool/Writer.pl +72 -43
  196. data/bin/lib/Image/ExifTool/XISF.pm +1 -1
  197. data/bin/lib/Image/ExifTool/XMP.pm +19 -3
  198. data/bin/lib/Image/ExifTool/XMP2.pl +1 -1
  199. data/bin/lib/Image/ExifTool/XMPStruct.pl +1 -1
  200. data/bin/lib/Image/ExifTool/ZIP.pm +7 -7
  201. data/bin/lib/Image/ExifTool/ZISRAW.pm +1 -1
  202. data/bin/lib/Image/ExifTool/iWork.pm +1 -1
  203. data/bin/lib/Image/ExifTool.pm +44 -25
  204. data/bin/lib/Image/ExifTool.pod +12 -3
  205. data/bin/perl-Image-ExifTool.spec +1 -1
  206. data/lib/exiftool_vendored/version.rb +1 -1
  207. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f510ba188ef652b3d3d2b5cf0a8f317c7ce8eb1ef27448b0de2d6ea326e67d
4
- data.tar.gz: 8221ec58b898f84a00d6739e79a88417d83b57e481b473216d2a4001f34e7909
3
+ metadata.gz: cfaf371fa934366773b7dde5e837c91f975499c1a503f2d5dc5b3e2aa45a83f1
4
+ data.tar.gz: 5dc4da573a2ccca50147787b16549efed648f0d8d77c40e59659c5d3fa0469cb
5
5
  SHA512:
6
- metadata.gz: c294ea7e4739692d2e938409230f791474b64e427a494d0abc984165415dd59a18a3e33ec5c37a8deddbf809d61adc338936762993d6cd43462b717be22be5d3
7
- data.tar.gz: 8083b7e1418ecf28253e5fef7ec3a1125e430b1235feb820cf85c7796af1d94a65ac7c5521ca36162916c4908da5f2f9a8a8598bf9ecf06d07c0d757166f21a4
6
+ metadata.gz: 9d1543e5bb5dc636305b208149f84b76262725c9c78062d80aca27bdc0e008c748c8a497fc64d5c34ddd365796c40fcae2d06af64db711ee071da96f2337399f
7
+ data.tar.gz: 4ce5b564f2b77b083b55b27444fd8ca2daa2e05339baeeda494a04dd96f4538c117521ee6106263fdc506815b0bd89a4faf34ce964bed58657183013cd9769c1
data/bin/Changes CHANGED
@@ -7,6 +7,48 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 12.70. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Jan. 23, 2024 - Version 12.74
11
+
12
+ - Added a couple of new Nikon lenses (thanks Chris)
13
+ - Added write support for a few new QuickTime Keys tags
14
+ - Decode ShutterCount for Canon EOS R5 (thanks John Moyer)
15
+ - Improved error messages in the case of file read errors
16
+ - Enhanced tag name strings (eg. -if option expressions) to allow values of
17
+ multiple matching tags to be concatenated when a group name of "All" is
18
+ specified
19
+ - Enhanced -p option to add -p- feature which avoids adding trailing newline
20
+ - Changed warning from "Shift results in negative time" to "Shift results in
21
+ date before 1970"
22
+ - Patched calculation of GPSDateTime for the timed metadata in Track3 of
23
+ Garmin videos so the API QuickTimeUTC option is no longer required
24
+ - Fixed conversion error when writing QuickTime:GoogleTrackDuration
25
+ - Fixed misidentification of non-TIFF-format files containing DNGVersion tag
26
+ - Fixed bug where Avoid-ed XMP structures could be created when writing
27
+ another same-named structure
28
+ - Internal Changes:
29
+ - Changed form of all new() calls to accommodate backward
30
+ incompatibilities in recent versions of Perl
31
+ - Changed order of InsertTagValues() arguments
32
+ - DateFmt() now returns value of formatted date/time string
33
+
34
+ Jan. 10, 2024 - Version 12.73
35
+
36
+ - Added write support for Leica XMP-xmpDSA tags
37
+ - Added read support for timed GPS from Yada RoadCam Pro 4K dashcam videos
38
+ - Added read support for PNG cpIp chunk
39
+ - Added range checks on lat/long values when writing QuickTime:GPSCoordinates
40
+ - Decode a number of new values for Ricoh GR III tags
41
+ - Decode a new Leica tag
42
+ - Improved handling of Brotli compression errors
43
+ - Enhanced API NoWarning option to also apply to app "Warning:" outputs
44
+ - Identify PNG Plus files
45
+ - Changed name of Pentax ISOAutoParameters to ISOAutoMinSpeed and improved
46
+ decoding
47
+ - Fixed writing of date/time tags in XMP-xmpMM:Pantry structure
48
+ - API Changes:
49
+ - Added LimitLongValues option to provide control over tags which
50
+ previously had a hard-coded length limit
51
+
10
52
  Dec. 29, 2023 - Version 12.72
11
53
 
12
54
  - Added read support for AAC audio files
data/bin/META.json CHANGED
@@ -50,5 +50,5 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "12.72"
53
+ "version" : "12.74"
54
54
  }
data/bin/META.yml CHANGED
@@ -31,4 +31,4 @@ recommends:
31
31
  Time::HiRes: 0
32
32
  requires:
33
33
  perl: 5.004
34
- version: 12.72
34
+ version: 12.74
data/bin/README CHANGED
@@ -108,8 +108,8 @@ your home directory, then you would type the following commands in a
108
108
  terminal window to extract and run ExifTool:
109
109
 
110
110
  cd ~/Desktop
111
- gzip -dc Image-ExifTool-12.72.tar.gz | tar -xf -
112
- cd Image-ExifTool-12.72
111
+ gzip -dc Image-ExifTool-12.74.tar.gz | tar -xf -
112
+ cd Image-ExifTool-12.74
113
113
  ./exiftool t/images/ExifTool.jpg
114
114
 
115
115
  Note: These commands extract meta information from one of the test images.
@@ -166,7 +166,7 @@ for calculating digest values and providing other features listed below:
166
166
 
167
167
  COPYRIGHT AND LICENSE
168
168
 
169
- Copyright 2003-2023, Phil Harvey
169
+ Copyright 2003-2024, Phil Harvey
170
170
 
171
171
  This is free software; you can redistribute it and/or modify it under the
172
172
  same terms as Perl itself.
data/bin/exiftool CHANGED
@@ -11,7 +11,7 @@ use strict;
11
11
  use warnings;
12
12
  require 5.004;
13
13
 
14
- my $version = '12.72';
14
+ my $version = '12.74';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  my $exePath;
@@ -58,6 +58,7 @@ sub ConvertBinary($);
58
58
  sub IsEqual($$);
59
59
  sub Infile($;$);
60
60
  sub AddSetTagsFile($;$);
61
+ sub Warning($$);
61
62
  sub DoSetFromFile($$$);
62
63
  sub CleanFilename($);
63
64
  sub SetWindowTitle($);
@@ -69,7 +70,7 @@ sub PreserveTime();
69
70
  sub AbsPath($);
70
71
  sub MyConvertFileName($$);
71
72
  sub SuggestedExtension($$$);
72
- sub LoadPrintFormat($);
73
+ sub LoadPrintFormat($;$);
73
74
  sub FilenameSPrintf($;$@);
74
75
  sub NextUnusedFilename($;$);
75
76
  sub CreateDirectory($);
@@ -270,7 +271,7 @@ my %optArgs = (
270
271
  '-lang' => 0, # (optional arg; cannot begin with "-")
271
272
  '-listitem' => 1,
272
273
  '-o' => 1, '-out' => 1,
273
- '-p' => 1, '-printformat' => 1,
274
+ '-p' => 1, '-printformat' => 1, '-p-' => 1, '-printformat-' => 1,
274
275
  '-P' => 0,
275
276
  '-password' => 1,
276
277
  '-require' => 1,
@@ -572,7 +573,7 @@ if ($^O eq 'MSWin32' and eval { require File::Glob }) {
572
573
  $doGlob = 1;
573
574
  }
574
575
 
575
- $mt = new Image::ExifTool; # create ExifTool object
576
+ $mt = Image::ExifTool->new; # create ExifTool object
576
577
 
577
578
  # don't extract duplicates by default unless set by UserDefined::Options
578
579
  $mt->Options(Duplicates => 0) unless %Image::ExifTool::UserDefined::Options
@@ -1132,10 +1133,10 @@ for (;;) {
1132
1133
  }
1133
1134
  /^overwrite_original$/i and $overwriteOrig = 1, next;
1134
1135
  /^overwrite_original_in_place$/i and $overwriteOrig = 2, next;
1135
- if (/^p$/ or $a eq 'printformat') {
1136
+ if (/^p(-?)$/ or /^printformat(-?)$/i) {
1136
1137
  my $fmt = shift;
1137
1138
  if ($pass) {
1138
- LoadPrintFormat($fmt);
1139
+ LoadPrintFormat($fmt, $1);
1139
1140
  # load MWG module now if necessary
1140
1141
  if (not $useMWG and grep /^mwg:/i, @requestTags) {
1141
1142
  $useMWG = 1;
@@ -1144,7 +1145,7 @@ for (;;) {
1144
1145
  }
1145
1146
  } else {
1146
1147
  # defer to next pass so the filename charset is available
1147
- push @nextPass, '-p', $fmt;
1148
+ push @nextPass, "-$_", $fmt;
1148
1149
  }
1149
1150
  next;
1150
1151
  }
@@ -1705,7 +1706,7 @@ if (@newValues) {
1705
1706
  my ($rtn, $wrn) = $mt->SetNewValue($tag, $newVal, %opts);
1706
1707
  $needSave = 1;
1707
1708
  ++$isWriting if $rtn;
1708
- $wrn and Warn "Warning: $wrn\n";
1709
+ $wrn and Warning($mt, $wrn);
1709
1710
  }
1710
1711
  # exclude specified tags
1711
1712
  foreach (@exclude) {
@@ -1791,7 +1792,7 @@ if (not $altEnc and $mt->Options('Lang') ne 'en' and eval { require Encode }) {
1791
1792
  if (@fileOrder) {
1792
1793
  my @allFiles;
1793
1794
  ProcessFiles($mt, \@allFiles);
1794
- my $sortTool = new Image::ExifTool;
1795
+ my $sortTool = Image::ExifTool->new;
1795
1796
  $sortTool->Options(FastScan => $fileOrderFast) if $fileOrderFast;
1796
1797
  $sortTool->Options(PrintConv => $mt->Options('PrintConv'));
1797
1798
  $sortTool->Options(Duplicates => 0);
@@ -2079,7 +2080,7 @@ sub GetImageInfo($$)
2079
2080
  @foundTags = ('*', @tags) if @tags;
2080
2081
  $info = $et->ImageInfo(Infile($pipe,$isWriting), \@foundTags, $opts);
2081
2082
  foreach $condition (@condition) {
2082
- my $cond = $et->InsertTagValues(\@foundTags, $condition, \%info);
2083
+ my $cond = $et->InsertTagValues($condition, \@foundTags, \%info);
2083
2084
  {
2084
2085
  # set package so eval'd functions are in Image::ExifTool namespace
2085
2086
  package Image::ExifTool;
@@ -2280,7 +2281,7 @@ sub GetImageInfo($$)
2280
2281
  my @lines;
2281
2282
  my $opt = $type eq 'IF' ? 'Silent' : 'Warn'; # silence "IF" warnings
2282
2283
  foreach (@$prf) {
2283
- my $line = $et->InsertTagValues(\@foundTags, $_, $opt, $grp, $cache);
2284
+ my $line = $et->InsertTagValues($_, \@foundTags, $opt, $grp, $cache);
2284
2285
  if ($type eq 'IF') {
2285
2286
  $skipBody = 1 unless defined $line;
2286
2287
  } elsif (defined $line) {
@@ -2713,12 +2714,12 @@ TAG: foreach $tag (@foundTags) {
2713
2714
  } elsif ($fixLen == 1) {
2714
2715
  $padLen -= length Encode::decode_utf8($desc);
2715
2716
  } else {
2716
- my $gcstr = eval { new Unicode::GCString(Encode::decode_utf8($desc)) };
2717
+ my $gcstr = eval { Unicode::GCString->new(Encode::decode_utf8($desc)) };
2717
2718
  if ($gcstr) {
2718
2719
  $padLen -= $gcstr->columns;
2719
2720
  } else {
2720
2721
  $padLen -= length Encode::decode_utf8($desc);
2721
- Warn "Warning: Unicode::GCString problem. Columns may be misaligned\n";
2722
+ Warning($et, 'Unicode::GCString problem. Columns may be misaligned');
2722
2723
  $fixLen = 1;
2723
2724
  }
2724
2725
  }
@@ -2988,7 +2989,7 @@ sub SetImageInfo($$$)
2988
2989
  my $newFileName = $et->GetNewValues('FileName');
2989
2990
  my $newDir = $et->GetNewValues('Directory');
2990
2991
  if (defined $newFileName and not length $newFileName) {
2991
- Warn "Warning: New file name is empty - $ infile\n";
2992
+ Warning($et,"New file name is empty - $infile");
2992
2993
  undef $newFileName;
2993
2994
  }
2994
2995
  if (defined $testName) {
@@ -3639,7 +3640,7 @@ sub Infile($;$)
3639
3640
  if ($rafStdin) {
3640
3641
  $rafStdin->Seek(0); # rewind
3641
3642
  } elsif (open RAF_STDIN, '-') {
3642
- $rafStdin = new File::RandomAccess(\*RAF_STDIN);
3643
+ $rafStdin = File::RandomAccess->new(\*RAF_STDIN);
3643
3644
  $rafStdin->BinMode();
3644
3645
  }
3645
3646
  return $rafStdin if $rafStdin;
@@ -3647,9 +3648,22 @@ sub Infile($;$)
3647
3648
  return $file;
3648
3649
  }
3649
3650
 
3651
+ #------------------------------------------------------------------------------
3652
+ # Issue warning to stderr, adding leading "Warning: " and trailing newline
3653
+ # if the warning isn't suppressed by the API NoWarning option
3654
+ # Inputs: 0) ExifTool ref, 1) warning string
3655
+ sub Warning($$)
3656
+ {
3657
+ my ($et, $str) = @_;
3658
+ my $noWarn = $et->Options('NoWarning');
3659
+ if (not defined $noWarn or not eval { $str =~ /$noWarn/ }) {
3660
+ Warn "Warning: $str\n";
3661
+ }
3662
+ }
3663
+
3650
3664
  #------------------------------------------------------------------------------
3651
3665
  # Set new values from file
3652
- # Inputs: 0) exiftool ref, 1) filename, 2) reference to list of values to set
3666
+ # Inputs: 0) ExifTool ref, 1) filename, 2) reference to list of values to set
3653
3667
  # Returns: 0 on error (and increments $countBadWr)
3654
3668
  sub DoSetFromFile($$$)
3655
3669
  {
@@ -3662,19 +3676,18 @@ sub DoSetFromFile($$$)
3662
3676
  # delete all error and warning tags
3663
3677
  my @warns = grep /^(Error|Warning)\b/, keys %$info;
3664
3678
  $numSet -= scalar(@warns);
3665
- # issue a warning for the main error only if we were able to set some tags
3666
- if (keys(%$info) > @warns) {
3667
- my $err = $$info{Error};
3668
- delete $$info{$_} foreach @warns;
3669
- $$info{Warning} = $err;
3670
- }
3679
+ # issue a warning only for the main error
3680
+ my $err = $$info{Error};
3681
+ delete $$info{$_} foreach @warns;
3682
+ my $noWarn = $et->Options('NoWarning');
3683
+ $$info{Warning} = $err unless defined $noWarn and eval { $err =~ /$noWarn/ };
3671
3684
  } elsif ($$info{Warning}) {
3672
3685
  my $warns = 1;
3673
3686
  ++$warns while $$info{"Warning ($warns)"};
3674
3687
  $numSet -= $warns;
3675
3688
  }
3676
3689
  PrintErrors($et, $info, $file) and EFile($file), ++$countBadWr, return 0;
3677
- Warn "Warning: No writable tags set from $file\n" unless $numSet;
3690
+ Warning($et,"No writable tags set from $file") unless $numSet;
3678
3691
  return 1;
3679
3692
  }
3680
3693
 
@@ -3820,7 +3833,7 @@ sub ScanDir($$;$)
3820
3833
  if ($evalWarning) {
3821
3834
  chomp $evalWarning;
3822
3835
  $evalWarning =~ s/ at .*//s;
3823
- Warn "Warning: [Win32::FindFile] $evalWarning - $dir\n";
3836
+ Warning($et,"[Win32::FindFile] $evalWarning - $dir");
3824
3837
  $winSurrogate = 1 if $evalWarning =~ /surrogate/;
3825
3838
  } else {
3826
3839
  $et->Options(CharsetFileName => 'UTF8'); # now using UTF8
@@ -4104,12 +4117,12 @@ sub SuggestedExtension($$$)
4104
4117
 
4105
4118
  #------------------------------------------------------------------------------
4106
4119
  # Load print format file
4107
- # Inputs: 0) file name
4120
+ # Inputs: 0) file name, 1) flag to avoid adding newline to input argument
4108
4121
  # - saves lines of file to %printFmt list
4109
4122
  # - adds tag names to @tags list
4110
- sub LoadPrintFormat($)
4123
+ sub LoadPrintFormat($;$)
4111
4124
  {
4112
- my $arg = shift;
4125
+ my ($arg, $noNL) = @_;
4113
4126
  if (not defined $arg) {
4114
4127
  Error "Must specify file or expression for -p option\n";
4115
4128
  } elsif ($arg !~ /\n/ and -f $arg and $mt->Open(\*FMT_FILE, $arg)) {
@@ -4118,7 +4131,8 @@ sub LoadPrintFormat($)
4118
4131
  }
4119
4132
  close(FMT_FILE);
4120
4133
  } else {
4121
- AddPrintFormat($arg . "\n");
4134
+ $arg .= "\n" unless $noNL;
4135
+ AddPrintFormat($arg);
4122
4136
  }
4123
4137
  }
4124
4138
 
@@ -4282,7 +4296,7 @@ sub CreateDirectory($)
4282
4296
  return 0;
4283
4297
  }
4284
4298
  unless ($k32CreateDir) {
4285
- $k32CreateDir = new Win32::API('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4299
+ $k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4286
4300
  }
4287
4301
  $success = $k32CreateDir->Call($d2, 0) if $k32CreateDir;
4288
4302
  } else {
@@ -4739,7 +4753,7 @@ L<Input-output text formatting|/Input-output text formatting>
4739
4753
  -lang [LANG] Set current language
4740
4754
  -listItem INDEX Extract specific item from a list
4741
4755
  -n (--printConv) No print conversion
4742
- -p FMTFILE (-printFormat) Print output in specified format
4756
+ -p[-] STR (-printFormat) Print output in specified format
4743
4757
  -php Export tags as a PHP Array
4744
4758
  -s[NUM] (-short) Short output format (-s for tag names)
4745
4759
  -S (-veryShort) Very short output format
@@ -5548,30 +5562,31 @@ when writing. For example, the following commands all have the same effect:
5548
5562
  > exiftool -Orientation=6 -n a.jpg
5549
5563
  > exiftool -Orientation#=6 a.jpg
5550
5564
 
5551
- =item B<-p> I<FMTFILE> or I<STR> (B<-printFormat>)
5565
+ =item B<-p>[-] I<STR> or I<FMTFILE> (B<-printFormat>)
5552
5566
 
5553
- Print output in the format specified by the given file or string. The
5567
+ Print output in the format specified by the given string or file. The
5554
5568
  argument is interpreted as a string unless a file of that name exists, in
5555
5569
  which case the string is loaded from the contents of the file. Tag names in
5556
- the format file or string begin with a C<$> symbol and may contain leading
5570
+ the format string or file begin with a C<$> symbol and may contain leading
5557
5571
  group names and/or a trailing C<#> (to disable print conversion). Case is
5558
5572
  not significant. Braces C<{}> may be used around the tag name to separate
5559
5573
  it from subsequent text (and must be used if subsequent text begins with an
5560
5574
  alphanumeric character, hyphen, underline, colon or number sign). Use C<$$>
5561
- to represent a C<$> symbol, and C<$/> for a newline.
5562
-
5563
- Multiple B<-p> options may be used, each contributing a line (or more) of
5564
- text to the output. Lines beginning with C<#[HEAD]> and C<#[TAIL]> are
5565
- output before the first processed file and after the last processed file
5566
- respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]> are output
5567
- before and after each section of files. A section is defined as a group of
5568
- consecutive files with the same section header (eg. files are grouped by
5569
- directory if C<#[SECT]> contains C<$directory>). Lines beginning with
5570
- C<#[BODY]> and lines not beginning with C<#> are output for each processed
5571
- file. Lines beginning with C<#[IF]> are not output, but all BODY lines are
5572
- skipped if any tag on an IF line doesn't exist. Other lines beginning with
5573
- C<#> are ignored. (To output a line beginning with C<#>, use C<#[BODY]#>.)
5574
- For example, this format file:
5575
+ to represent a C<$> symbol, and C<$/> for a newline. When the string
5576
+ argument is used (ie. I<STR>), a newline is added to the end of the string
5577
+ unless B<-p-> is specified.
5578
+
5579
+ Multiple B<-p> options may be used. Lines beginning with C<#[HEAD]> and
5580
+ C<#[TAIL]> are output before the first processed file and after the last
5581
+ processed file respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]>
5582
+ are output before and after each section of files. A section is defined as
5583
+ a group of consecutive files with the same section header (eg. files are
5584
+ grouped by directory if C<#[SECT]> contains C<$directory>). Lines beginning
5585
+ with C<#[BODY]> and lines not beginning with C<#> are output for each
5586
+ processed file. Lines beginning with C<#[IF]> are not output, but all BODY
5587
+ lines are skipped if any tag on an IF line doesn't exist. Other lines
5588
+ beginning with C<#> are ignored. (To output a line beginning with C<#>, use
5589
+ C<#[BODY]#>.) For example, this format file:
5575
5590
 
5576
5591
  # this is a comment line
5577
5592
  #[HEAD]-- Generated by ExifTool $exifToolVersion --
@@ -5585,16 +5600,21 @@ with this command:
5585
5600
 
5586
5601
  produces output like this:
5587
5602
 
5588
- -- Generated by ExifTool 12.72 --
5603
+ -- Generated by ExifTool 12.74 --
5589
5604
  File: a.jpg - 2003:10:31 15:44:19
5590
5605
  (f/5.6, 1/60s, ISO 100)
5591
5606
  File: b.jpg - 2006:05:23 11:57:38
5592
5607
  (f/8.0, 1/13s, ISO 100)
5593
5608
  -- end --
5594
5609
 
5595
- The values of List-type tags with multiple items and Shortcut tags
5596
- representing multiple tags are joined according the B<-sep> option setting
5597
- when interpolated in the string.
5610
+ The values of List-type tags with multiple items, Shortcut tags representing
5611
+ multiple tags, and matching tags when the C<All> group is specified are
5612
+ joined according the B<-sep> option setting when interpolated in the string.
5613
+ (Note that when C<All> is used as a group name, dupicate tags are included
5614
+ regardless of the Duplicates option setting.) When C<All> is used as a tag
5615
+ name, a value of 1 is returned if any tag exists in the specified group, or
5616
+ 0 otherwise (unless the C<All> group is also specified, in which case the
5617
+ values of all matching tags are joined).
5598
5618
 
5599
5619
  When B<-ee> (B<-extractEmbedded>) is combined with B<-p>, embedded documents
5600
5620
  are effectively processed as separate input files.
@@ -6537,7 +6557,9 @@ set to undef if C<=> is used, or an empty string with C<^=>. If I<OPT> is
6537
6557
  not specified a list of available options is returned. The option name is
6538
6558
  not case senstive, but the option values are. See
6539
6559
  L<Image::ExifTool Options|Image::ExifTool/Options> for option details. This
6540
- overrides API options set via the config file.
6560
+ overrides API options set via the config file. Note that the exiftool app
6561
+ sets some API options internally, and attempts to change these via the
6562
+ command line will have no effect.
6541
6563
 
6542
6564
  =item B<-common_args>
6543
6565
 
@@ -7454,7 +7476,7 @@ the commands if B<-execute> was used).
7454
7476
 
7455
7477
  =head1 AUTHOR
7456
7478
 
7457
- Copyright 2003-2023, Phil Harvey
7479
+ Copyright 2003-2024, Phil Harvey
7458
7480
 
7459
7481
  This is free software; you can redistribute it and/or modify it under the
7460
7482
  same terms as Perl itself.
@@ -17,6 +17,7 @@
17
17
  # scalar with a multi-character newline
18
18
  # 01/24/2009 - PH Protect against reading too much at once
19
19
  # 10/04/2018 - PH Added NoBuffer option
20
+ # 01/20/2024 - PH Set ERROR on file read error
20
21
  #
21
22
  # Notes: Calls the normal file i/o routines unless SeekTest() fails, in
22
23
  # which case the file is buffered in memory to allow random access.
@@ -25,7 +26,10 @@
25
26
  #
26
27
  # May also be used for string i/o (just pass a scalar reference)
27
28
  #
28
- # Legal: Copyright (c) 2003-2023 Phil Harvey (philharvey66 at gmail.com)
29
+ # Sets internal ERROR member from $! if there is an error reading
30
+ # the file.
31
+ #
32
+ # Legal: Copyright (c) 2003-2024, Phil Harvey (philharvey66 at gmail.com)
29
33
  # This library is free software; you can redistribute it and/or
30
34
  # modify it under the same terms as Perl itself.
31
35
  #------------------------------------------------------------------------------
@@ -37,7 +41,7 @@ require 5.002;
37
41
  require Exporter;
38
42
 
39
43
  use vars qw($VERSION @ISA @EXPORT_OK);
40
- $VERSION = '1.11';
44
+ $VERSION = '1.12';
41
45
  @ISA = qw(Exporter);
42
46
 
43
47
  sub Read($$$);
@@ -211,6 +215,8 @@ sub Read($$$)
211
215
  if ($num) {
212
216
  ${$self->{BUFF_PT}} .= $buff;
213
217
  $self->{LEN} += $num;
218
+ } elsif (not defined $num) {
219
+ $self->{ERROR} = $!;
214
220
  }
215
221
  }
216
222
  # number of bytes left in data buffer
@@ -229,7 +235,11 @@ sub Read($$$)
229
235
  } else {
230
236
  # read directly from file
231
237
  $_[0] = '' unless defined $_[0];
232
- $rtnVal = read($self->{FILE_PT}, $_[0], $len) || 0;
238
+ $rtnVal = read($self->{FILE_PT}, $_[0], $len);
239
+ unless (defined $rtnVal) {
240
+ $self->{ERROR} = $!;
241
+ $rtnVal = 0;
242
+ }
233
243
  }
234
244
  if ($self->{DEBUG}) {
235
245
  my $pos = $self->Tell() - $rtnVal;
@@ -258,7 +268,10 @@ sub ReadLine($$)
258
268
  # make sure we have some data after the current position
259
269
  while ($self->{LEN} <= $pos) {
260
270
  $num = read($fp, $buff, $CHUNK_SIZE);
261
- return 0 unless $num;
271
+ unless ($num) {
272
+ defined $num or $self->{ERROR} = $!;
273
+ return 0;
274
+ }
262
275
  ${$self->{BUFF_PT}} .= $buff;
263
276
  $self->{LEN} += $num;
264
277
  }
@@ -270,7 +283,11 @@ sub ReadLine($$)
270
283
  last;
271
284
  }
272
285
  $pos = $self->{LEN}; # have scanned to end of buffer
273
- $num = read($fp, $buff, $CHUNK_SIZE) or last;
286
+ $num = read($fp, $buff, $CHUNK_SIZE);
287
+ unless ($num) {
288
+ defined $num or $self->{ERROR} = $!;
289
+ last;
290
+ }
274
291
  ${$self->{BUFF_PT}} .= $buff;
275
292
  $self->{LEN} += $num;
276
293
  }
@@ -314,7 +331,12 @@ sub Slurp($)
314
331
  my $fp = $self->{FILE_PT} || return;
315
332
  # read whole file into buffer (in large chunks)
316
333
  my ($buff, $num);
317
- while (($num = read($fp, $buff, $CHUNK_SIZE * $SLURP_CHUNKS)) != 0) {
334
+ for (;;) {
335
+ $num = read($fp, $buff, $CHUNK_SIZE * $SLURP_CHUNKS);
336
+ unless ($num) {
337
+ defined $num or $self->{ERROR} = $!;
338
+ last;
339
+ }
318
340
  ${$self->{BUFF_PT}} .= $buff;
319
341
  $self->{LEN} += $num;
320
342
  }
@@ -339,6 +361,10 @@ sub Purge($)
339
361
  $self->{POS} -= $self->{LEN};
340
362
  ${$self->{BUFF_PT}} = '';
341
363
  $self->{LEN} = read($self->{FILE_PT}, ${$self->{BUFF_PT}}, $SKIP_SIZE);
364
+ if (not defined $self->{LEN}) {
365
+ $self->{ERROR} = $!;
366
+ last;
367
+ }
342
368
  last if $self->{LEN} < $SKIP_SIZE;
343
369
  }
344
370
  } elsif ($purge > 0) {
@@ -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-2023 Phil Harvey (philharvey66 at gmail.com)
6
+ # Legal: Copyright (c) 2003-2024, 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
  #------------------------------------------------------------------------------
@@ -16,9 +16,9 @@ File::RandomAccess - Random access reads of sequential file or scalar
16
16
 
17
17
  use File::RandomAccess;
18
18
 
19
- $raf = new File::RandomAccess(\*FILE, $disableSeekTest);
19
+ $raf = File::RandomAccess->new(\*FILE, $disableSeekTest);
20
20
 
21
- $raf = new File::RandomAccess(\$data);
21
+ $raf = File::RandomAccess->new(\$data);
22
22
 
23
23
  $err = $raf->Seek($pos);
24
24
  $num = $raf->Read($buff, $bytes);
@@ -38,10 +38,10 @@ Creates a new RandomAccess object given a file reference or
38
38
  reference to data in memory.
39
39
 
40
40
  # Read from open file or pipe
41
- $raf = new File::RandomAccess(\*FILE);
41
+ $raf = File::RandomAccess->new(\*FILE);
42
42
 
43
43
  # Read from data in memory
44
- $raf = new File::RandomAccess(\$data);
44
+ $raf = File::RandomAccess->new(\$data);
45
45
 
46
46
  =over 4
47
47
 
@@ -236,7 +236,7 @@ the end of file is not allowed.
236
236
 
237
237
  =head1 AUTHOR
238
238
 
239
- Copyright 2003-2023 Phil Harvey (philharvey66 at gmail.com)
239
+ Copyright 2003-2024, 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.
@@ -15,7 +15,7 @@ use strict;
15
15
  use vars qw($VERSION);
16
16
  use Image::ExifTool qw(:DataAccess :Utils);
17
17
 
18
- $VERSION = '1.00';
18
+ $VERSION = '1.01';
19
19
 
20
20
  sub ReadUInt32 {
21
21
  my $buff;
@@ -569,7 +569,7 @@ sub ReadFilesInfo {
569
569
  next;
570
570
  }
571
571
  $_[0]->Read($buff, $size);
572
- my $buffer = new File::RandomAccess(\$buff);
572
+ my $buffer = File::RandomAccess->new(\$buff);
573
573
  if($prop == 14){ # empty stream
574
574
  my @isempty = ReadBoolean($buffer, $numfiles, 0);
575
575
  my $numemptystreams = 0;
@@ -732,7 +732,7 @@ sub Process7Z($$)
732
732
  $folder_data .= Decompress($et, $raf, $decomporessor, $remaining);
733
733
  $remaining = $uncompressed_size - length($folder_data);
734
734
  }
735
- $buffer2 = new File::RandomAccess(\$folder_data);
735
+ $buffer2 = File::RandomAccess->new(\$folder_data);
736
736
  }
737
737
  $buffer2->Seek(0, 0);
738
738
  $buffer2->Read($buff, 1);
@@ -28,6 +28,7 @@ my %convSampleRate = (
28
28
  %Image::ExifTool::AAC::Main = (
29
29
  PROCESS_PROC => \&Image::ExifTool::FLAC::ProcessBitStream,
30
30
  GROUPS => { 2 => 'Audio' },
31
+ NOTES => 'Tags extracted from Advanced Audio Coding (AAC) files.',
31
32
  # Bit000-011 - sync word (all 1's)
32
33
  # Bit012 - ID (seems to be always 0)
33
34
  # Bit013-014 - layer (00)
@@ -109,7 +110,7 @@ sub ProcessAAC($$)
109
110
  $et->ProcessDirectory({ DataPt => \$buff }, $tagTablePtr);
110
111
 
111
112
  # read the first frame data to check for a filler with the encoder name
112
- if ($len > 8 and $raf->Read($buff, $len-7) == $len-7) {
113
+ while ($len > 8 and $raf->Read($buff, $len-7) == $len-7) {
113
114
  my $noCRC = ($t[0] & 0x00010000);
114
115
  my $blocks = ($t[2] & 0x03);
115
116
  my $pos = 0;
@@ -122,16 +123,17 @@ sub ProcessAAC($$)
122
123
  my $cnt = ($tmp >> 9) & 0x0f;
123
124
  ++$pos;
124
125
  if ($cnt == 15) {
125
- $cnt += (($tmp >> 1) & 0xff) - 1 if $cnt == 15;
126
+ $cnt += (($tmp >> 1) & 0xff) - 1;
126
127
  ++$pos;
127
128
  }
128
- if ($pos + $cnt < length($buff)) {
129
+ if ($pos + $cnt <= length($buff)) {
129
130
  my $dat = substr($buff, $pos, $cnt);
130
131
  $dat =~ s/^\0+//;
131
132
  $dat =~ s/\0+$//;
132
133
  $et->HandleTag($tagTablePtr, Encoder => $dat) if $dat =~ /^[\x20-\x7e]+$/;
133
134
  }
134
135
  }
136
+ last;
135
137
  }
136
138
 
137
139
  return 1;
@@ -151,8 +153,8 @@ This module is used by Image::ExifTool
151
153
 
152
154
  =head1 DESCRIPTION
153
155
 
154
- This module contains definitions required by Image::ExifTool to read AAC
155
- audio files.
156
+ This module contains definitions required by Image::ExifTool to read
157
+ Advanced Audio Coding (AAC) files.
156
158
 
157
159
  =head1 NOTES
158
160
 
@@ -161,7 +163,7 @@ based on unofficial sources which may be incomplete, inaccurate or outdated.
161
163
 
162
164
  =head1 AUTHOR
163
165
 
164
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
166
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
165
167
 
166
168
  This library is free software; you can redistribute it and/or modify it
167
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-2023, Phil Harvey (philharvey66 at gmail.com)
480
+ Copyright 2003-2024, 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.