exiftool-vendored.pl 12.73.0 → 12.78.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 (70) hide show
  1. package/bin/Changes +94 -6
  2. package/bin/MANIFEST +4 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +46 -45
  6. package/bin/config_files/example.config +10 -2
  7. package/bin/exiftool +143 -94
  8. package/bin/lib/File/RandomAccess.pm +31 -5
  9. package/bin/lib/File/RandomAccess.pod +4 -4
  10. package/bin/lib/Image/ExifTool/7Z.pm +3 -3
  11. package/bin/lib/Image/ExifTool/AFCP.pm +2 -2
  12. package/bin/lib/Image/ExifTool/BZZ.pm +2 -2
  13. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -7
  14. package/bin/lib/Image/ExifTool/Canon.pm +17 -13
  15. package/bin/lib/Image/ExifTool/CanonVRD.pm +8 -2
  16. package/bin/lib/Image/ExifTool/DICOM.pm +2 -2
  17. package/bin/lib/Image/ExifTool/DNG.pm +4 -4
  18. package/bin/lib/Image/ExifTool/Exif.pm +54 -5
  19. package/bin/lib/Image/ExifTool/FLIR.pm +2 -2
  20. package/bin/lib/Image/ExifTool/Fixup.pm +3 -3
  21. package/bin/lib/Image/ExifTool/FlashPix.pm +3 -3
  22. package/bin/lib/Image/ExifTool/FujiFilm.pm +8 -3
  23. package/bin/lib/Image/ExifTool/GPS.pm +5 -3
  24. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  25. package/bin/lib/Image/ExifTool/Geolocation.pm +237 -0
  26. package/bin/lib/Image/ExifTool/Geotag.pm +4 -4
  27. package/bin/lib/Image/ExifTool/HtmlDump.pm +7 -4
  28. package/bin/lib/Image/ExifTool/ID3.pm +2 -2
  29. package/bin/lib/Image/ExifTool/Import.pm +9 -6
  30. package/bin/lib/Image/ExifTool/JSON.pm +11 -11
  31. package/bin/lib/Image/ExifTool/Jpeg2000.pm +51 -12
  32. package/bin/lib/Image/ExifTool/MIE.pm +3 -3
  33. package/bin/lib/Image/ExifTool/MWG.pm +1 -0
  34. package/bin/lib/Image/ExifTool/MacOS.pm +19 -4
  35. package/bin/lib/Image/ExifTool/MinoltaRaw.pm +2 -2
  36. package/bin/lib/Image/ExifTool/Nikon.pm +5 -3
  37. package/bin/lib/Image/ExifTool/NikonCustom.pm +3 -3
  38. package/bin/lib/Image/ExifTool/Ogg.pm +4 -3
  39. package/bin/lib/Image/ExifTool/Olympus.pm +3 -1
  40. package/bin/lib/Image/ExifTool/PDF.pm +59 -9
  41. package/bin/lib/Image/ExifTool/PLIST.pm +3 -3
  42. package/bin/lib/Image/ExifTool/PanasonicRaw.pm +3 -3
  43. package/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  44. package/bin/lib/Image/ExifTool/PhaseOne.pm +2 -2
  45. package/bin/lib/Image/ExifTool/Photoshop.pm +3 -3
  46. package/bin/lib/Image/ExifTool/PostScript.pm +2 -2
  47. package/bin/lib/Image/ExifTool/QuickTime.pm +223 -117
  48. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +260 -242
  49. package/bin/lib/Image/ExifTool/RSRC.pm +2 -2
  50. package/bin/lib/Image/ExifTool/Samsung.pm +4 -4
  51. package/bin/lib/Image/ExifTool/Shift.pl +1 -2
  52. package/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -3
  53. package/bin/lib/Image/ExifTool/Sony.pm +3 -3
  54. package/bin/lib/Image/ExifTool/TagInfoXML.pm +2 -2
  55. package/bin/lib/Image/ExifTool/TagLookup.pm +85 -8
  56. package/bin/lib/Image/ExifTool/TagNames.pod +148 -8
  57. package/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  58. package/bin/lib/Image/ExifTool/WriteExif.pl +26 -23
  59. package/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
  60. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +15 -2
  61. package/bin/lib/Image/ExifTool/WriteXMP.pl +4 -2
  62. package/bin/lib/Image/ExifTool/Writer.pl +77 -52
  63. package/bin/lib/Image/ExifTool/XMP.pm +2 -1
  64. package/bin/lib/Image/ExifTool/XMP2.pl +9 -0
  65. package/bin/lib/Image/ExifTool/ZIP.pm +6 -6
  66. package/bin/lib/Image/ExifTool.pm +204 -63
  67. package/bin/lib/Image/ExifTool.pod +118 -94
  68. package/bin/perl-Image-ExifTool.spec +45 -44
  69. package/bin/pp_build_exe.args +4 -230
  70. package/package.json +4 -4
package/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.78';
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($);
@@ -166,6 +166,7 @@ my $filtered; # flag indicating file was filtered by name
166
166
  my $filterFlag; # file filter flag (0x01=deny extensions, 0x02=allow extensions, 0x04=add ext)
167
167
  my $fixLen; # flag to fix description lengths when writing alternate languages
168
168
  my $forcePrint; # string to use for missing tag values (undef to not print them)
169
+ my $geoOnly; # flag to extract Geolocation tags only
169
170
  my $helped; # flag to avoid printing help if no tags specified
170
171
  my $html; # flag for html-formatted output (2=html dump)
171
172
  my $interrupted; # flag set if CTRL-C is pressed during a critical process
@@ -271,7 +272,7 @@ my %optArgs = (
271
272
  '-lang' => 0, # (optional arg; cannot begin with "-")
272
273
  '-listitem' => 1,
273
274
  '-o' => 1, '-out' => 1,
274
- '-p' => 1, '-printformat' => 1,
275
+ '-p' => 1, '-printformat' => 1, '-p-' => 1, '-printformat-' => 1,
275
276
  '-P' => 0,
276
277
  '-password' => 1,
277
278
  '-require' => 1,
@@ -490,6 +491,7 @@ undef $fileHeader;
490
491
  undef $filtered;
491
492
  undef $fixLen;
492
493
  undef $forcePrint;
494
+ undef $geoOnly;
493
495
  undef $ignoreHidden;
494
496
  undef $joinLists;
495
497
  undef $langOpt;
@@ -573,7 +575,7 @@ if ($^O eq 'MSWin32' and eval { require File::Glob }) {
573
575
  $doGlob = 1;
574
576
  }
575
577
 
576
- $mt = new Image::ExifTool; # create ExifTool object
578
+ $mt = Image::ExifTool->new; # create ExifTool object
577
579
 
578
580
  # don't extract duplicates by default unless set by UserDefined::Options
579
581
  $mt->Options(Duplicates => 0) unless %Image::ExifTool::UserDefined::Options
@@ -587,6 +589,11 @@ if (not $preserveTime and $^O eq 'MSWin32') {
587
589
  $preserveTime = 2 if eval { require Win32::API } and eval { require Win32API::File };
588
590
  }
589
591
 
592
+ # add user-defined command-line arguments
593
+ if (@Image::ExifTool::UserDefined::Arguments) {
594
+ unshift @ARGV, @Image::ExifTool::UserDefined::Arguments;
595
+ }
596
+
590
597
  # parse command-line options in 2 passes...
591
598
  # pass 1: set all of our ExifTool options
592
599
  # pass 2: print all of our help and informational output (-list, -ver, etc)
@@ -1133,10 +1140,10 @@ for (;;) {
1133
1140
  }
1134
1141
  /^overwrite_original$/i and $overwriteOrig = 1, next;
1135
1142
  /^overwrite_original_in_place$/i and $overwriteOrig = 2, next;
1136
- if (/^p$/ or $a eq 'printformat') {
1143
+ if (/^p(-?)$/ or /^printformat(-?)$/i) {
1137
1144
  my $fmt = shift;
1138
1145
  if ($pass) {
1139
- LoadPrintFormat($fmt);
1146
+ LoadPrintFormat($fmt, $1);
1140
1147
  # load MWG module now if necessary
1141
1148
  if (not $useMWG and grep /^mwg:/i, @requestTags) {
1142
1149
  $useMWG = 1;
@@ -1145,7 +1152,7 @@ for (;;) {
1145
1152
  }
1146
1153
  } else {
1147
1154
  # defer to next pass so the filename charset is available
1148
- push @nextPass, '-p', $fmt;
1155
+ push @nextPass, "-$_", $fmt;
1149
1156
  }
1150
1157
  next;
1151
1158
  }
@@ -1414,6 +1421,13 @@ if ($useMWG and not defined $mt->Options('CharsetEXIF')) {
1414
1421
  $mt->Options(CharsetEXIF => 'UTF8');
1415
1422
  }
1416
1423
 
1424
+ # allow geolocation without input file if set to a position
1425
+ if (not @files and not $outOpt and not @newValues) {
1426
+ my $loc = $mt->Options('Geolocation');
1427
+ # use undocumented feature to input JSON file directly from command line
1428
+ $loc and $loc =~ /,/ and push(@files, qq(\@JSON:{})), $geoOnly = 1;
1429
+ }
1430
+
1417
1431
  # print help
1418
1432
  unless ((@tags and not $outOpt) or @files or @newValues) {
1419
1433
  if ($doGlob and $doGlob == 2) {
@@ -1792,7 +1806,7 @@ if (not $altEnc and $mt->Options('Lang') ne 'en' and eval { require Encode }) {
1792
1806
  if (@fileOrder) {
1793
1807
  my @allFiles;
1794
1808
  ProcessFiles($mt, \@allFiles);
1795
- my $sortTool = new Image::ExifTool;
1809
+ my $sortTool = Image::ExifTool->new;
1796
1810
  $sortTool->Options(FastScan => $fileOrderFast) if $fileOrderFast;
1797
1811
  $sortTool->Options(PrintConv => $mt->Options('PrintConv'));
1798
1812
  $sortTool->Options(Duplicates => 0);
@@ -2080,7 +2094,7 @@ sub GetImageInfo($$)
2080
2094
  @foundTags = ('*', @tags) if @tags;
2081
2095
  $info = $et->ImageInfo(Infile($pipe,$isWriting), \@foundTags, $opts);
2082
2096
  foreach $condition (@condition) {
2083
- my $cond = $et->InsertTagValues(\@foundTags, $condition, \%info);
2097
+ my $cond = $et->InsertTagValues($condition, \@foundTags, \%info);
2084
2098
  {
2085
2099
  # set package so eval'd functions are in Image::ExifTool namespace
2086
2100
  package Image::ExifTool;
@@ -2113,6 +2127,11 @@ sub GetImageInfo($$)
2113
2127
  # can't make use of $info if verbose because we must reprocess
2114
2128
  # the file anyway to generate the verbose output
2115
2129
  undef $info if $verbose or defined $fastCondition;
2130
+ } elsif ($file =~ s/^(\@JSON:)(.*)/$1/) {
2131
+ # read JSON file from command line
2132
+ my $dat = $2;
2133
+ $info = $et->ImageInfo(\$dat, \@foundTags);
2134
+ if ($geoOnly) { /^Geolocation/ or delete $$info{$_} foreach keys %$info }
2116
2135
  }
2117
2136
  if (defined $deleteOrig) {
2118
2137
  Progress($vout, "======== $file") if defined $verbose;
@@ -2169,7 +2188,7 @@ sub GetImageInfo($$)
2169
2188
  }
2170
2189
 
2171
2190
  # extract information from this file
2172
- unless ($file eq '-' or $et->Exists($file)) {
2191
+ unless ($file eq '-' or $et->Exists($file) or $info) {
2173
2192
  Warn "Error: File not found - $file\n";
2174
2193
  FileNotFound($file);
2175
2194
  defined $outfile and close($fp), undef($tmpText), $et->Unlink($outfile);
@@ -2281,7 +2300,7 @@ sub GetImageInfo($$)
2281
2300
  my @lines;
2282
2301
  my $opt = $type eq 'IF' ? 'Silent' : 'Warn'; # silence "IF" warnings
2283
2302
  foreach (@$prf) {
2284
- my $line = $et->InsertTagValues(\@foundTags, $_, $opt, $grp, $cache);
2303
+ my $line = $et->InsertTagValues($_, \@foundTags, $opt, $grp, $cache);
2285
2304
  if ($type eq 'IF') {
2286
2305
  $skipBody = 1 unless defined $line;
2287
2306
  } elsif (defined $line) {
@@ -2354,7 +2373,7 @@ sub GetImageInfo($$)
2354
2373
  # set delimiters for JSON or PHP output
2355
2374
  ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
2356
2375
  print $fp ",\n" if $comma;
2357
- print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file));
2376
+ print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file),1);
2358
2377
  $comma = 1;
2359
2378
  $ind = (defined $showGroup and not $allGroup) ? ' ' : ' ';
2360
2379
  } elsif ($csv) {
@@ -2714,7 +2733,7 @@ TAG: foreach $tag (@foundTags) {
2714
2733
  } elsif ($fixLen == 1) {
2715
2734
  $padLen -= length Encode::decode_utf8($desc);
2716
2735
  } else {
2717
- my $gcstr = eval { new Unicode::GCString(Encode::decode_utf8($desc)) };
2736
+ my $gcstr = eval { Unicode::GCString->new(Encode::decode_utf8($desc)) };
2718
2737
  if ($gcstr) {
2719
2738
  $padLen -= $gcstr->columns;
2720
2739
  } else {
@@ -3372,7 +3391,22 @@ sub FormatXML($$$)
3372
3391
  my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3373
3392
  foreach (@keys) {
3374
3393
  # (some variable-namespace XML structure fields may have a different group)
3375
- my $tok = /:/ ? $_ : ($grp . ':' . $_);
3394
+ my ($ns, $tg) = ($grp, $_);
3395
+ if (/^(.*?):(.*)/) {
3396
+ if ($grp eq 'JSON') {
3397
+ $tg =~ tr/:/_/; # colons in JSON structure elements are not namespaces
3398
+ } else {
3399
+ ($ns, $tg) = ($1, $2);
3400
+ }
3401
+ }
3402
+ # validate XML attribute name
3403
+ my $name;
3404
+ foreach $name ($ns, $tg) {
3405
+ # make sure name is valid for XML
3406
+ $name =~ tr/-_A-Za-z0-9.//dc;
3407
+ $name = '_' . $name if $name !~ /^[_A-Za-z]/;
3408
+ }
3409
+ my $tok = $ns . ':' . $tg;
3376
3410
  $val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
3377
3411
  }
3378
3412
  $val = "$val2\n$ind";
@@ -3515,7 +3549,7 @@ sub PrintCSV()
3515
3549
  }
3516
3550
 
3517
3551
  #------------------------------------------------------------------------------
3518
- # Add tag groups from structure fields to a list
3552
+ # Add tag groups from structure fields to a list for xmlns
3519
3553
  # Inputs: 0) tag value, 1) parent group, 2) group hash ref, 3) group list ref
3520
3554
  sub AddGroups($$$$)
3521
3555
  {
@@ -3523,7 +3557,7 @@ sub AddGroups($$$$)
3523
3557
  my ($key, $val2);
3524
3558
  if (ref $val eq 'HASH') {
3525
3559
  foreach $key (sort keys %$val) {
3526
- if ($key =~ /(.*?):/ and not $$groupHash{$1}) {
3560
+ if ($key =~ /^(.*?):/ and not $$groupHash{$1} and $grp ne 'JSON') {
3527
3561
  $$groupHash{$1} = $grp;
3528
3562
  push @$groupList, $1;
3529
3563
  }
@@ -3640,7 +3674,7 @@ sub Infile($;$)
3640
3674
  if ($rafStdin) {
3641
3675
  $rafStdin->Seek(0); # rewind
3642
3676
  } elsif (open RAF_STDIN, '-') {
3643
- $rafStdin = new File::RandomAccess(\*RAF_STDIN);
3677
+ $rafStdin = File::RandomAccess->new(\*RAF_STDIN);
3644
3678
  $rafStdin->BinMode();
3645
3679
  }
3646
3680
  return $rafStdin if $rafStdin;
@@ -4109,6 +4143,10 @@ sub SuggestedExtension($$$)
4109
4143
  $ext = 'pict';
4110
4144
  } elsif ($$valPt =~ /^\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl/s) {
4111
4145
  $ext = 'jxl';
4146
+ } elsif ($$valPt =~ /^.{4}jumb\0.{3}jumdc2pa/s) {
4147
+ $ext = 'c2pa';
4148
+ } elsif ($tag eq 'JUMBF') {
4149
+ $ext = 'jumbf';
4112
4150
  } else {
4113
4151
  $ext = 'dat';
4114
4152
  }
@@ -4117,12 +4155,12 @@ sub SuggestedExtension($$$)
4117
4155
 
4118
4156
  #------------------------------------------------------------------------------
4119
4157
  # Load print format file
4120
- # Inputs: 0) file name
4158
+ # Inputs: 0) file name, 1) flag to avoid adding newline to input argument
4121
4159
  # - saves lines of file to %printFmt list
4122
4160
  # - adds tag names to @tags list
4123
- sub LoadPrintFormat($)
4161
+ sub LoadPrintFormat($;$)
4124
4162
  {
4125
- my $arg = shift;
4163
+ my ($arg, $noNL) = @_;
4126
4164
  if (not defined $arg) {
4127
4165
  Error "Must specify file or expression for -p option\n";
4128
4166
  } elsif ($arg !~ /\n/ and -f $arg and $mt->Open(\*FMT_FILE, $arg)) {
@@ -4131,7 +4169,8 @@ sub LoadPrintFormat($)
4131
4169
  }
4132
4170
  close(FMT_FILE);
4133
4171
  } else {
4134
- AddPrintFormat($arg . "\n");
4172
+ $arg .= "\n" unless $noNL;
4173
+ AddPrintFormat($arg);
4135
4174
  }
4136
4175
  }
4137
4176
 
@@ -4295,7 +4334,7 @@ sub CreateDirectory($)
4295
4334
  return 0;
4296
4335
  }
4297
4336
  unless ($k32CreateDir) {
4298
- $k32CreateDir = new Win32::API('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4337
+ $k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
4299
4338
  }
4300
4339
  $success = $k32CreateDir->Call($d2, 0) if $k32CreateDir;
4301
4340
  } else {
@@ -4644,49 +4683,50 @@ supported by ExifTool (r = read, w = write, c = create):
4644
4683
 
4645
4684
  File Types
4646
4685
  ------------+-------------+-------------+-------------+------------
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
4686
+ 360 r/w | DOCX r | ITC r | O r | RSRC r
4687
+ 3FR r | DPX r | J2C r | ODP r | RTF r
4688
+ 3G2 r/w | DR4 r/w/c | JNG r/w | ODS r | RW2 r/w
4689
+ 3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
4690
+ 7Z r | DV r | JPEG r/w | OFR r | RWZ r
4691
+ A r | DVB r/w | JSON r | OGG r | RM r
4692
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
4693
+ AAC r | DYLIB r | K25 r | ONP r | SKETCH r
4694
+ AAE r | EIP r | KDC r | OPUS r | SO r
4695
+ AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
4696
+ ACR r | EPUB r | LA r | ORI r/w | SRF r
4697
+ AFM r | ERF r/w | LFP r | OTF r | SRW r/w
4698
+ AI r/w | EXE r | LIF r | PAC r | SVG r
4699
+ AIFF r | EXIF r/w/c | LNK r | PAGES r | SWF r
4700
+ APE r | EXR r | LRV r/w | PBM r/w | THM r/w
4701
+ ARQ r/w | EXV r/w/c | M2TS r | PCD r | TIFF r/w
4702
+ ARW r/w | F4A/V r/w | M4A/V r/w | PCX r | TORRENT r
4703
+ ASF r | FFF r/w | MACOS r | PDB r | TTC r
4704
+ AVI r | FITS r | MAX r | PDF r/w | TTF r
4705
+ AVIF r/w | FLA r | MEF r/w | PEF r/w | TXT r
4706
+ AZW r | FLAC r | MIE r/w/c | PFA r | VCF r
4707
+ BMP r | FLIF r/w | MIFF r | PFB r | VNT r
4708
+ BPG r | FLV r | MKA r | PFM r | VRD r/w/c
4709
+ BTF r | FPF r | MKS r | PGF r | VSD r
4710
+ C2PA r | FPX r | MKV r | PGM r/w | WAV r
4711
+ CHM r | GIF r/w | MNG r/w | PLIST r | WDP r/w
4712
+ COS r | GLV r/w | MOBI r | PICT r | WEBP r/w
4713
+ CR2 r/w | GPR r/w | MODD r | PMP r | WEBM r
4714
+ CR3 r/w | GZ r | MOI r | PNG r/w | WMA r
4715
+ CRM r/w | HDP r/w | MOS r/w | PPM r/w | WMV r
4716
+ CRW r/w | HDR r | MOV r/w | PPT r | WPG r
4717
+ CS1 r/w | HEIC r/w | MP3 r | PPTX r | WTV r
4718
+ CSV r | HEIF r/w | MP4 r/w | PS r/w | WV r
4719
+ CUR r | HTML r | MPC r | PSB r/w | X3F r/w
4720
+ CZI r | ICC r/w/c | MPG r | PSD r/w | XCF r
4721
+ DCM r | ICO r | MPO r/w | PSP r | XISF r
4722
+ DCP r/w | ICS r | MQV r/w | QTIF r/w | XLS r
4723
+ DCR r | IDML r | MRC r | R3D r | XLSX r
4724
+ DFONT r | IIQ r/w | MRW r/w | RA r | XMP r/w/c
4725
+ DIVX r | IND r/w | MXF r | RAF r/w | ZIP r
4726
+ DJVU r | INSP r/w | NEF r/w | RAM r |
4727
+ DLL r | INSV r | NKSC r/w | RAR r |
4728
+ DNG r/w | INX r | NRW r/w | RAW r/w |
4729
+ DOC r | ISO r | NUMBERS r | RIFF r |
4690
4730
 
4691
4731
  Meta Information
4692
4732
  ----------------------+----------------------+---------------------
@@ -4752,7 +4792,7 @@ L<Input-output text formatting|/Input-output text formatting>
4752
4792
  -lang [LANG] Set current language
4753
4793
  -listItem INDEX Extract specific item from a list
4754
4794
  -n (--printConv) No print conversion
4755
- -p FMTFILE (-printFormat) Print output in specified format
4795
+ -p[-] STR (-printFormat) Print output in specified format
4756
4796
  -php Export tags as a PHP Array
4757
4797
  -s[NUM] (-short) Short output format (-s for tag names)
4758
4798
  -S (-veryShort) Very short output format
@@ -4818,7 +4858,7 @@ L<Advanced options|/Advanced options>
4818
4858
  -common_args Define common arguments
4819
4859
  -config CFGFILE Specify configuration file name
4820
4860
  -echo[NUM] TEXT Echo text to stdout or stderr
4821
- -efile[NUM][!] ERRFILE Save names of files with errors
4861
+ -efile[NUM][!] TXTFILE Save names of files with errors
4822
4862
  -execute[NUM] Execute multiple commands on one line
4823
4863
  -fileNUM ALTFILE Load tags from alternate file
4824
4864
  -list_dir List directories, not their contents
@@ -5210,8 +5250,9 @@ Notes:
5210
5250
  when copying tags using the B<-tagsFromFile> option.
5211
5251
 
5212
5252
  2) If the hemisphere is known, a reference direction (N, S, E or W) is
5213
- appended to each printed coordinate, but adding a C<+> to the format
5214
- specifier (eg. C<%+.6f>) prints a signed coordinate instead.
5253
+ appended to each printed coordinate, but adding a C<+> or C<-> to the format
5254
+ specifier (eg. C<%+.6f> or C<%-.6f>) prints a signed coordinate instead.
5255
+ (C<+> adds a leading "+" for positive coordinates, but C<-> does not.)
5215
5256
 
5216
5257
  3) This print formatting may be disabled with the B<-n> option to extract
5217
5258
  coordinates as signed decimal degrees.
@@ -5561,30 +5602,31 @@ when writing. For example, the following commands all have the same effect:
5561
5602
  > exiftool -Orientation=6 -n a.jpg
5562
5603
  > exiftool -Orientation#=6 a.jpg
5563
5604
 
5564
- =item B<-p> I<FMTFILE> or I<STR> (B<-printFormat>)
5605
+ =item B<-p>[-] I<STR> or I<FMTFILE> (B<-printFormat>)
5565
5606
 
5566
- Print output in the format specified by the given file or string. The
5607
+ Print output in the format specified by the given string or file. The
5567
5608
  argument is interpreted as a string unless a file of that name exists, in
5568
5609
  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
5610
+ the format string or file begin with a C<$> symbol and may contain leading
5570
5611
  group names and/or a trailing C<#> (to disable print conversion). Case is
5571
5612
  not significant. Braces C<{}> may be used around the tag name to separate
5572
5613
  it from subsequent text (and must be used if subsequent text begins with an
5573
5614
  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:
5615
+ to represent a C<$> symbol, and C<$/> for a newline. When the string
5616
+ argument is used (ie. I<STR>), a newline is added to the end of the string
5617
+ unless B<-p-> is specified.
5618
+
5619
+ Multiple B<-p> options may be used. Lines beginning with C<#[HEAD]> and
5620
+ C<#[TAIL]> are output before the first processed file and after the last
5621
+ processed file respectively. Lines beginning with C<#[SECT]> and C<#[ENDS]>
5622
+ are output before and after each section of files. A section is defined as
5623
+ a group of consecutive files with the same section header (eg. files are
5624
+ grouped by directory if C<#[SECT]> contains C<$directory>). Lines beginning
5625
+ with C<#[BODY]> and lines not beginning with C<#> are output for each
5626
+ processed file. Lines beginning with C<#[IF]> are not output, but all BODY
5627
+ lines are skipped if any tag on an IF line doesn't exist. Other lines
5628
+ beginning with C<#> are ignored. (To output a line beginning with C<#>, use
5629
+ C<#[BODY]#>.) For example, this format file:
5588
5630
 
5589
5631
  # this is a comment line
5590
5632
  #[HEAD]-- Generated by ExifTool $exifToolVersion --
@@ -5598,16 +5640,21 @@ with this command:
5598
5640
 
5599
5641
  produces output like this:
5600
5642
 
5601
- -- Generated by ExifTool 12.73 --
5643
+ -- Generated by ExifTool 12.78 --
5602
5644
  File: a.jpg - 2003:10:31 15:44:19
5603
5645
  (f/5.6, 1/60s, ISO 100)
5604
5646
  File: b.jpg - 2006:05:23 11:57:38
5605
5647
  (f/8.0, 1/13s, ISO 100)
5606
5648
  -- end --
5607
5649
 
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.
5650
+ The values of List-type tags with multiple items, Shortcut tags representing
5651
+ multiple tags, and matching tags when the C<All> group is specified are
5652
+ joined according the B<-sep> option setting when interpolated in the string.
5653
+ (Note that when C<All> is used as a group name, dupicate tags are included
5654
+ regardless of the Duplicates option setting.) When C<All> is used as a tag
5655
+ name, a value of 1 is returned if any tag exists in the specified group, or
5656
+ 0 otherwise (unless the C<All> group is also specified, in which case the
5657
+ values of all matching tags are joined).
5611
5658
 
5612
5659
  When B<-ee> (B<-extractEmbedded>) is combined with B<-p>, embedded documents
5613
5660
  are effectively processed as separate input files.
@@ -6550,7 +6597,9 @@ set to undef if C<=> is used, or an empty string with C<^=>. If I<OPT> is
6550
6597
  not specified a list of available options is returned. The option name is
6551
6598
  not case senstive, but the option values are. See
6552
6599
  L<Image::ExifTool Options|Image::ExifTool/Options> for option details. This
6553
- overrides API options set via the config file.
6600
+ overrides API options set via the config file. Note that the exiftool app
6601
+ sets some API options internally, and attempts to change these via the
6602
+ command line will have no effect.
6554
6603
 
6555
6604
  =item B<-common_args>
6556
6605
 
@@ -6582,15 +6631,15 @@ respectively) after processing is complete. For B<-echo3> and B<-echo4>,
6582
6631
  "${status}" may be used in the I<TEXT> string to represent the numerical
6583
6632
  exit status of the command (see L</EXIT STATUS>).
6584
6633
 
6585
- =item B<-efile>[I<NUM>][!] I<ERRFILE>
6634
+ =item B<-efile>[I<NUM>][!] I<TXTFILE>
6586
6635
 
6587
6636
  Save the names of files giving errors (I<NUM> missing or 1), files that were
6588
6637
  unchanged (I<NUM> is 2), files that fail the B<-if> condition (I<NUM> is 4),
6589
6638
  files that were updated (I<NUM> is 8), files that were created (I<NUM> is
6590
6639
  16), or any combination thereof by summing I<NUM> (eg. B<-efile3> is the
6591
6640
  same has having both B<-efile> and B<-efile2> options with the same
6592
- I<ERRFILE>). By default, file names are appended to any existing I<ERRFILE>,
6593
- but I<ERRFILE> is overwritten if an exclamation point is added to the option
6641
+ I<TXTFILE>). By default, file names are appended to any existing I<TXTFILE>,
6642
+ but I<TXTFILE> is overwritten if an exclamation point is added to the option
6594
6643
  (eg. B<-efile!>). Saves the name of the file specified by the B<-srcfile>
6595
6644
  option if applicable.
6596
6645
 
@@ -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) {
@@ -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
 
@@ -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);
@@ -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.08';
17
+ $VERSION = '1.09';
18
18
 
19
19
  sub ProcessAFCP($$);
20
20
 
@@ -134,7 +134,7 @@ NoAFCP: for (;;) {
134
134
  $dirBuff = $valBuff = '';
135
135
  require Image::ExifTool::Fixup;
136
136
  $fixup = $$dirInfo{Fixup};
137
- $fixup or $fixup = $$dirInfo{Fixup} = new Image::ExifTool::Fixup;
137
+ $fixup or $fixup = $$dirInfo{Fixup} = Image::ExifTool::Fixup->new;
138
138
  $vers = substr($buff, 4, 2); # get version number
139
139
  } else {
140
140
  $et->DumpTrailer($dirInfo) if $verbose or $$et{HTML_DUMP};