exiftool_vendored 12.18.0 → 12.22.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of exiftool_vendored might be problematic. Click here for more details.

Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +54 -0
  3. data/bin/MANIFEST +1 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +2 -2
  7. data/bin/config_files/example.config +1 -8
  8. data/bin/exiftool +70 -32
  9. data/bin/fmt_files/gpx.fmt +1 -1
  10. data/bin/fmt_files/gpx_wpt.fmt +1 -1
  11. data/bin/fmt_files/kml.fmt +1 -1
  12. data/bin/fmt_files/kml_track.fmt +1 -1
  13. data/bin/lib/Image/ExifTool.pm +74 -24
  14. data/bin/lib/Image/ExifTool.pod +33 -25
  15. data/bin/lib/Image/ExifTool/Apple.pm +3 -2
  16. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +20 -10
  17. data/bin/lib/Image/ExifTool/Canon.pm +6 -1
  18. data/bin/lib/Image/ExifTool/DJI.pm +6 -6
  19. data/bin/lib/Image/ExifTool/Exif.pm +5 -2
  20. data/bin/lib/Image/ExifTool/FITS.pm +13 -2
  21. data/bin/lib/Image/ExifTool/GPS.pm +22 -11
  22. data/bin/lib/Image/ExifTool/ICC_Profile.pm +2 -2
  23. data/bin/lib/Image/ExifTool/M2TS.pm +40 -4
  24. data/bin/lib/Image/ExifTool/MIE.pm +2 -2
  25. data/bin/lib/Image/ExifTool/Microsoft.pm +296 -82
  26. data/bin/lib/Image/ExifTool/Nikon.pm +2 -1
  27. data/bin/lib/Image/ExifTool/Olympus.pm +2 -2
  28. data/bin/lib/Image/ExifTool/QuickTime.pm +28 -12
  29. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +6 -5
  30. data/bin/lib/Image/ExifTool/Shortcuts.pm +9 -0
  31. data/bin/lib/Image/ExifTool/Sony.pm +51 -17
  32. data/bin/lib/Image/ExifTool/TagInfoXML.pm +1 -0
  33. data/bin/lib/Image/ExifTool/TagLookup.pm +4031 -4022
  34. data/bin/lib/Image/ExifTool/TagNames.pod +130 -95
  35. data/bin/lib/Image/ExifTool/WriteExif.pl +1 -1
  36. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +7 -5
  37. data/bin/lib/Image/ExifTool/Writer.pl +43 -10
  38. data/bin/lib/Image/ExifTool/XMP.pm +4 -4
  39. data/bin/perl-Image-ExifTool.spec +1 -1
  40. data/lib/exiftool_vendored/version.rb +1 -1
  41. metadata +20 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94a7d3e31a469a8fc6a58b020168e7076b56172144d98ffeda12f7b49d65a0a0
4
- data.tar.gz: 18000853a1b6ae5728074fa49602ff41851844abbde34022ddc8971218607cf0
3
+ metadata.gz: e2862287affdad95022ad8df06fd1b420c2861e28f5daefa50c627c42db2e396
4
+ data.tar.gz: 90b7804c201830e6cacc5b28b9ba29ef4a5fff7bb6a1cb26db1fce970495769e
5
5
  SHA512:
6
- metadata.gz: c1283d44ee24b5b60c13795ad8868359b616522db3b191060a81df0b8bde2f3f31d5dd57e7bebd05de9e2ac7a0ba1d4eba041d024824fbb077084930484ba49f
7
- data.tar.gz: 79356beb3ffe088861e355a00c66439c6a4d28c6dfe7efc4591902da5d5d32649fbf110283507c5259ac77bc73f66d5504b64478b0570dfd5df3fb2eb7805221
6
+ metadata.gz: 85a74e99266a89cf019066af0227b8d6515b153d2d5612814afa1bac1faffa874e6defa7aa524577a4031154cc81f0b74277136476cf35c6bb2aa9cc35e1148f
7
+ data.tar.gz: 42911ad4e1f2c03ff6a95cc25f3fcb47f8fbda099d6cfb669e72fefa9c743b002865225d872d179654dc79f3958d6e94feb20d7bfb317e3006c7b8bdee195e98
data/bin/Changes CHANGED
@@ -7,6 +7,60 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 12.16. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Mar. 17, 2021 - Version 12.22
11
+
12
+ - Added a few new Sony LensTypes and a new SonyModelID (thanks Jos Roost and
13
+ LibRaw)
14
+ - Added Extra BaseName tag
15
+ - Added a new CanonModelID (thanks LibRaw)
16
+ - Decode timed GPS from unlisted programs in M2TS videos with the -ee3 option
17
+ - Decode more Sony rtmd tags
18
+ - Decode some tags for the Sony ILME-FX3 (thanks Jos Roost)
19
+ - Allow negative values to be written to XMP-aux:LensID
20
+ - Recognize HEVC video program in M2TS files
21
+ - Enhanced -b option so --b suppresses tags with binary data
22
+ - Improved flexibility when writing GPS coordinates:
23
+ - Now pulls latitude and longitude from a combined GPSCoordinates string
24
+ - Recognizes the full word "South" and "West" to write negative coordinates
25
+ - Improved warning when trying to write an integer QuickTime date/time tag and
26
+ Time::Local is not available
27
+ - Convert GPSSpeed from mph to km/h in timed GPS from Garmin MP4 videos
28
+
29
+ Feb. 24, 2021 - Version 12.21
30
+
31
+ - Added a few new iOS QuickTime tags
32
+ - Decode a couple more Sony rtmd tags
33
+ - Patch to avoid possible "Use of uninitialized value" warning when attempting
34
+ to write QuickTime date/time tags with an invalid value
35
+ - Fixed problem writing Microsoft Xtra tags
36
+ - Fixed Windows daylight savings time patch for file times that was broken in
37
+ 12.19 (however directory times will not yet handle DST properly)
38
+
39
+ Feb. 23, 2021 - Version 12.20
40
+
41
+ - Added ability to write some Microsoft Xtra tags in MOV/MP4 videos
42
+ - Added two new Canon LensType values (thanks Norbert Wasser)
43
+ - Added a new Nikon LensID
44
+ - Fixed problem reading FITS comments that start before column 11
45
+
46
+ Feb. 18, 2021 - Version 12.19
47
+
48
+ - Added -list_dir option
49
+ - Added the "ls-l" Shortcut tag
50
+ - Extract Comment and History from FITS files
51
+ - Enhanced FilePermissions to include device type (similar to "ls -l")
52
+ - Changed the name of Apple ContentIdentifier tag to MediaGroupUUID
53
+ (thanks Neal Krawetz)
54
+ - Fixed a potential "substr outside of string" runtime error when reading
55
+ corrupted EXIF
56
+ - Fixed edge case where NikonScanIFD may not be copied properly when copying
57
+ MakerNotes to another file
58
+ - API Changes:
59
+ - Added ability to read/write System tags of directories
60
+ - Enhanced GetAllGroups() to support family 7 and take optional ExifTool
61
+ reference
62
+ - Changed QuickTimeHandler option default to 1
63
+
10
64
  Feb. 9, 2021 - Version 12.18
11
65
 
12
66
  - Added a new SonyModelID
data/bin/MANIFEST CHANGED
@@ -759,6 +759,7 @@ t/QuickTime_12.out
759
759
  t/QuickTime_13.out
760
760
  t/QuickTime_14.out
761
761
  t/QuickTime_15.out
762
+ t/QuickTime_16.out
762
763
  t/QuickTime_2.out
763
764
  t/QuickTime_3.out
764
765
  t/QuickTime_4.out
data/bin/META.json CHANGED
@@ -47,5 +47,5 @@
47
47
  }
48
48
  },
49
49
  "release_status" : "stable",
50
- "version" : "12.18"
50
+ "version" : "12.22"
51
51
  }
data/bin/META.yml CHANGED
@@ -28,4 +28,4 @@ recommends:
28
28
  Time::HiRes: 0
29
29
  requires:
30
30
  perl: 5.004
31
- version: 12.18
31
+ version: 12.22
data/bin/README CHANGED
@@ -106,8 +106,8 @@ your home directory, then you would type the following commands in a
106
106
  terminal window to extract and run ExifTool:
107
107
 
108
108
  cd ~/Desktop
109
- gzip -dc Image-ExifTool-12.18.tar.gz | tar -xf -
110
- cd Image-ExifTool-12.18
109
+ gzip -dc Image-ExifTool-12.22.tar.gz | tar -xf -
110
+ cd Image-ExifTool-12.22
111
111
  ./exiftool t/images/ExifTool.jpg
112
112
 
113
113
  Note: These commands extract meta information from one of the test images.
@@ -165,14 +165,7 @@
165
165
  # specified, then at least one of the Desire'd tags must exist. See
166
166
  # the Composite table in Image::ExifTool::Exif for more examples,
167
167
  # and lib/Image/ExifTool/README for all of the details.
168
- BaseName => {
169
- Require => {
170
- 0 => 'FileName',
171
- },
172
- # remove the extension from FileName
173
- ValueConv => '$val[0] =~ /(.*)\./ ? $1 : $val[0]',
174
- },
175
- # the next few examples demonstrate simplifications which may be
168
+ # The first few examples demonstrate simplifications which may be
176
169
  # used if only one tag is Require'd or Desire'd:
177
170
  # 1) the Require lookup may be replaced with a simple tag name
178
171
  # 2) "$val" may be used to represent "$val[0]" in the expression
data/bin/exiftool CHANGED
@@ -10,7 +10,7 @@
10
10
  use strict;
11
11
  require 5.004;
12
12
 
13
- my $version = '12.18';
13
+ my $version = '12.22';
14
14
 
15
15
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
16
16
  my $exeDir;
@@ -159,14 +159,17 @@ my $forcePrint; # string to use for missing tag values (undef to not print t
159
159
  my $helped; # flag to avoid printing help if no tags specified
160
160
  my $html; # flag for html-formatted output (2=html dump)
161
161
  my $interrupted; # flag set if CTRL-C is pressed during a critical process
162
+ my $isBinary; # true if value is a SCALAR ref
162
163
  my $isWriting; # flag set if we are writing tags
163
164
  my $joinLists; # flag set to join list values into a single string
164
165
  my $json; # flag for JSON/PHP output format (1=JSON, 2=PHP)
165
166
  my $langOpt; # language option
167
+ my $listDir; # treat a directory as a regular file
166
168
  my $listItem; # item number for extracting single item from a list
167
169
  my $listSep; # list item separator (', ' by default)
168
170
  my $mt; # main ExifTool object
169
171
  my $multiFile; # non-zero if we are scanning multiple files
172
+ my $noBinary; # flag set to ignore binary tags
170
173
  my $outFormat; # -1=Canon format, 0=same-line, 1=tag names, 2=values only
171
174
  my $outOpt; # output file or directory name
172
175
  my $overwriteOrig; # flag to overwrite original file (1=overwrite, 2=in place)
@@ -203,7 +206,6 @@ my $validFile; # flag indicating we processed a valid file
203
206
  my $verbose; # verbose setting
204
207
  my $vout; # verbose output file reference (\*STDOUT or \*STDERR)
205
208
  my $windowTitle; # title for console window
206
- my $isBinary; # true if value is a SCALAR ref
207
209
  my $xml; # flag for XML-formatted output
208
210
 
209
211
  # flag to keep the input -@ argfile open:
@@ -474,6 +476,7 @@ undef $joinLists;
474
476
  undef $langOpt;
475
477
  undef $listItem;
476
478
  undef $multiFile;
479
+ undef $noBinary;
477
480
  undef $outOpt;
478
481
  undef $preserveTime;
479
482
  undef $progress;
@@ -691,7 +694,7 @@ for (;;) {
691
694
  } else { # 'g(\d*)'
692
695
  # list all groups in specified family
693
696
  my $family = $2 || 0;
694
- PrintTagList("Groups in family $family", GetAllGroups($family));
697
+ PrintTagList("Groups in family $family", $mt->GetAllGroups($family));
695
698
  }
696
699
  next;
697
700
  }
@@ -792,7 +795,11 @@ for (;;) {
792
795
  next;
793
796
  }
794
797
  /^arg(s|format)$/i and $argFormat = 1, next;
795
- /^b(inary)?$/i and $mt->Options(Binary => 1, NoPDFList => 1), $binaryOutput = 1, next;
798
+ if (/^(-?)b(inary)?$/i) {
799
+ ($binaryOutput, $noBinary) = $1 ? (undef, 1) : (1, undef);
800
+ $mt->Options(Binary => $binaryOutput, NoPDFList => $binaryOutput);
801
+ next;
802
+ }
796
803
  if (/^c(oordFormat)?$/i) {
797
804
  my $fmt = shift;
798
805
  $fmt or Error("Expecting coordinate format for -c option\n"), $badCmd=1, next;
@@ -876,6 +883,7 @@ for (;;) {
876
883
  }
877
884
  (/^D$/ or $a eq 'decimal') and $showTagID = 'D', next;
878
885
  /^delete_original(!?)$/i and $deleteOrig = ($1 ? 2 : 1), next;
886
+ /^list_dir$/i and $listDir = 1, next;
879
887
  (/^e$/ or $a eq '-composite') and $mt->Options(Composite => 0), next;
880
888
  (/^-e$/ or $a eq 'composite') and $mt->Options(Composite => 1), next;
881
889
  (/^E$/ or $a eq 'escapehtml') and require Image::ExifTool::HTML and $escapeHTML = 1, next;
@@ -2270,6 +2278,7 @@ TAG: foreach $tag (@foundTags) {
2270
2278
  next unless $$et{REQ_TAG_LOOKUP}{$lcTag};
2271
2279
  }
2272
2280
  $val = ConvertBinary($val); # convert SCALAR references
2281
+ next unless defined $val;
2273
2282
  if ($structOpt) {
2274
2283
  # serialize structure if necessary
2275
2284
  $val = Image::ExifTool::XMP::SerializeStruct($val) unless $xml or $json;
@@ -2708,7 +2717,7 @@ sub SetImageInfo($$$)
2708
2717
  return 0;
2709
2718
  }
2710
2719
  }
2711
- if (not $isStdout and ($et->IsDirectory($outfile) or $outfile =~ /\/$/)) {
2720
+ if (not $isStdout and (($et->IsDirectory($outfile) and not $listDir) or $outfile =~ /\/$/)) {
2712
2721
  $outfile .= '/' unless $outfile =~ /\/$/;
2713
2722
  my $name = $file;
2714
2723
  $name =~ s/^.*\///s; # remove directory name
@@ -2911,6 +2920,10 @@ sub SetImageInfo($$$)
2911
2920
  unless (defined $tmpFile) {
2912
2921
  # count the number of tags and pseudo-tags we are writing
2913
2922
  my ($numSet, $numPseudo) = $et->CountNewValues();
2923
+ if ($numSet != $numPseudo and $et->IsDirectory($file)) {
2924
+ print $vout "Can't write real tags to a directory - $infile\n" if defined $verbose;
2925
+ $numSet = $numPseudo;
2926
+ }
2914
2927
  if ($et->Exists($file)) {
2915
2928
  unless ($numSet) {
2916
2929
  # no need to write if no tags set
@@ -3395,20 +3408,25 @@ sub AddGroups($$$$)
3395
3408
  #------------------------------------------------------------------------------
3396
3409
  # Convert binary data (SCALAR references) for printing
3397
3410
  # Inputs: 0) object reference
3398
- # Returns: converted object
3411
+ # Returns: converted object, or undef if we don't want binary objects
3399
3412
  sub ConvertBinary($)
3400
3413
  {
3401
3414
  my $obj = shift;
3402
3415
  my ($key, $val);
3403
3416
  if (ref $obj eq 'HASH') {
3404
3417
  foreach $key (keys %$obj) {
3405
- $$obj{$key} = ConvertBinary($$obj{$key}) if ref $$obj{$key};
3418
+ next unless ref $$obj{$key};
3419
+ $$obj{$key} = ConvertBinary($$obj{$key});
3420
+ return undef unless defined $$obj{$key};
3406
3421
  }
3407
3422
  } elsif (ref $obj eq 'ARRAY') {
3408
3423
  foreach $val (@$obj) {
3409
- $val = ConvertBinary($val) if ref $val;
3424
+ next unless ref $val;
3425
+ $val = ConvertBinary($val);
3426
+ return undef unless defined $val;
3410
3427
  }
3411
3428
  } elsif (ref $obj eq 'SCALAR') {
3429
+ return undef if $noBinary;
3412
3430
  # (binaryOutput flag is set to 0 for binary mode of XML/PHP/JSON output formats)
3413
3431
  if (defined $binaryOutput) {
3414
3432
  $obj = $$obj;
@@ -3585,7 +3603,7 @@ sub ProcessFiles($;$)
3585
3603
  ++$progressCount;
3586
3604
  $progStr = " [$progressCount/$progressMax]" if $progress;
3587
3605
  }
3588
- if ($et->IsDirectory($file)) {
3606
+ if ($et->IsDirectory($file) and not $listDir) {
3589
3607
  $multiFile = $validFile = 1;
3590
3608
  ScanDir($et, $file, $list);
3591
3609
  } elsif ($filterFlag and not AcceptFile($file)) {
@@ -4624,6 +4642,7 @@ L<Advanced options|/Advanced options>
4624
4642
  -echo[NUM] TEXT Echo text to stdout or stderr
4625
4643
  -efile[NUM][!] ERRFILE Save names of files with errors
4626
4644
  -execute[NUM] Execute multiple commands on one line
4645
+ -list_dir List directories, not their contents
4627
4646
  -srcfile FMT Process a different source file
4628
4647
  -stay_open FLAG Keep reading -@ argfile even after EOF
4629
4648
  -userParam PARAM[[^]=[VAL]] Set user parameter (API UserParam opt)
@@ -4932,7 +4951,7 @@ documentation above for a complete description.
4932
4951
  =head3 Input-output text formatting
4933
4952
 
4934
4953
  Note that trailing spaces are removed from extracted values for most output
4935
- text formats. The exceptions are C<-b>, C<-csv>, C<-j> and C<-X>.
4954
+ text formats. The exceptions are B<-b>, B<-csv>, B<-j> and B<-X>.
4936
4955
 
4937
4956
  =over 5
4938
4957
 
@@ -4958,17 +4977,21 @@ maintain separate list items when writing metadata back to image files, and
4958
4977
  the B<-struct> option may be used when extracting to preserve structured XMP
4959
4978
  information.
4960
4979
 
4961
- =item B<-b> (B<-binary>)
4980
+ =item B<-b>, B<--b> (B<-binary>, B<--binary>)
4981
+
4982
+ Output requested metadata in binary format without tag names or descriptions
4983
+ (B<-b> or B<-binary>). This option is mainly used for extracting embedded
4984
+ images or other binary data, but it may also be useful for some text strings
4985
+ since control characters (such as newlines) are not replaced by '.' as they
4986
+ are in the default output. By default, list items are separated by a
4987
+ newline when extracted with the B<-b> option, but this may be changed (see
4988
+ the B<-sep> option for details). May be combined with B<-j>, B<-php> or
4989
+ B<-X> to extract binary data in JSON, PHP or XML format, but note that
4990
+ "unsafe" tags must be specified explicitly to be extracted as binary in
4991
+ these formats.
4962
4992
 
4963
- Output requested metadata in binary format without tag names or
4964
- descriptions. This option is mainly used for extracting embedded images or
4965
- other binary data, but it may also be useful for some text strings since
4966
- control characters (such as newlines) are not replaced by '.' as they are in
4967
- the default output. By default, list items are separated by a newline when
4968
- extracted with the B<-b> option, but this may be changed (see the B<-sep>
4969
- option for details). May be combined with C<-j>, C<-php> or C<-X> to
4970
- extract binary data in JSON, PHP or XML format, but note that "unsafe" tags
4971
- must be specified explicitly to be extracted as binary in these formats.
4993
+ With a leading double dash (B<--b> or B<--binary>), tags which contain
4994
+ binary data are suppressed in the output when reading.
4972
4995
 
4973
4996
  =item B<-c> I<FMT> (B<-coordFormat>)
4974
4997
 
@@ -5369,7 +5392,7 @@ with this command:
5369
5392
 
5370
5393
  produces output like this:
5371
5394
 
5372
- -- Generated by ExifTool 12.18 --
5395
+ -- Generated by ExifTool 12.22 --
5373
5396
  File: a.jpg - 2003:10:31 15:44:19
5374
5397
  (f/5.6, 1/60s, ISO 100)
5375
5398
  File: b.jpg - 2006:05:23 11:57:38
@@ -5729,7 +5752,8 @@ L<https://exiftool.org/geotag.html#Inverse> for examples.
5729
5752
  Setting I<NUM> to 2 causes the H264 video stream in MP4 videos to be parsed
5730
5753
  until the first Supplemental Enhancement Information (SEI) message is
5731
5754
  decoded, or 3 to parse the entire H624 stream and decode all SEI
5732
- information.
5755
+ information. For M2TS videos, a setting of 3 causes the entire file to be
5756
+ parsed in search of unlisted programs which may contain timed GPS.
5733
5757
 
5734
5758
  =item B<-ext>[+] I<EXT>, B<--ext> I<EXT> (B<-extension>)
5735
5759
 
@@ -5818,10 +5842,10 @@ Ignore specified directory name. I<DIR> may be either an individual folder
5818
5842
  name, or a full path. If a full path is specified, it must match the
5819
5843
  Directory tag exactly to be ignored. Use multiple B<-i> options to ignore
5820
5844
  more than one directory name. A special I<DIR> value of C<SYMLINKS> (case
5821
- sensitive) may be specified to ignore symbolic links when the B<-r> option
5822
- is used. As well, a value of C<HIDDEN> (case sensitive) may be used to
5823
- ignore files with names that start with a "." (ie. hidden files on Unix
5824
- systems) when scanning a directory.
5845
+ sensitive) may be specified to avoid recursing into directories which are
5846
+ symbolic links when the B<-r> option is used. As well, a value of C<HIDDEN>
5847
+ (case sensitive) may be used to ignore files with names that start with a
5848
+ "." (ie. hidden files on Unix systems) when scanning a directory.
5825
5849
 
5826
5850
  =item B<-if>[I<NUM>] I<EXPR>
5827
5851
 
@@ -6247,7 +6271,7 @@ As a convenience, C<-use MWG> is assumed if the C<MWG> group is specified
6247
6271
  for any tag on the command line. See the L<MWG Tags
6248
6272
  documentation|Image::ExifTool::TagNames/MWG Tags> for more details. Note
6249
6273
  that this option is not reversible, and remains in effect until the
6250
- application terminates, even across the C<-execute> option.
6274
+ application terminates, even across the B<-execute> option.
6251
6275
 
6252
6276
  =back
6253
6277
 
@@ -6351,6 +6375,20 @@ line. I<NUM> is an optional number that is echoed in the "{ready}" message
6351
6375
  when using the B<-stay_open> feature. If a I<NUM> is specified, the B<-q>
6352
6376
  option no longer suppresses the output "{readyNUM}" message.
6353
6377
 
6378
+ =item B<-list_dir>
6379
+
6380
+ List directories themselves instead of their contents. This option
6381
+ effectively causes directories to be treated as normal files when reading
6382
+ and writing. For example, with this option the output of the C<ls -la>
6383
+ command on Mac/Linux may be approximated by this exiftool command:
6384
+
6385
+ exiftool -list_dir -T -ls-l -api systemtags -fast5 .* *
6386
+
6387
+ (The B<-T> option formats the output in tab-separated columns, B<-ls-l> is a
6388
+ L<shortcut tag|Image::ExifTool::Shortcuts>, the API SystemTags option is
6389
+ required to extract some necessary tags, and the B<-fast5> option is added
6390
+ for speed since only system tags are being extracted.)
6391
+
6354
6392
  =item B<-srcfile> I<FMT>
6355
6393
 
6356
6394
  Specify a different source file to be processed based on the name of the
@@ -6398,7 +6436,7 @@ buffered output.) ExifTool will then execute the command with the arguments
6398
6436
  received up to this point, send a "{ready}" message to stdout when done
6399
6437
  (unless the B<-q> or B<-T> option is used), and continue trying to read
6400
6438
  arguments for the next command from I<ARGFILE>. To aid in command/response
6401
- synchronization, any number appended to the C<-execute> option is echoed in
6439
+ synchronization, any number appended to the B<-execute> option is echoed in
6402
6440
  the "{ready}" message. For example, C<-execute613> results in "{ready613}".
6403
6441
  When this number is added, B<-q> no longer suppresses the "{ready}" message.
6404
6442
  (Also, see the B<-echo3> and B<-echo4> options for additional ways to pass
@@ -6533,8 +6571,8 @@ complete list). Setting this triggers the use of Windows wide-character i/o
6533
6571
  routines, thus providing support for most Unicode file names (see note 4).
6534
6572
  But note that it is not trivial to pass properly encoded file names on the
6535
6573
  Windows command line (see L<https://exiftool.org/faq.html#Q18> for details),
6536
- so placing them in a UTF-8 encoded B<-@> argfile and using C<-charset
6537
- filename=utf8> is recommended if possible.
6574
+ so placing them in a UTF-8 encoded B<-@> argfile and using
6575
+ C<-charset filename=utf8> is recommended if possible.
6538
6576
 
6539
6577
  A warning is issued if a specified filename contains special characters and
6540
6578
  the filename character set was not provided. However, the warning may be
@@ -6608,7 +6646,7 @@ Print all meta information in an image, including duplicate and unknown
6608
6646
  tags, sorted by group (for family 1). For performance reasons, this command
6609
6647
  may not extract all available metadata. (Metadata in embedded documents,
6610
6648
  metadata extracted by external utilities, and metadata requiring excessive
6611
- processing time may not be extracted). Add C<-ee> and C<-api RequestAll=3>
6649
+ processing time may not be extracted). Add C<-ee3> and C<-api RequestAll=3>
6612
6650
  to the command to extract absolutely everything available.
6613
6651
 
6614
6652
  =item exiftool -common dir
@@ -6677,7 +6715,7 @@ L<Image::ExifTool::TagNames|Image::ExifTool::TagNames>).
6677
6715
  Print one line of output containing the file name and DateTimeOriginal for
6678
6716
  each image in directory C<dir>.
6679
6717
 
6680
- =item exiftool -ee -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts
6718
+ =item exiftool -ee3 -p '$gpslatitude, $gpslongitude, $gpstimestamp' a.m2ts
6681
6719
 
6682
6720
  Extract all GPS positions from an AVCHD video.
6683
6721
 
@@ -3,7 +3,7 @@
3
3
  #
4
4
  # Description: Example ExifTool print format file to generate a GPX track log
5
5
  #
6
- # Usage: exiftool -p gpx.fmt -ee FILE [...] > out.gpx
6
+ # Usage: exiftool -p gpx.fmt -ee3 FILE [...] > out.gpx
7
7
  #
8
8
  # Requires: ExifTool version 10.49 or later
9
9
  #
@@ -4,7 +4,7 @@
4
4
  # Description: Example ExifTool print format file to generate GPX waypoints
5
5
  # with pictures
6
6
  #
7
- # Usage: exiftool -p gpx_wpt.fmt -ee FILE [...] > out.gpx
7
+ # Usage: exiftool -p gpx_wpt.fmt -ee3 FILE [...] > out.gpx
8
8
  #
9
9
  # Requires: ExifTool version 10.49 or later
10
10
  #
@@ -15,7 +15,7 @@
15
15
  # 2020/01/11 - F. Kotov Limited image preview size to 500px
16
16
  #
17
17
  # Notes: 1) Input files must contain GPSLatitude and GPSLongitude.
18
- # 2) Add the -ee option to extract the full track from video files.
18
+ # 2) Add the -ee3 option to extract the full track from video files.
19
19
  # 3) For Google Earth to be able to find the images, the input
20
20
  # images must be specified using relative paths, and "out.kml"
21
21
  # must stay in the same directory as where the command was run.
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # From video files:
13
13
  #
14
- # exiftool -p kml.fmt -ee FILEorDIR [...] > out.kml
14
+ # exiftool -p kml.fmt -ee3 FILEorDIR [...] > out.kml
15
15
  #
16
16
  # Requires: ExifTool version 10.41 or later
17
17
  #
@@ -28,7 +28,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exePath);
30
30
 
31
- $VERSION = '12.18';
31
+ $VERSION = '12.22';
32
32
  $RELEASE = '';
33
33
  @ISA = qw(Exporter);
34
34
  %EXPORT_TAGS = (
@@ -42,7 +42,7 @@ $RELEASE = '';
42
42
  DataAccess => [qw(
43
43
  ReadValue GetByteOrder SetByteOrder ToggleByteOrder Get8u Get8s Get16u
44
44
  Get16s Get32u Get32s Get64u GetFloat GetDouble GetFixed32s Write
45
- WriteValue Tell Set8u Set8s Set16u Set32u Set64u
45
+ WriteValue Tell Set8u Set8s Set16u Set32u Set64u Set64s
46
46
  )],
47
47
  Utils => [qw(GetTagTable TagTableKeys GetTagInfoList AddTagToTable HexDump)],
48
48
  Vars => [qw(%allTables @tableOrder @fileTypes)],
@@ -70,7 +70,7 @@ sub SetFileName($$;$$$);
70
70
  sub SetSystemTags($$);
71
71
  sub GetAllTags(;$);
72
72
  sub GetWritableTags(;$);
73
- sub GetAllGroups($);
73
+ sub GetAllGroups($;$);
74
74
  sub GetNewGroups($);
75
75
  sub GetDeleteGroups();
76
76
  sub AddUserDefinedTags($%);
@@ -89,6 +89,7 @@ sub Get64u($$);
89
89
  sub GetFixed64s($$);
90
90
  sub GetExtended($$);
91
91
  sub Set64u(@);
92
+ sub Set64s(@);
92
93
  sub DecodeBits($$;$);
93
94
  sub EncodeBits($$;$$);
94
95
  sub Filter($$$);
@@ -266,6 +267,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
266
267
  DIB => ['BMP', 'Device Independent Bitmap'],
267
268
  DIC => 'DICM',
268
269
  DICM => ['DICOM','Digital Imaging and Communications in Medicine'],
270
+ DIR => ['DIR', 'Directory'],
269
271
  DIVX => ['ASF', 'DivX media format'],
270
272
  DJV => 'DJVU',
271
273
  DJVU => ['AIFF', 'DjVu image'],
@@ -1129,6 +1131,13 @@ my %systemTagsNotes = (
1129
1131
  RawConv => '$self->ConvertFileName($val)',
1130
1132
  ValueConvInv => '$self->InverseFileName($val)',
1131
1133
  },
1134
+ BaseName => {
1135
+ Groups => { 1 => 'System', 2 => 'Other' },
1136
+ Notes => q{
1137
+ file name without extension. Not generated unless specifically requested or
1138
+ the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1139
+ },
1140
+ },
1132
1141
  FilePath => {
1133
1142
  Groups => { 1 => 'System', 2 => 'Other' },
1134
1143
  Notes => q{
@@ -1270,10 +1279,19 @@ my %systemTagsNotes = (
1270
1279
  WritePseudo => 1,
1271
1280
  DelCheck => q{"Can't delete"},
1272
1281
  Protected => 1, # all writable pseudo-tags must be protected!
1273
- ValueConv => 'sprintf("%.3o", $val & 0777)',
1274
- ValueConvInv => 'oct($val)',
1282
+ ValueConv => 'sprintf("%.3o", $val)',
1283
+ ValueConvInv => 'oct($val & 07777)',
1275
1284
  PrintConv => sub {
1276
- my ($mask, $str, $val) = (0400, '', oct(shift));
1285
+ my ($mask, $val) = (0400, oct(shift));
1286
+ my %types = (
1287
+ 0010000 => 'p',
1288
+ 0020000 => 'c',
1289
+ 0040000 => 'd',
1290
+ 0060000 => 'b',
1291
+ 0120000 => 'l',
1292
+ 0140000 => 's',
1293
+ );
1294
+ my $str = $types{$val & 0170000} || '-';
1277
1295
  while ($mask) {
1278
1296
  foreach (qw(r w x)) {
1279
1297
  $str .= $val & $mask ? $_ : '-';
@@ -1284,6 +1302,7 @@ my %systemTagsNotes = (
1284
1302
  },
1285
1303
  PrintConvInv => sub {
1286
1304
  my ($bit, $val, $str) = (8, 0, shift);
1305
+ $str = substr($str, 1) if length($str) == 10;
1287
1306
  return undef if length($str) != 9;
1288
1307
  while ($bit >= 0) {
1289
1308
  foreach (qw(r w x)) {
@@ -2271,7 +2290,7 @@ sub ClearOptions($)
2271
2290
  NoPDFList => undef, # flag to avoid splitting PDF List-type tag values
2272
2291
  Password => undef, # password for password-protected PDF documents
2273
2292
  PrintConv => 1, # flag to enable print conversion
2274
- QuickTimeHandler => undef, # flag to add mdir Handler to newly created Meta box
2293
+ QuickTimeHandler => 1, # flag to add mdir Handler to newly created Meta box
2275
2294
  QuickTimeUTC=> undef, # assume that QuickTime date/time tags are stored as UTC
2276
2295
  RequestAll => undef, # extract all tags that must be specifically requested
2277
2296
  RequestTags => undef, # extra tags to request (on top of those in the tag list)
@@ -2321,7 +2340,7 @@ sub ExtractInfo($;@)
2321
2340
  my $fast = $$options{FastScan} || 0;
2322
2341
  my $req = $$self{REQ_TAG_LOOKUP};
2323
2342
  my $reqAll = $$options{RequestAll} || 0;
2324
- my (%saveOptions, $reEntry, $rsize, $type, @startTime, $saveOrder);
2343
+ my (%saveOptions, $reEntry, $rsize, $type, @startTime, $saveOrder, $isDir);
2325
2344
 
2326
2345
  # check for internal ReEntry option to allow recursive calls to ExtractInfo
2327
2346
  if (ref $_[1] eq 'HASH' and $_[1]{ReEntry} and
@@ -2394,6 +2413,11 @@ sub ExtractInfo($;@)
2394
2413
  $realname =~ /\|$/ and $realname =~ s/^.*?"(.*?)".*/$1/s;
2395
2414
  my ($dir, $name) = SplitFileName($realname);
2396
2415
  $self->FoundTag('FileName', $name);
2416
+ if ($$req{basename} or
2417
+ ($reqAll and not $$self{EXCL_TAG_LOOKUP}{basename}))
2418
+ {
2419
+ $self->FoundTag('BaseName', $name =~ /(.*)\./ ? $1 : $name);
2420
+ }
2397
2421
  $self->FoundTag('Directory', $dir) if defined $dir and length $dir;
2398
2422
  if ($$req{filepath} or
2399
2423
  ($reqAll and not $$self{EXCL_TAG_LOOKUP}{filepath}))
@@ -2417,6 +2441,8 @@ sub ExtractInfo($;@)
2417
2441
  # in Windows cmd shell pipe even though it really failed
2418
2442
  $$raf{TESTED} = -1 if $filename eq '-' or $filename =~ /\|$/;
2419
2443
  $$self{RAF} = $raf;
2444
+ } elsif ($self->IsDirectory($filename)) {
2445
+ $isDir = 1;
2420
2446
  } else {
2421
2447
  $self->Error('Error opening file');
2422
2448
  }
@@ -2425,28 +2451,34 @@ sub ExtractInfo($;@)
2425
2451
  }
2426
2452
  }
2427
2453
 
2428
- while ($raf) {
2429
- my (@stat, $fileSize);
2454
+ while ($raf or $isDir) {
2455
+ my (@stat, $plainFile);
2430
2456
  if ($reEntry) {
2431
2457
  # we already set these tags
2458
+ } elsif (not $raf) {
2459
+ @stat = stat $filename;
2432
2460
  } elsif (not $$raf{FILE_PT}) {
2433
2461
  # get file size from image in memory
2434
2462
  $self->FoundTag('FileSize', length ${$$raf{BUFF_PT}});
2435
2463
  } elsif (-f $$raf{FILE_PT}) {
2436
2464
  # get file tags if this is a plain file
2437
- $fileSize = -s _;
2438
2465
  @stat = stat _;
2439
- my ($aTime, $mTime, $cTime) = $self->GetFileTime($$raf{FILE_PT});
2440
- $self->FoundTag('FileSize', $fileSize) if defined $fileSize;
2441
- $self->FoundTag('ResourceForkSize', $rsize) if $rsize;
2442
- $self->FoundTag('FileModifyDate', $mTime) if defined $mTime;
2443
- $self->FoundTag('FileAccessDate', $aTime) if defined $aTime;
2444
- my $cTag = $^O eq 'MSWin32' ? 'FileCreateDate' : 'FileInodeChangeDate';
2445
- $self->FoundTag($cTag, $cTime) if defined $cTime;
2446
- $self->FoundTag('FilePermissions', $stat[2]) if defined $stat[2];
2466
+ $plainFile = 1;
2467
+ # hack to patch Windows daylight savings time bug
2468
+ @stat[8,9,10] = $self->GetFileTime($$raf{FILE_PT}) if $^O eq 'MSWin32';
2447
2469
  } else {
2470
+ # (note that Windows directories will still show the
2471
+ # daylight savings time bug -- should fix this sometime)
2448
2472
  @stat = stat $$raf{FILE_PT};
2449
2473
  }
2474
+ my $fileSize = $stat[7];
2475
+ $self->FoundTag('FileSize', $stat[7]) if defined $stat[7];
2476
+ $self->FoundTag('ResourceForkSize', $rsize) if $rsize;
2477
+ $self->FoundTag('FileModifyDate', $stat[9]) if defined $stat[9];
2478
+ $self->FoundTag('FileAccessDate', $stat[8]) if defined $stat[8];
2479
+ my $cTag = $^O eq 'MSWin32' ? 'FileCreateDate' : 'FileInodeChangeDate';
2480
+ $self->FoundTag($cTag, $stat[10]) if defined $stat[10];
2481
+ $self->FoundTag('FilePermissions', $stat[2]) if defined $stat[2];
2450
2482
  # extract more system info if SystemTags option is set
2451
2483
  if (@stat) {
2452
2484
  my $sys = $$options{SystemTags} || ($reqAll and not defined $$options{SystemTags});
@@ -2486,11 +2518,18 @@ sub ExtractInfo($;@)
2486
2518
  if ($crDate or $mdItem or $xattr) {
2487
2519
  require Image::ExifTool::MacOS;
2488
2520
  Image::ExifTool::MacOS::GetFileCreateDate($self, $filename) if $crDate;
2489
- Image::ExifTool::MacOS::ExtractMDItemTags($self, $filename) if $mdItem;
2521
+ Image::ExifTool::MacOS::ExtractMDItemTags($self, $filename) if $mdItem and $plainFile;
2490
2522
  Image::ExifTool::MacOS::ExtractXAttrTags($self, $filename) if $xattr;
2491
2523
  }
2492
2524
  }
2493
-
2525
+ # do whatever else we can with directories, then return
2526
+ if ($isDir or (defined $stat[2] and ($stat[2] & 0170000) == 0040000)) {
2527
+ $self->FoundTag('FileType', 'DIR');
2528
+ $self->FoundTag('FileTypeExtension', '');
2529
+ $self->BuildCompositeTags() if $$options{Composite};
2530
+ $raf->Close() if $raf;
2531
+ return 1;
2532
+ }
2494
2533
  # get list of file types to check
2495
2534
  my ($tiffType, %noMagic, $recognizedExt);
2496
2535
  my $ext = $$self{FILE_EXT} = GetFileExtension($realname);
@@ -4079,7 +4118,14 @@ sub GetFileTime($$)
4079
4118
  # open file by name if necessary
4080
4119
  unless (ref $file) {
4081
4120
  local *FH;
4082
- $self->Open(\*FH, $file) or $self->Warn("GetFileTime error for '${file}'"), return ();
4121
+ unless ($self->Open(\*FH, $file)) {
4122
+ if ($self->IsDirectory($file)) {
4123
+ my @rtn = (stat $file)[8, 9, 10];
4124
+ return @rtn if defined $rtn[0];
4125
+ }
4126
+ $self->Warn("GetFileTime error for '${file}'");
4127
+ return ();
4128
+ }
4083
4129
  $file = *FH; # (not \*FH, so *FH will be kept open until $file goes out of scope)
4084
4130
  }
4085
4131
  # on Windows, try to work around incorrect file times when daylight saving time is in effect
@@ -5710,7 +5756,11 @@ sub GetUnixTime($;$)
5710
5756
  my ($timeStr, $isLocal) = @_;
5711
5757
  return 0 if $timeStr eq '0000:00:00 00:00:00';
5712
5758
  my @tm = ($timeStr =~ /^(\d+):(\d+):(\d+)\s+(\d+):(\d+):(\d+)(.*)/);
5713
- return undef unless @tm == 7 and eval { require Time::Local };
5759
+ return undef unless @tm == 7;
5760
+ unless (eval { require Time::Local }) {
5761
+ warn "Time::Local is not installed\n";
5762
+ return undef;
5763
+ }
5714
5764
  my ($tzStr, $tzSec) = (pop(@tm), 0);
5715
5765
  # use specified timezone offset (if given) instead of local system time
5716
5766
  # if we are converting a local time value
@@ -5908,7 +5958,7 @@ sub ProcessTrailers($$)
5908
5958
  for (;;) { # loop through all trailers
5909
5959
  my ($proc, $outBuff);
5910
5960
  if ($dirName eq 'Insta360') {
5911
- require "Image/ExifTool/QuickTimeStream.pl";
5961
+ require 'Image/ExifTool/QuickTimeStream.pl';
5912
5962
  $proc = 'Image::ExifTool::QuickTime::ProcessInsta360';
5913
5963
  } else {
5914
5964
  require "Image/ExifTool/$dirName.pm";