exiftool_vendored 12.73.0 → 12.75.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +41 -2
  3. data/bin/META.json +1 -1
  4. data/bin/META.yml +1 -1
  5. data/bin/README +46 -45
  6. data/bin/exiftool +97 -83
  7. data/bin/lib/File/RandomAccess.pm +31 -5
  8. data/bin/lib/File/RandomAccess.pod +4 -4
  9. data/bin/lib/Image/ExifTool/7Z.pm +3 -3
  10. data/bin/lib/Image/ExifTool/AFCP.pm +2 -2
  11. data/bin/lib/Image/ExifTool/BZZ.pm +2 -2
  12. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -7
  13. data/bin/lib/Image/ExifTool/Canon.pm +6 -5
  14. data/bin/lib/Image/ExifTool/CanonVRD.pm +2 -2
  15. data/bin/lib/Image/ExifTool/DICOM.pm +2 -2
  16. data/bin/lib/Image/ExifTool/DNG.pm +4 -4
  17. data/bin/lib/Image/ExifTool/Exif.pm +3 -2
  18. data/bin/lib/Image/ExifTool/FLIR.pm +2 -2
  19. data/bin/lib/Image/ExifTool/Fixup.pm +3 -3
  20. data/bin/lib/Image/ExifTool/FlashPix.pm +3 -3
  21. data/bin/lib/Image/ExifTool/FujiFilm.pm +8 -3
  22. data/bin/lib/Image/ExifTool/Geotag.pm +3 -3
  23. data/bin/lib/Image/ExifTool/HtmlDump.pm +2 -2
  24. data/bin/lib/Image/ExifTool/ID3.pm +2 -2
  25. data/bin/lib/Image/ExifTool/Import.pm +5 -5
  26. data/bin/lib/Image/ExifTool/JSON.pm +2 -2
  27. data/bin/lib/Image/ExifTool/Jpeg2000.pm +51 -12
  28. data/bin/lib/Image/ExifTool/MIE.pm +3 -3
  29. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +2 -2
  30. data/bin/lib/Image/ExifTool/Nikon.pm +3 -1
  31. data/bin/lib/Image/ExifTool/NikonCustom.pm +3 -3
  32. data/bin/lib/Image/ExifTool/Ogg.pm +2 -2
  33. data/bin/lib/Image/ExifTool/PDF.pm +54 -4
  34. data/bin/lib/Image/ExifTool/PLIST.pm +3 -3
  35. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +3 -3
  36. data/bin/lib/Image/ExifTool/PhaseOne.pm +2 -2
  37. data/bin/lib/Image/ExifTool/Photoshop.pm +3 -3
  38. data/bin/lib/Image/ExifTool/PostScript.pm +2 -2
  39. data/bin/lib/Image/ExifTool/QuickTime.pm +41 -107
  40. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +8 -6
  41. data/bin/lib/Image/ExifTool/RSRC.pm +2 -2
  42. data/bin/lib/Image/ExifTool/Samsung.pm +4 -4
  43. data/bin/lib/Image/ExifTool/Shift.pl +1 -2
  44. data/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -3
  45. data/bin/lib/Image/ExifTool/Sony.pm +3 -3
  46. data/bin/lib/Image/ExifTool/TagInfoXML.pm +2 -2
  47. data/bin/lib/Image/ExifTool/TagLookup.pm +8 -5
  48. data/bin/lib/Image/ExifTool/TagNames.pod +36 -5
  49. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  50. data/bin/lib/Image/ExifTool/WriteExif.pl +26 -23
  51. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
  52. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +1 -1
  53. data/bin/lib/Image/ExifTool/WriteXMP.pl +4 -2
  54. data/bin/lib/Image/ExifTool/Writer.pl +68 -44
  55. data/bin/lib/Image/ExifTool/XMP.pm +2 -1
  56. data/bin/lib/Image/ExifTool/XMP2.pl +9 -0
  57. data/bin/lib/Image/ExifTool/ZIP.pm +6 -6
  58. data/bin/lib/Image/ExifTool.pm +42 -26
  59. data/bin/lib/Image/ExifTool.pod +76 -71
  60. data/bin/perl-Image-ExifTool.spec +45 -44
  61. data/lib/exiftool_vendored/version.rb +1 -1
  62. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e4bebb394e40270c3e7794a1c5e269d227a7e41ac88fe231d5b8e04433eb88b
4
- data.tar.gz: 781a0260d3d75e23d60b1350d342b7e46af136b39471c673883e2d11dc71152f
3
+ metadata.gz: 9dda9b74fae35f2dc1e3675ee735a6ef747654f5ab0e92b4ceb64c6dca7d95c1
4
+ data.tar.gz: c6154176d70ab63db1d4c65a2e872a8c727d1545fccc2bf4197998faa295dc7f
5
5
  SHA512:
6
- metadata.gz: 9d294cedfc656675286e39e782d484fcf2b659e85cc8e445dc17999ca3c656a2f6dd2e241e3b23b1da9cda02ab8c15a064bc0c40d20439c853ccd3e5f6214523
7
- data.tar.gz: ce99e91f91e27be93453645e19d3ec3f3206eb7f06b1d610fadd5f0cc4401e1376a8831f3756ceb3d7896651a9ebbbc4bf1f04d6fc09acce47a78191133e0ff3
6
+ metadata.gz: e0f3e4fcc88c78448d07f09d73e2e36b025accb4a85d2b425a9eb537c9fabd7792cc2525f41928b82f9688a33ceef08da4996a515bc87258347484e93e93fdec
7
+ data.tar.gz: 48b0871192b51764f64cdcbb3b69b0f10f752223a68d60a8f364e984542328a339618f49dce5716af91ba13afbfad06cd93e99a1e7fc1f1220b2752f71ab887f
data/bin/Changes CHANGED
@@ -4,9 +4,47 @@ ExifTool Version History
4
4
 
5
5
  RSS feed: https://exiftool.org/rss.xml
6
6
 
7
- Note: The most recent production release is Version 12.70. (Other versions are
7
+ Note: The most recent production release is Version 12.75. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Jan. 30, 2024 - Version 12.75 (production release)
11
+
12
+ - CORRUPTION WARNING: Fixed bug introduced in 12.45 which could result in
13
+ corrupted Sony ARW images from some newer models when writing if lossless
14
+ compression was used
15
+ - Added ability to read C2PA JUMBF metadata from PDF and SVG files
16
+ - Added ability to extract JUMBF metadata as a block
17
+ - Added read support for C2PA (JUMBF-format) files
18
+ - Removed "date before 1970" warning entirely since 64-bit systems should be
19
+ able to handle dates in this range
20
+ - Improved Canon FocusMode decoding
21
+ - Fixed bug introducd in 12.74 which could cause "Undefined subroutine"
22
+ runtime error when reading MIE files
23
+
24
+ Jan. 23, 2024 - Version 12.74
25
+
26
+ - Added a couple of new Nikon lenses (thanks Chris)
27
+ - Added write support for a few new QuickTime Keys tags
28
+ - Decode ShutterCount for Canon EOS R5 (thanks John Moyer)
29
+ - Improved error messages in the case of file read errors
30
+ - Enhanced tag name strings (eg. -if and -p option arguments) to allow values
31
+ of multiple matching tags to be concatenated when a group name of "All" is
32
+ specified
33
+ - Enhanced -p option to add -p- feature which avoids adding trailing newline
34
+ - Changed warning from "Shift results in negative time" to "Shift results in
35
+ date before 1970"
36
+ - Patched calculation of GPSDateTime for the timed metadata in Track3 of
37
+ Garmin videos so the API QuickTimeUTC option is no longer required
38
+ - Fixed conversion error when writing QuickTime:GoogleTrackDuration
39
+ - Fixed misidentification of non-TIFF-format files containing DNGVersion tag
40
+ - Fixed bug where Avoid-ed XMP structures could be created when writing
41
+ another same-named structure
42
+ - Internal Changes:
43
+ - Changed form of all new() calls to accommodate backward
44
+ incompatibilities in recent versions of Perl
45
+ - Changed order of InsertTagValues() arguments
46
+ - DateFmt() now returns value of formatted date/time string
47
+
10
48
  Jan. 10, 2024 - Version 12.73
11
49
 
12
50
  - Added write support for Leica XMP-xmpDSA tags
@@ -22,7 +60,8 @@ Jan. 10, 2024 - Version 12.73
22
60
  decoding
23
61
  - Fixed writing of date/time tags in XMP-xmpMM:Pantry structure
24
62
  - API Changes:
25
- - Added LimitLongValues option
63
+ - Added LimitLongValues option to provide control over tags which
64
+ previously had a hard-coded length limit
26
65
 
27
66
  Dec. 29, 2023 - Version 12.72
28
67
 
data/bin/META.json CHANGED
@@ -50,5 +50,5 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "12.73"
53
+ "version" : "12.75"
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.73
34
+ version: 12.75
data/bin/README CHANGED
@@ -14,49 +14,50 @@ supported by ExifTool (r = read, w = write, c = create):
14
14
 
15
15
  File Types
16
16
  ------------+-------------+-------------+-------------+------------
17
- 360 r/w | DOCX r | ISO r | NRW r/w | RAR r
18
- 3FR r | DPX r | ITC r | NUMBERS r | RAW r/w
19
- 3G2 r/w | DR4 r/w/c | J2C r | O r | RIFF r
20
- 3GP r/w | DSS r | JNG r/w | ODP r | RSRC r
21
- 7Z r | DV r | JP2 r/w | ODS r | RTF r
22
- A r | DVB r/w | JPEG r/w | ODT r | RW2 r/w
23
- AA r | DVR-MS r | JSON r | OFR r | RWL r/w
24
- AAC r | DYLIB r | JXL r | OGG r | RWZ r
25
- AAE r | EIP r | K25 r | OGV r | RM r
26
- AAX r/w | EPS r/w | KDC r | ONP r | SEQ r
27
- ACR r | EPUB r | KEY r | OPUS r | SKETCH r
28
- AFM r | ERF r/w | LA r | ORF r/w | SO r
29
- AI r/w | EXE r | LFP r | ORI r/w | SR2 r/w
30
- AIFF r | EXIF r/w/c | LIF r | OTF r | SRF r
31
- APE r | EXR r | LNK r | PAC r | SRW r/w
32
- ARQ r/w | EXV r/w/c | LRV r/w | PAGES r | SVG r
33
- ARW r/w | F4A/V r/w | M2TS r | PBM r/w | SWF r
34
- ASF r | FFF r/w | M4A/V r/w | PCD r | THM r/w
35
- AVI r | FITS r | MACOS r | PCX r | TIFF r/w
36
- AVIF r/w | FLA r | MAX r | PDB r | TORRENT r
37
- AZW r | FLAC r | MEF r/w | PDF r/w | TTC r
38
- BMP r | FLIF r/w | MIE r/w/c | PEF r/w | TTF r
39
- BPG r | FLV r | MIFF r | PFA r | TXT r
40
- BTF r | FPF r | MKA r | PFB r | VCF r
41
- CHM r | FPX r | MKS r | PFM r | VNT r
42
- COS r | GIF r/w | MKV r | PGF r | VRD r/w/c
43
- CR2 r/w | GLV r/w | MNG r/w | PGM r/w | VSD r
44
- CR3 r/w | GPR r/w | MOBI r | PLIST r | WAV r
45
- CRM r/w | GZ r | MODD r | PICT r | WDP r/w
46
- CRW r/w | HDP r/w | MOI r | PMP r | WEBP r/w
47
- CS1 r/w | HDR r | MOS r/w | PNG r/w | WEBM r
48
- CSV r | HEIC r/w | MOV r/w | PPM r/w | WMA r
49
- CUR r | HEIF r/w | MP3 r | PPT r | WMV r
50
- CZI r | HTML r | MP4 r/w | PPTX r | WPG r
51
- DCM r | ICC r/w/c | MPC r | PS r/w | WTV r
52
- DCP r/w | ICO r | MPG r | PSB r/w | WV r
53
- DCR r | ICS r | MPO r/w | PSD r/w | X3F r/w
54
- DFONT r | IDML r | MQV r/w | PSP r | XCF r
55
- DIVX r | IIQ r/w | MRC r | QTIF r/w | XISF r
56
- DJVU r | IND r/w | MRW r/w | R3D r | XLS r
57
- DLL r | INSP r/w | MXF r | RA r | XLSX r
58
- DNG r/w | INSV r | NEF r/w | RAF r/w | XMP r/w/c
59
- DOC r | INX r | NKSC r/w | RAM r | ZIP r
17
+ 360 r/w | DOCX r | ITC r | O r | RSRC r
18
+ 3FR r | DPX r | J2C r | ODP r | RTF r
19
+ 3G2 r/w | DR4 r/w/c | JNG r/w | ODS r | RW2 r/w
20
+ 3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
21
+ 7Z r | DV r | JPEG r/w | OFR r | RWZ r
22
+ A r | DVB r/w | JSON r | OGG r | RM r
23
+ AA r | DVR-MS r | JXL r | OGV r | SEQ r
24
+ AAC r | DYLIB r | K25 r | ONP r | SKETCH r
25
+ AAE r | EIP r | KDC r | OPUS r | SO r
26
+ AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
27
+ ACR r | EPUB r | LA r | ORI r/w | SRF r
28
+ AFM r | ERF r/w | LFP r | OTF r | SRW r/w
29
+ AI r/w | EXE r | LIF r | PAC r | SVG r
30
+ AIFF r | EXIF r/w/c | LNK r | PAGES r | SWF r
31
+ APE r | EXR r | LRV r/w | PBM r/w | THM r/w
32
+ ARQ r/w | EXV r/w/c | M2TS r | PCD r | TIFF r/w
33
+ ARW r/w | F4A/V r/w | M4A/V r/w | PCX r | TORRENT r
34
+ ASF r | FFF r/w | MACOS r | PDB r | TTC r
35
+ AVI r | FITS r | MAX r | PDF r/w | TTF r
36
+ AVIF r/w | FLA r | MEF r/w | PEF r/w | TXT r
37
+ AZW r | FLAC r | MIE r/w/c | PFA r | VCF r
38
+ BMP r | FLIF r/w | MIFF r | PFB r | VNT r
39
+ BPG r | FLV r | MKA r | PFM r | VRD r/w/c
40
+ BTF r | FPF r | MKS r | PGF r | VSD r
41
+ C2PA r | FPX r | MKV r | PGM r/w | WAV r
42
+ CHM r | GIF r/w | MNG r/w | PLIST r | WDP r/w
43
+ COS r | GLV r/w | MOBI r | PICT r | WEBP r/w
44
+ CR2 r/w | GPR r/w | MODD r | PMP r | WEBM r
45
+ CR3 r/w | GZ r | MOI r | PNG r/w | WMA r
46
+ CRM r/w | HDP r/w | MOS r/w | PPM r/w | WMV r
47
+ CRW r/w | HDR r | MOV r/w | PPT r | WPG r
48
+ CS1 r/w | HEIC r/w | MP3 r | PPTX r | WTV r
49
+ CSV r | HEIF r/w | MP4 r/w | PS r/w | WV r
50
+ CUR r | HTML r | MPC r | PSB r/w | X3F r/w
51
+ CZI r | ICC r/w/c | MPG r | PSD r/w | XCF r
52
+ DCM r | ICO r | MPO r/w | PSP r | XISF r
53
+ DCP r/w | ICS r | MQV r/w | QTIF r/w | XLS r
54
+ DCR r | IDML r | MRC r | R3D r | XLSX r
55
+ DFONT r | IIQ r/w | MRW r/w | RA r | XMP r/w/c
56
+ DIVX r | IND r/w | MXF r | RAF r/w | ZIP r
57
+ DJVU r | INSP r/w | NEF r/w | RAM r |
58
+ DLL r | INSV r | NKSC r/w | RAR r |
59
+ DNG r/w | INX r | NRW r/w | RAW r/w |
60
+ DOC r | ISO r | NUMBERS r | RIFF r |
60
61
 
61
62
  Meta Information
62
63
  ----------------------+----------------------+---------------------
@@ -108,8 +109,8 @@ your home directory, then you would type the following commands in a
108
109
  terminal window to extract and run ExifTool:
109
110
 
110
111
  cd ~/Desktop
111
- gzip -dc Image-ExifTool-12.73.tar.gz | tar -xf -
112
- cd Image-ExifTool-12.73
112
+ gzip -dc Image-ExifTool-12.75.tar.gz | tar -xf -
113
+ cd Image-ExifTool-12.75
113
114
  ./exiftool t/images/ExifTool.jpg
114
115
 
115
116
  Note: These commands extract meta information from one of the test images.
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.73';
14
+ my $version = '12.75';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  my $exePath;
@@ -70,7 +70,7 @@ sub PreserveTime();
70
70
  sub AbsPath($);
71
71
  sub MyConvertFileName($$);
72
72
  sub SuggestedExtension($$$);
73
- sub LoadPrintFormat($);
73
+ sub LoadPrintFormat($;$);
74
74
  sub FilenameSPrintf($;$@);
75
75
  sub NextUnusedFilename($;$);
76
76
  sub CreateDirectory($);
@@ -271,7 +271,7 @@ my %optArgs = (
271
271
  '-lang' => 0, # (optional arg; cannot begin with "-")
272
272
  '-listitem' => 1,
273
273
  '-o' => 1, '-out' => 1,
274
- '-p' => 1, '-printformat' => 1,
274
+ '-p' => 1, '-printformat' => 1, '-p-' => 1, '-printformat-' => 1,
275
275
  '-P' => 0,
276
276
  '-password' => 1,
277
277
  '-require' => 1,
@@ -573,7 +573,7 @@ if ($^O eq 'MSWin32' and eval { require File::Glob }) {
573
573
  $doGlob = 1;
574
574
  }
575
575
 
576
- $mt = new Image::ExifTool; # create ExifTool object
576
+ $mt = Image::ExifTool->new; # create ExifTool object
577
577
 
578
578
  # don't extract duplicates by default unless set by UserDefined::Options
579
579
  $mt->Options(Duplicates => 0) unless %Image::ExifTool::UserDefined::Options
@@ -1133,10 +1133,10 @@ for (;;) {
1133
1133
  }
1134
1134
  /^overwrite_original$/i and $overwriteOrig = 1, next;
1135
1135
  /^overwrite_original_in_place$/i and $overwriteOrig = 2, next;
1136
- if (/^p$/ or $a eq 'printformat') {
1136
+ if (/^p(-?)$/ or /^printformat(-?)$/i) {
1137
1137
  my $fmt = shift;
1138
1138
  if ($pass) {
1139
- LoadPrintFormat($fmt);
1139
+ LoadPrintFormat($fmt, $1);
1140
1140
  # load MWG module now if necessary
1141
1141
  if (not $useMWG and grep /^mwg:/i, @requestTags) {
1142
1142
  $useMWG = 1;
@@ -1145,7 +1145,7 @@ for (;;) {
1145
1145
  }
1146
1146
  } else {
1147
1147
  # defer to next pass so the filename charset is available
1148
- push @nextPass, '-p', $fmt;
1148
+ push @nextPass, "-$_", $fmt;
1149
1149
  }
1150
1150
  next;
1151
1151
  }
@@ -1792,7 +1792,7 @@ if (not $altEnc and $mt->Options('Lang') ne 'en' and eval { require Encode }) {
1792
1792
  if (@fileOrder) {
1793
1793
  my @allFiles;
1794
1794
  ProcessFiles($mt, \@allFiles);
1795
- my $sortTool = new Image::ExifTool;
1795
+ my $sortTool = Image::ExifTool->new;
1796
1796
  $sortTool->Options(FastScan => $fileOrderFast) if $fileOrderFast;
1797
1797
  $sortTool->Options(PrintConv => $mt->Options('PrintConv'));
1798
1798
  $sortTool->Options(Duplicates => 0);
@@ -2080,7 +2080,7 @@ sub GetImageInfo($$)
2080
2080
  @foundTags = ('*', @tags) if @tags;
2081
2081
  $info = $et->ImageInfo(Infile($pipe,$isWriting), \@foundTags, $opts);
2082
2082
  foreach $condition (@condition) {
2083
- my $cond = $et->InsertTagValues(\@foundTags, $condition, \%info);
2083
+ my $cond = $et->InsertTagValues($condition, \@foundTags, \%info);
2084
2084
  {
2085
2085
  # set package so eval'd functions are in Image::ExifTool namespace
2086
2086
  package Image::ExifTool;
@@ -2281,7 +2281,7 @@ sub GetImageInfo($$)
2281
2281
  my @lines;
2282
2282
  my $opt = $type eq 'IF' ? 'Silent' : 'Warn'; # silence "IF" warnings
2283
2283
  foreach (@$prf) {
2284
- my $line = $et->InsertTagValues(\@foundTags, $_, $opt, $grp, $cache);
2284
+ my $line = $et->InsertTagValues($_, \@foundTags, $opt, $grp, $cache);
2285
2285
  if ($type eq 'IF') {
2286
2286
  $skipBody = 1 unless defined $line;
2287
2287
  } elsif (defined $line) {
@@ -2714,7 +2714,7 @@ TAG: foreach $tag (@foundTags) {
2714
2714
  } elsif ($fixLen == 1) {
2715
2715
  $padLen -= length Encode::decode_utf8($desc);
2716
2716
  } else {
2717
- my $gcstr = eval { new Unicode::GCString(Encode::decode_utf8($desc)) };
2717
+ my $gcstr = eval { Unicode::GCString->new(Encode::decode_utf8($desc)) };
2718
2718
  if ($gcstr) {
2719
2719
  $padLen -= $gcstr->columns;
2720
2720
  } else {
@@ -3640,7 +3640,7 @@ sub Infile($;$)
3640
3640
  if ($rafStdin) {
3641
3641
  $rafStdin->Seek(0); # rewind
3642
3642
  } elsif (open RAF_STDIN, '-') {
3643
- $rafStdin = new File::RandomAccess(\*RAF_STDIN);
3643
+ $rafStdin = File::RandomAccess->new(\*RAF_STDIN);
3644
3644
  $rafStdin->BinMode();
3645
3645
  }
3646
3646
  return $rafStdin if $rafStdin;
@@ -4109,6 +4109,10 @@ sub SuggestedExtension($$$)
4109
4109
  $ext = 'pict';
4110
4110
  } elsif ($$valPt =~ /^\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl/s) {
4111
4111
  $ext = 'jxl';
4112
+ } elsif ($$valPt =~ /^.{4}jumb\0.{3}jumdc2pa/s) {
4113
+ $ext = 'c2pa';
4114
+ } elsif ($tag eq 'JUMBF') {
4115
+ $ext = 'jumbf';
4112
4116
  } else {
4113
4117
  $ext = 'dat';
4114
4118
  }
@@ -4117,12 +4121,12 @@ sub SuggestedExtension($$$)
4117
4121
 
4118
4122
  #------------------------------------------------------------------------------
4119
4123
  # Load print format file
4120
- # Inputs: 0) file name
4124
+ # Inputs: 0) file name, 1) flag to avoid adding newline to input argument
4121
4125
  # - saves lines of file to %printFmt list
4122
4126
  # - adds tag names to @tags list
4123
- sub LoadPrintFormat($)
4127
+ sub LoadPrintFormat($;$)
4124
4128
  {
4125
- my $arg = shift;
4129
+ my ($arg, $noNL) = @_;
4126
4130
  if (not defined $arg) {
4127
4131
  Error "Must specify file or expression for -p option\n";
4128
4132
  } elsif ($arg !~ /\n/ and -f $arg and $mt->Open(\*FMT_FILE, $arg)) {
@@ -4131,7 +4135,8 @@ sub LoadPrintFormat($)
4131
4135
  }
4132
4136
  close(FMT_FILE);
4133
4137
  } else {
4134
- AddPrintFormat($arg . "\n");
4138
+ $arg .= "\n" unless $noNL;
4139
+ AddPrintFormat($arg);
4135
4140
  }
4136
4141
  }
4137
4142
 
@@ -4295,7 +4300,7 @@ sub CreateDirectory($)
4295
4300
  return 0;
4296
4301
  }
4297
4302
  unless ($k32CreateDir) {
4298
- $k32CreateDir = new Win32::API('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4303
+ $k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4299
4304
  }
4300
4305
  $success = $k32CreateDir->Call($d2, 0) if $k32CreateDir;
4301
4306
  } else {
@@ -4644,49 +4649,50 @@ supported by ExifTool (r = read, w = write, c = create):
4644
4649
 
4645
4650
  File Types
4646
4651
  ------------+-------------+-------------+-------------+------------
4647
- 360 r/w | DOCX r | ISO r | NRW r/w | RAR r
4648
- 3FR r | DPX r | ITC r | NUMBERS r | RAW r/w
4649
- 3G2 r/w | DR4 r/w/c | J2C r | O r | RIFF r
4650
- 3GP r/w | DSS r | JNG r/w | ODP r | RSRC r
4651
- 7Z r | DV r | JP2 r/w | ODS r | RTF r
4652
- A r | DVB r/w | JPEG r/w | ODT r | RW2 r/w
4653
- AA r | DVR-MS r | JSON r | OFR r | RWL r/w
4654
- AAC r | DYLIB r | JXL r | OGG r | RWZ r
4655
- AAE r | EIP r | K25 r | OGV r | RM r
4656
- AAX r/w | EPS r/w | KDC r | ONP r | SEQ r
4657
- ACR r | EPUB r | KEY r | OPUS r | SKETCH r
4658
- AFM r | ERF r/w | LA r | ORF r/w | SO r
4659
- AI r/w | EXE r | LFP r | ORI r/w | SR2 r/w
4660
- AIFF r | EXIF r/w/c | LIF r | OTF r | SRF r
4661
- APE r | EXR r | LNK r | PAC r | SRW r/w
4662
- ARQ r/w | EXV r/w/c | LRV r/w | PAGES r | SVG r
4663
- ARW r/w | F4A/V r/w | M2TS r | PBM r/w | SWF r
4664
- ASF r | FFF r/w | M4A/V r/w | PCD r | THM r/w
4665
- AVI r | FITS r | MACOS r | PCX r | TIFF r/w
4666
- AVIF r/w | FLA r | MAX r | PDB r | TORRENT r
4667
- AZW r | FLAC r | MEF r/w | PDF r/w | TTC r
4668
- BMP r | FLIF r/w | MIE r/w/c | PEF r/w | TTF r
4669
- BPG r | FLV r | MIFF r | PFA r | TXT r
4670
- BTF r | FPF r | MKA r | PFB r | VCF r
4671
- CHM r | FPX r | MKS r | PFM r | VNT r
4672
- COS r | GIF r/w | MKV r | PGF r | VRD r/w/c
4673
- CR2 r/w | GLV r/w | MNG r/w | PGM r/w | VSD r
4674
- CR3 r/w | GPR r/w | MOBI r | PLIST r | WAV r
4675
- CRM r/w | GZ r | MODD r | PICT r | WDP r/w
4676
- CRW r/w | HDP r/w | MOI r | PMP r | WEBP r/w
4677
- CS1 r/w | HDR r | MOS r/w | PNG r/w | WEBM r
4678
- CSV r | HEIC r/w | MOV r/w | PPM r/w | WMA r
4679
- CUR r | HEIF r/w | MP3 r | PPT r | WMV r
4680
- CZI r | HTML r | MP4 r/w | PPTX r | WPG r
4681
- DCM r | ICC r/w/c | MPC r | PS r/w | WTV r
4682
- DCP r/w | ICO r | MPG r | PSB r/w | WV r
4683
- DCR r | ICS r | MPO r/w | PSD r/w | X3F r/w
4684
- DFONT r | IDML r | MQV r/w | PSP r | XCF r
4685
- DIVX r | IIQ r/w | MRC r | QTIF r/w | XISF r
4686
- DJVU r | IND r/w | MRW r/w | R3D r | XLS r
4687
- DLL r | INSP r/w | MXF r | RA r | XLSX r
4688
- DNG r/w | INSV r | NEF r/w | RAF r/w | XMP r/w/c
4689
- DOC r | INX r | NKSC r/w | RAM r | ZIP r
4652
+ 360 r/w | DOCX r | ITC r | O r | RSRC r
4653
+ 3FR r | DPX r | J2C r | ODP r | RTF r
4654
+ 3G2 r/w | DR4 r/w/c | JNG r/w | ODS r | RW2 r/w
4655
+ 3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
4656
+ 7Z r | DV r | JPEG r/w | OFR r | RWZ r
4657
+ A r | DVB r/w | JSON r | OGG r | RM r
4658
+ AA r | DVR-MS r | JXL r | OGV r | SEQ r
4659
+ AAC r | DYLIB r | K25 r | ONP r | SKETCH r
4660
+ AAE r | EIP r | KDC r | OPUS r | SO r
4661
+ AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
4662
+ ACR r | EPUB r | LA r | ORI r/w | SRF r
4663
+ AFM r | ERF r/w | LFP r | OTF r | SRW r/w
4664
+ AI r/w | EXE r | LIF r | PAC r | SVG r
4665
+ AIFF r | EXIF r/w/c | LNK r | PAGES r | SWF r
4666
+ APE r | EXR r | LRV r/w | PBM r/w | THM r/w
4667
+ ARQ r/w | EXV r/w/c | M2TS r | PCD r | TIFF r/w
4668
+ ARW r/w | F4A/V r/w | M4A/V r/w | PCX r | TORRENT r
4669
+ ASF r | FFF r/w | MACOS r | PDB r | TTC r
4670
+ AVI r | FITS r | MAX r | PDF r/w | TTF r
4671
+ AVIF r/w | FLA r | MEF r/w | PEF r/w | TXT r
4672
+ AZW r | FLAC r | MIE r/w/c | PFA r | VCF r
4673
+ BMP r | FLIF r/w | MIFF r | PFB r | VNT r
4674
+ BPG r | FLV r | MKA r | PFM r | VRD r/w/c
4675
+ BTF r | FPF r | MKS r | PGF r | VSD r
4676
+ C2PA r | FPX r | MKV r | PGM r/w | WAV r
4677
+ CHM r | GIF r/w | MNG r/w | PLIST r | WDP r/w
4678
+ COS r | GLV r/w | MOBI r | PICT r | WEBP r/w
4679
+ CR2 r/w | GPR r/w | MODD r | PMP r | WEBM r
4680
+ CR3 r/w | GZ r | MOI r | PNG r/w | WMA r
4681
+ CRM r/w | HDP r/w | MOS r/w | PPM r/w | WMV r
4682
+ CRW r/w | HDR r | MOV r/w | PPT r | WPG r
4683
+ CS1 r/w | HEIC r/w | MP3 r | PPTX r | WTV r
4684
+ CSV r | HEIF r/w | MP4 r/w | PS r/w | WV r
4685
+ CUR r | HTML r | MPC r | PSB r/w | X3F r/w
4686
+ CZI r | ICC r/w/c | MPG r | PSD r/w | XCF r
4687
+ DCM r | ICO r | MPO r/w | PSP r | XISF r
4688
+ DCP r/w | ICS r | MQV r/w | QTIF r/w | XLS r
4689
+ DCR r | IDML r | MRC r | R3D r | XLSX r
4690
+ DFONT r | IIQ r/w | MRW r/w | RA r | XMP r/w/c
4691
+ DIVX r | IND r/w | MXF r | RAF r/w | ZIP r
4692
+ DJVU r | INSP r/w | NEF r/w | RAM r |
4693
+ DLL r | INSV r | NKSC r/w | RAR r |
4694
+ DNG r/w | INX r | NRW r/w | RAW r/w |
4695
+ DOC r | ISO r | NUMBERS r | RIFF r |
4690
4696
 
4691
4697
  Meta Information
4692
4698
  ----------------------+----------------------+---------------------
@@ -4752,7 +4758,7 @@ L<Input-output text formatting|/Input-output text formatting>
4752
4758
  -lang [LANG] Set current language
4753
4759
  -listItem INDEX Extract specific item from a list
4754
4760
  -n (--printConv) No print conversion
4755
- -p FMTFILE (-printFormat) Print output in specified format
4761
+ -p[-] STR (-printFormat) Print output in specified format
4756
4762
  -php Export tags as a PHP Array
4757
4763
  -s[NUM] (-short) Short output format (-s for tag names)
4758
4764
  -S (-veryShort) Very short output format
@@ -5561,30 +5567,31 @@ when writing. For example, the following commands all have the same effect:
5561
5567
  > exiftool -Orientation=6 -n a.jpg
5562
5568
  > exiftool -Orientation#=6 a.jpg
5563
5569
 
5564
- =item B<-p> I<FMTFILE> or I<STR> (B<-printFormat>)
5570
+ =item B<-p>[-] I<STR> or I<FMTFILE> (B<-printFormat>)
5565
5571
 
5566
- Print output in the format specified by the given file or string. The
5572
+ Print output in the format specified by the given string or file. The
5567
5573
  argument is interpreted as a string unless a file of that name exists, in
5568
5574
  which case the string is loaded from the contents of the file. Tag names in
5569
- the format file or string begin with a C<$> symbol and may contain leading
5575
+ the format string or file begin with a C<$> symbol and may contain leading
5570
5576
  group names and/or a trailing C<#> (to disable print conversion). Case is
5571
5577
  not significant. Braces C<{}> may be used around the tag name to separate
5572
5578
  it from subsequent text (and must be used if subsequent text begins with an
5573
5579
  alphanumeric character, hyphen, underline, colon or number sign). Use C<$$>
5574
- to represent a C<$> symbol, and C<$/> for a newline.
5575
-
5576
- Multiple B<-p> options may be used, each contributing a line (or more) of
5577
- text to the output. Lines beginning with C<#[HEAD]> and C<#[TAIL]> are
5578
- output before the first processed file and after the last processed file
5579
- respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]> are output
5580
- before and after each section of files. A section is defined as a group of
5581
- consecutive files with the same section header (eg. files are grouped by
5582
- directory if C<#[SECT]> contains C<$directory>). Lines beginning with
5583
- C<#[BODY]> and lines not beginning with C<#> are output for each processed
5584
- file. Lines beginning with C<#[IF]> are not output, but all BODY lines are
5585
- skipped if any tag on an IF line doesn't exist. Other lines beginning with
5586
- C<#> are ignored. (To output a line beginning with C<#>, use C<#[BODY]#>.)
5587
- For example, this format file:
5580
+ to represent a C<$> symbol, and C<$/> for a newline. When the string
5581
+ argument is used (ie. I<STR>), a newline is added to the end of the string
5582
+ unless B<-p-> is specified.
5583
+
5584
+ Multiple B<-p> options may be used. Lines beginning with C<#[HEAD]> and
5585
+ C<#[TAIL]> are output before the first processed file and after the last
5586
+ processed file respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]>
5587
+ are output before and after each section of files. A section is defined as
5588
+ a group of consecutive files with the same section header (eg. files are
5589
+ grouped by directory if C<#[SECT]> contains C<$directory>). Lines beginning
5590
+ with C<#[BODY]> and lines not beginning with C<#> are output for each
5591
+ processed file. Lines beginning with C<#[IF]> are not output, but all BODY
5592
+ lines are skipped if any tag on an IF line doesn't exist. Other lines
5593
+ beginning with C<#> are ignored. (To output a line beginning with C<#>, use
5594
+ C<#[BODY]#>.) For example, this format file:
5588
5595
 
5589
5596
  # this is a comment line
5590
5597
  #[HEAD]-- Generated by ExifTool $exifToolVersion --
@@ -5598,16 +5605,21 @@ with this command:
5598
5605
 
5599
5606
  produces output like this:
5600
5607
 
5601
- -- Generated by ExifTool 12.73 --
5608
+ -- Generated by ExifTool 12.75 --
5602
5609
  File: a.jpg - 2003:10:31 15:44:19
5603
5610
  (f/5.6, 1/60s, ISO 100)
5604
5611
  File: b.jpg - 2006:05:23 11:57:38
5605
5612
  (f/8.0, 1/13s, ISO 100)
5606
5613
  -- end --
5607
5614
 
5608
- The values of List-type tags with multiple items and Shortcut tags
5609
- representing multiple tags are joined according the B<-sep> option setting
5610
- when interpolated in the string.
5615
+ The values of List-type tags with multiple items, Shortcut tags representing
5616
+ multiple tags, and matching tags when the C<All> group is specified are
5617
+ joined according the B<-sep> option setting when interpolated in the string.
5618
+ (Note that when C<All> is used as a group name, dupicate tags are included
5619
+ regardless of the Duplicates option setting.) When C<All> is used as a tag
5620
+ name, a value of 1 is returned if any tag exists in the specified group, or
5621
+ 0 otherwise (unless the C<All> group is also specified, in which case the
5622
+ values of all matching tags are joined).
5611
5623
 
5612
5624
  When B<-ee> (B<-extractEmbedded>) is combined with B<-p>, embedded documents
5613
5625
  are effectively processed as separate input files.
@@ -6550,7 +6562,9 @@ set to undef if C<=> is used, or an empty string with C<^=>. If I<OPT> is
6550
6562
  not specified a list of available options is returned. The option name is
6551
6563
  not case senstive, but the option values are. See
6552
6564
  L<Image::ExifTool Options|Image::ExifTool/Options> for option details. This
6553
- overrides API options set via the config file.
6565
+ overrides API options set via the config file. Note that the exiftool app
6566
+ sets some API options internally, and attempts to change these via the
6567
+ command line will have no effect.
6554
6568
 
6555
6569
  =item B<-common_args>
6556
6570
 
@@ -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,6 +26,9 @@
25
26
  #
26
27
  # May also be used for string i/o (just pass a scalar reference)
27
28
  #
29
+ # Sets internal ERROR member from $! if there is an error reading
30
+ # the file.
31
+ #
28
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.
@@ -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) {