exiftool-vendored.exe 12.30.0 → 12.38.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 (52) hide show
  1. package/bin/exiftool_files/Changes +129 -3
  2. package/bin/exiftool_files/README +2 -2
  3. package/bin/exiftool_files/arg_files/xmp2exif.args +2 -1
  4. package/bin/exiftool_files/config_files/example.config +1 -1
  5. package/bin/exiftool_files/exiftool.pl +100 -58
  6. package/bin/exiftool_files/fmt_files/gpx.fmt +1 -1
  7. package/bin/exiftool_files/fmt_files/gpx_wpt.fmt +1 -1
  8. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +13 -3
  9. package/bin/exiftool_files/lib/Image/ExifTool/CBOR.pm +331 -0
  10. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +175 -12
  11. package/bin/exiftool_files/lib/Image/ExifTool/CanonCustom.pm +12 -2
  12. package/bin/exiftool_files/lib/Image/ExifTool/Charset.pm +2 -0
  13. package/bin/exiftool_files/lib/Image/ExifTool/DPX.pm +13 -2
  14. package/bin/exiftool_files/lib/Image/ExifTool/DarwinCore.pm +2 -2
  15. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +109 -3
  16. package/bin/exiftool_files/lib/Image/ExifTool/FLIR.pm +33 -8
  17. package/bin/exiftool_files/lib/Image/ExifTool/GIF.pm +5 -1
  18. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +14 -10
  19. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +13 -2
  20. package/bin/exiftool_files/lib/Image/ExifTool/GoPro.pm +16 -1
  21. package/bin/exiftool_files/lib/Image/ExifTool/ICC_Profile.pm +96 -4
  22. package/bin/exiftool_files/lib/Image/ExifTool/JSON.pm +7 -3
  23. package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +154 -24
  24. package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +27 -12
  25. package/bin/exiftool_files/lib/Image/ExifTool/MacOS.pm +2 -2
  26. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +1204 -96
  27. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +5 -1
  28. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +135 -71
  29. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +5 -1
  30. package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +4 -2
  31. package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +11 -12
  32. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +4 -1
  33. package/bin/exiftool_files/lib/Image/ExifTool/Panasonic.pm +2 -2
  34. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +2 -1
  35. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +69 -10
  36. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +141 -111
  37. package/bin/exiftool_files/lib/Image/ExifTool/README +9 -2
  38. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +56 -13
  39. package/bin/exiftool_files/lib/Image/ExifTool/TagInfoXML.pm +9 -4
  40. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +6473 -5827
  41. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +1401 -54
  42. package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +1 -0
  43. package/bin/exiftool_files/lib/Image/ExifTool/WritePNG.pl +2 -0
  44. package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +10 -0
  45. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +10 -11
  46. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +50 -5
  47. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +125 -31
  48. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +3 -1
  49. package/bin/exiftool_files/lib/Image/ExifTool/XMPStruct.pl +3 -1
  50. package/bin/exiftool_files/lib/Image/ExifTool.pm +8931 -8864
  51. package/bin/exiftool_files/lib/Image/ExifTool.pod +21 -13
  52. package/package.json +3 -3
@@ -7,6 +7,129 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 12.30. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Dec. 20, 2021 - Version 12.38
11
+
12
+ - Decode a number of new tags for the Nikon Z9 (thanks Warren Hatch)
13
+ - Patched incorrect decoding of AEBShotCount for the Canon EOS 90D
14
+ - Patched EXR reader to support long tag names
15
+ - Patched security issue (thanks Joe Lothan)
16
+ - Fixed an incorrect tag ID for a new Nikon MakerNote tag (github #108)
17
+ - Fixed XMP-exif:GPSMeasureMode conversions to match EXIF
18
+ - Fixed problem where some namespaces may be undeclared in the -X output when
19
+ using the -struct option
20
+
21
+ Dec. 8, 2021 - Version 12.37
22
+
23
+ - Decode timed GPS from Vantrue S1 dashcam MP4 videos
24
+ - Decode ColorData tags for the Canon EOS R3 (thanks LibRaw)
25
+ - Decode more makernotes tags for Nikon Z cameras (thanks Warren Hatch)
26
+ - Extract TransparentColor from GIF images
27
+ - Improved parsing of input time values for GPSTimeStamp to properly handle a
28
+ "." separator
29
+ - Improved warning when incorrectly using "
30
+
31
+ Nov. 16, 2021 - Version 12.36
32
+
33
+ - IMPORTANT: Fixed bug introduced in 12.35 which corrupted JPEG 2000 images
34
+ when removing all metadata with -all=
35
+ - Added feature to bypass processing of specified XMP namespaces and
36
+ properties (to improve performance in cases where the XMP suffers from
37
+ Adobe-editing bloat)
38
+ - Added a number of new XMP tags used by Lightroom 11.0
39
+ - Decode a number of new Nikon tags (thanks Warren Hatch)
40
+ - Made the Composite GPSPosition tag writable
41
+ - Fixed erroneous "Skipped unknown bytes after JPEG SOS" warning
42
+ - Fixed group for new writable Jpeg2000 color tags in -listx output
43
+ - Fixed problem finding files in Windows when using wildcards in file name and
44
+ a drive letter with no slash
45
+
46
+ Nov. 11, 2021 - Version 12.35
47
+
48
+ - Added ability to write ICC_Profile (and other color specifications) to
49
+ Jpeg2000 images
50
+ - Added %o code to -W option format string
51
+ - Added %f code to -d option for fractional seconds
52
+ - Added a couple of new Sony LensType values (thanks Jos Roost)
53
+ - Added a new CanonModelID (thanks Norbert Wasser)
54
+ - Added a new Nikon LensID
55
+ - Decode more Nikon MakerNotes tags for some new models (thanks Warren Hatch)
56
+ - Extract ThumbnailImage from some DJI drone videos
57
+ - Enhanced -ee option to extract metadata from all frames in a SEQ file
58
+ - Patched to avoid possible "Use of uninitialized value" runtime warning
59
+ - Fixed a couple of misspelt new ICC_Profile tag names (thanks Herb)
60
+ - Fixed problem generating the correct file extension when extracting
61
+ OriginalRawImage from a DNG file using the -W option with the %s format code
62
+ - Fixed bug introduced in 11.91 where exiftool couldn't find its libraries
63
+ when run via a soft link. Also changed to look for config file in the link
64
+ target directory instead of the directory of the link itself
65
+
66
+ Oct. 27, 2021 - Version 12.34
67
+
68
+ - Added support for ICC.2:2019 (Profile version 5.0.0 - iccMAX) color profiles
69
+ - Added ability to detect/delete a Windows Zone.Identifier alternate data
70
+ stream (ADS) via the new ZoneIdentifier tag (thanks Alex Xu)
71
+ - Added support for the Sony ILCE-7M4 (thanks Jos Roost)
72
+ - Added a new Sony lens (thanks LibRaw and Jos Roost)
73
+ - Added a new SonyModelID (thanks LibRaw)
74
+ - Added a new Canon RF lens (thanks Norbert Wasser)
75
+ - Improved handling of some SVG files
76
+ - Patched -overwrite_original_in_place option to open the output file in
77
+ update mode rather than write mode (to allow some write optimizations on
78
+ certain filesystems) (thanks Joel Low)
79
+ - Fixed case of tag ID for new XMP-iptcExt:EventID (thanks Michael Steidl)
80
+ - Fixed problem extracting ICC_Profile information from some PDF files
81
+ - API Changes:
82
+ - Added QuickTimePad option
83
+
84
+ Oct. 16, 2021 - Version 12.33
85
+
86
+ - Added support for DNG version 1.6.0.0
87
+ - Added two new Sony LensType values (thanks Jos Roost and LibRaw)
88
+ - Added some new elements to the XMP-crs:Look structure (thanks Herb)
89
+ - Added a few new IPTC XMP tags (thanks Michael Steidl)
90
+ - Added a new Canon RF lens (thanks Norbert Wasser)
91
+ - Decode Canon ShutterMode (thanks John Moyer)
92
+ - Extract LensModel from some Olympus MOV videos
93
+ - Generate MediaDataOffset/Size for MOV videos with zero-sized MDAT chunk
94
+ - Improvements to CBOR reader, including hex dump with -v3 option
95
+ - Recognize Final Cut Pro XML files
96
+ - Allow binary data of Protected tags to be extracted with the -X -j and -php
97
+ options with -b by setting the API RequestAll option to 3
98
+ - Changed name of "Canon EF 80-200mm f/4.5-5.6" lens with LensType 38 to add
99
+ "II" to the name (Exiv2 issue 1906)
100
+ - Fixed runtime warning when processing files with a .DIR extension
101
+
102
+ Sept. 30, 2021 - Version 12.32
103
+
104
+ - Added support for CBOR-format metadata in JUMBF (note that JUMBF support is
105
+ still experimental)
106
+ - Added a new Nikon LensID
107
+ - Added a new Pentax LensType
108
+ - Decode timed GPS for two more dashcam formats
109
+ - Support reference direction columns in -geotag CSV input
110
+ - Removed generation of GPSSpeedRef and GPSTrackRef tags in timed metadata for
111
+ most dashcam formats when speed is km/h and track is relative to true north
112
+ - Patched to allow writing of console output to named pipes
113
+ - Fixed formatting of InternalSerialNumber for some Panasonic cameras
114
+ - Fixed bug in arg_files/xmp2exif.args support file
115
+
116
+ Sept. 22, 2021 - Version 12.31
117
+
118
+ - Added a new SonyModelID and a couple of new Sony lenses (thanks Jos Roost)
119
+ - Added a new Canon LensType (thanks Chris Skopec)
120
+ - Added Composite GPSLatitude/Longitude tags for Sony videos to combine the
121
+ reference hemispheres as with the Composite tags for EXIF GPS
122
+ - Decode DPX AspectRatio
123
+ - Decode more GoPro MP4 tags
124
+ - Extract ICC_Profile from CS0 object in PDF files
125
+ - Extract encrypted GPS from Akaso V1 dashcam videos (can't yet decrypt)
126
+ - Improved handling of QuickTime iTunesInfo tags, and created new "iTunes"
127
+ family 1 group for these
128
+ - Patched so NoPDFList option also applies when writing
129
+ - Patched to allow user-defined PNG TextualData tags to be written only as iTXt
130
+ - Patched PDF reader to avoid concatenating values of multiple List-type tags
131
+ into a single tag
132
+
10
133
  Aug. 12, 2021 - Version 12.30 (production release)
11
134
 
12
135
  - Added read support for Portable FloatMap (PFM) images (this was a bit of a
@@ -86,6 +209,8 @@ May 20, 2021 - Version 12.26 (production release)
86
209
  - Fixed problem which could cause a "Wide character" warning and generate a
87
210
  corrupted output file when writing some illegal values
88
211
 
212
+ History of older versions (back to Nov. 19, 2003 - Version 1.00) -->
213
+
89
214
  Apr. 22, 2021 - Version 12.25
90
215
 
91
216
  - JPEG XL support is now official
@@ -568,6 +693,7 @@ Mar. 19, 2020 - Version 11.92
568
693
 
569
694
  Mar. 5, 2020 - Version 11.91
570
695
 
696
+ - Added undocumented -xpath option for use by alternate Windows version
571
697
  - Decode a couple of new Panasonic tags
572
698
  - Documented -ec option (available since version 11.54)
573
699
  - Reverted -htmlDump fix of 11.90 because it broke more than it fixed, and
@@ -1453,8 +1579,8 @@ Oct. 9, 2018 - Version 11.13
1453
1579
  - Added a new Canon LensType (thanks LibRaw)
1454
1580
  - Minor improvements to verbose dump of streaming GPS metadata
1455
1581
  - Reverted change of version 10.71 which resulted in Windows not recognizing
1456
- PNG CreationTime as written by ExifTool (added this feature to the
1457
- StrictDate API option instead)
1582
+ PNG CreationTime as written by ExifTool (added this feature to the API
1583
+ StrictDate option instead)
1458
1584
  - Improved decoding of Nikon CropHiSpeed (thanks LibRaw)
1459
1585
  - Improved -fast option to reduce memory usage when reading JPG, PNG,
1460
1586
  QuickTime-based and RIFF-based files via a sequential stream
@@ -1568,7 +1694,7 @@ June 21, 2018 - Version 11.03
1568
1694
  June 13, 2018 - Version 11.02
1569
1695
 
1570
1696
  - Added support for a different format of Apple iWorks files
1571
- - Added undocumented FixCorruptedMOV API option to allow fixing MOV videos
1697
+ - Added undocumented API FixCorruptedMOV option to allow fixing MOV videos
1572
1698
  with multiple 'mdat' atoms which were corrupted by ExifTool
1573
1699
  - Decode more QuickTime tags
1574
1700
  - Decode more PanasonicRaw tags (thanks Klaus Homeister)
@@ -107,8 +107,8 @@ your home directory, then you would type the following commands in a
107
107
  terminal window to extract and run ExifTool:
108
108
 
109
109
  cd ~/Desktop
110
- gzip -dc Image-ExifTool-12.30.tar.gz | tar -xf -
111
- cd Image-ExifTool-12.30
110
+ gzip -dc Image-ExifTool-12.38.tar.gz | tar -xf -
111
+ cd Image-ExifTool-12.38
112
112
  ./exiftool t/images/ExifTool.jpg
113
113
 
114
114
  Note: These commands extract meta information from one of the test images.
@@ -13,6 +13,7 @@
13
13
  # 2015/01/12 - PH Avoid copying from non-standard namespaces
14
14
  # 2016/09/26 - PH Write Composite SubSec tags
15
15
  # 2018/05/07 - PH Added support for GPSDestXxxRef tags
16
+ # 2021/09/30 - PH Removed erroneous "-" when copying CreatorTool
16
17
  #
17
18
  # References: http://www.metadataworkinggroup.org/specs/
18
19
  #
@@ -34,7 +35,7 @@
34
35
  -Composite:SubSecDateTimeOriginal < XMP-photoshop:DateCreated
35
36
  -Composite:SubSecCreateDate < XMP-xmp:CreateDate
36
37
  -Composite:SubSecModifyDate < XMP-xmp:ModifyDate
37
- -EXIF:Software < -XMP-xmp:CreatorTool
38
+ -EXIF:Software < XMP-xmp:CreatorTool
38
39
  -EXIF:Copyright < XMP-dc:Rights
39
40
  -EXIF:Artist < XMP-dc:Creator
40
41
  # XMP flash information is translated by the Composite Flash tag
@@ -133,7 +133,7 @@
133
133
  # Example 12. PNG:NewPngTag1
134
134
  NewPngTag1 => { },
135
135
  # Example 13. PNG:NewPngTag2
136
- NewPngTag2 => { },
136
+ NewPngTag2 => { iTXt => 1 }, # (force this tag to be written as iTXt)
137
137
  # Example 14. PNG:NewPngTag3
138
138
  NewPngTag3 => { },
139
139
  },
@@ -10,15 +10,15 @@
10
10
  use strict;
11
11
  require 5.004;
12
12
 
13
- my $version = '12.30';
13
+ my $version = '12.38';
14
14
 
15
15
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
16
- my $exeDir;
16
+ my $exePath;
17
17
  BEGIN {
18
18
  # (undocumented -xpath option added in 11.91, must come before other options)
19
- $Image::ExifTool::exePath = @ARGV && lc($ARGV[0]) eq '-xpath' && shift() ? $^X : $0;
19
+ $exePath = @ARGV && lc($ARGV[0]) eq '-xpath' && shift() ? $^X : $0;
20
20
  # get exe directory
21
- $exeDir = ($Image::ExifTool::exePath =~ /(.*)[\\\/]/) ? $1 : '.';
21
+ $Image::ExifTool::exeDir = ($exePath =~ /(.*)[\\\/]/) ? $1 : '.';
22
22
  # (no link following for Windows exe version)
23
23
  # add lib directory at start of include path
24
24
  unshift @INC, ($0 =~ /(.*)[\\\/]/) ? "$1/lib" : './lib';
@@ -350,7 +350,7 @@ sub Cleanup() {
350
350
  #
351
351
 
352
352
  # add arguments embedded in filename (Windows .exe version only)
353
- if ($Image::ExifTool::exePath =~ /\(([^\\\/]+)\)(.exe|.pl)?$/i) {
353
+ if ($exePath =~ /\(([^\\\/]+)\)(.exe|.pl)?$/i) {
354
354
  my $argstr = $1;
355
355
  # divide into separate quoted or whitespace-delineated arguments
356
356
  my (@args, $arg, $quote);
@@ -773,7 +773,7 @@ for (;;) {
773
773
  }
774
774
  my $fp = ($stayOpen == 1 ? \*STAYOPEN : \*ARGFILE);
775
775
  unless ($mt->Open($fp, $argFile)) {
776
- unless ($argFile !~ /^\// and $mt->Open($fp, "$exeDir/$argFile")) {
776
+ unless ($argFile !~ /^\// and $mt->Open($fp, "$Image::ExifTool::exeDir/$argFile")) {
777
777
  Error "Error opening arg file $argFile\n";
778
778
  $badCmd = 1;
779
779
  next
@@ -1251,7 +1251,7 @@ for (;;) {
1251
1251
  $textOverwrite += 2 if $t2 =~ /\+/; # append
1252
1252
  if ($t1 ne 'W' and lc($t1) ne 'tagout') {
1253
1253
  undef $tagOut;
1254
- } elsif ($textOverwrite >= 2 and $textOut !~ /%[-+]?\d*[.:]?\d*[lu]?[tgs]/) {
1254
+ } elsif ($textOverwrite >= 2 and $textOut !~ /%[-+]?\d*[.:]?\d*[lu]?[tgso]/) {
1255
1255
  $tagOut = 0; # append tags to one file
1256
1256
  } else {
1257
1257
  $tagOut = 1; # separate file for each tag
@@ -1619,7 +1619,7 @@ if (@newValues) {
1619
1619
  next;
1620
1620
  }
1621
1621
  my %opts = ( Shift => 0 ); # shift values if possible instead of adding/deleting
1622
- # allow writing of 'unsafe' tags unless specified by wildcard
1622
+ # allow writing of 'Unsafe' tags unless specified by wildcard
1623
1623
  $opts{Protected} = 1 unless $tag =~ /[?*]/;
1624
1624
 
1625
1625
  if ($tag =~ s/<// and defined $newVal) {
@@ -1954,10 +1954,20 @@ sub GetImageInfo($$)
1954
1954
  my $pipe = $file;
1955
1955
  if ($doUnzip) {
1956
1956
  # pipe through gzip or bzip2 if necessary
1957
- if ($file =~ /\.gz$/i) {
1958
- $pipe = qq{gzip -dc "$file" |};
1959
- } elsif ($file =~ /\.bz2$/i) {
1960
- $pipe = qq{bzip2 -dc "$file" |};
1957
+ if ($file =~ /\.(gz|bz2)$/i) {
1958
+ my $type = lc $1;
1959
+ if ($file =~ /[^-_.'A-Za-z0-9\/\\]/) {
1960
+ Warn "Error: Insecure zip file name. Skipped\n";
1961
+ EFile($file);
1962
+ ++$countBad;
1963
+ return;
1964
+ }
1965
+ if ($type eq 'gz') {
1966
+ $pipe = qq{gzip -dc "$file" |};
1967
+ } else {
1968
+ $pipe = qq{bzip2 -dc "$file" |};
1969
+ }
1970
+ $$et{TRUST_PIPE} = 1;
1961
1971
  }
1962
1972
  }
1963
1973
  # evaluate -if expression for conditional processing
@@ -2228,12 +2238,13 @@ sub GetImageInfo($$)
2228
2238
  next unless defined $forcePrint;
2229
2239
  $grp0 = $grp1 = 'Unknown';
2230
2240
  }
2241
+ # add groups from structure fields
2242
+ AddGroups($$info{$tag}, $grp0, \%groups, \@groups) if ref $$info{$tag};
2231
2243
  next if $groups{$grp1};
2232
2244
  # include family 0 and 1 groups in URI except for internal tags
2233
2245
  # (this will put internal tags in the "XML" group on readback)
2234
2246
  $groups{$grp1} = $grp0;
2235
2247
  push @groups, $grp1;
2236
- AddGroups($$info{$tag}, $grp0, \%groups, \@groups) if ref $$info{$tag};
2237
2248
  }
2238
2249
  foreach $grp1 (@groups) {
2239
2250
  my $grp = $groups{$grp1};
@@ -2276,7 +2287,7 @@ TAG: foreach $tag (@foundTags) {
2276
2287
  # avoid extracting Protected binary tags (eg. data blocks) [insider information]
2277
2288
  my $lcTag = lc $tag;
2278
2289
  $lcTag =~ s/ .*//;
2279
- next unless $$et{REQ_TAG_LOOKUP}{$lcTag};
2290
+ next unless $$et{REQ_TAG_LOOKUP}{$lcTag} or ($$et{OPTIONS}{RequestAll} || 0) > 2;
2280
2291
  }
2281
2292
  $val = ConvertBinary($val); # convert SCALAR references
2282
2293
  next unless defined $val;
@@ -2356,7 +2367,8 @@ TAG: foreach $tag (@foundTags) {
2356
2367
  }
2357
2368
  my @groups = $et->GetGroup($tag);
2358
2369
  $outfile and close($fp), undef($tmpText); # (shouldn't happen)
2359
- ($fp, $outfile, $append) = OpenOutputFile($orig, $tagName, \@groups, $ext);
2370
+ my $org = $et->GetValue('OriginalRawFileName') || $et->GetValue('OriginalFileName');
2371
+ ($fp, $outfile, $append) = OpenOutputFile($orig, $tagName, \@groups, $ext, $org);
2360
2372
  $fp or ++$countBad, next TAG;
2361
2373
  $tmpText = $outfile unless $append;
2362
2374
  }
@@ -3052,12 +3064,14 @@ sub SetImageInfo($$$)
3052
3064
  # temporarily disable CTRL-C during this critical operation
3053
3065
  $critical = 1;
3054
3066
  undef $tmpFile; # handle deletion of temporary file ourself
3055
- if ($et->Open(\*ORIG_FILE, $file, '>')) {
3067
+ if ($et->Open(\*ORIG_FILE, $file, '+<')) {
3056
3068
  binmode(ORIG_FILE);
3057
3069
  while (read(NEW_FILE, $buff, 65536)) {
3058
3070
  print ORIG_FILE $buff or $err = 1;
3059
3071
  }
3060
3072
  close(NEW_FILE);
3073
+ # Handle files being shorter than the original
3074
+ eval { truncate(ORIG_FILE, tell(ORIG_FILE)) } or $err = 1;
3061
3075
  close(ORIG_FILE) or $err = 1;
3062
3076
  if ($err) {
3063
3077
  Warn "Couldn't overwrite in place - $file\n";
@@ -3241,7 +3255,8 @@ sub FormatXML($$$)
3241
3255
  } elsif (ref $val eq 'HASH') {
3242
3256
  $gt = " rdf:parseType='Resource'>";
3243
3257
  my $val2 = '';
3244
- foreach (sort keys %$val) {
3258
+ my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3259
+ foreach (@keys) {
3245
3260
  # (some variable-namespace XML structure fields may have a different group)
3246
3261
  my $tok = /:/ ? $_ : ($grp . ':' . $_);
3247
3262
  $val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
@@ -3318,7 +3333,8 @@ sub FormatJSON($$$)
3318
3333
  } elsif (ref $val eq 'HASH') {
3319
3334
  my ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
3320
3335
  print $fp $bra;
3321
- foreach (sort keys %$val) {
3336
+ my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3337
+ foreach (@keys) {
3322
3338
  print $fp ',' if $comma;
3323
3339
  my $key = EscapeJSON($_, 1);
3324
3340
  print $fp qq(\n$ind $key$sep );
@@ -3451,18 +3467,26 @@ sub ConvertBinary($)
3451
3467
  }
3452
3468
 
3453
3469
  #------------------------------------------------------------------------------
3454
- # Compare two tag values to see if they are equal
3470
+ # Compare ValueConv and PrintConv values of a tag to see if they are equal
3455
3471
  # Inputs: 0) value1, 1) value2
3456
3472
  # Returns: true if they are equal
3457
3473
  sub IsEqual($$)
3458
3474
  {
3459
- return 1 if ref $_[0] eq 'SCALAR' or $_[0] eq $_[1];
3460
- return 0 if ref $_[0] ne 'ARRAY' or ref $_[1] ne 'ARRAY' or
3461
- @{$_[0]} ne @{$_[1]};
3462
- # test all elements of an array
3463
- my $i = 0;
3464
- for ($i=0; $i<scalar(@{$_[0]}); ++$i) {
3465
- return 0 if $_[0][$i] ne $_[1][$i];
3475
+ my ($a, $b) = @_;
3476
+ # (scalar values are not print-converted)
3477
+ return 1 if $a eq $b or ref $a eq 'SCALAR';
3478
+ if (ref $a eq 'HASH' and ref $b eq 'HASH') {
3479
+ return 0 if scalar(keys %$a) != scalar(keys %$b);
3480
+ my $key;
3481
+ foreach $key (keys %$a) {
3482
+ return 0 unless IsEqual($$a{$key}, $$b{$key});
3483
+ }
3484
+ } else {
3485
+ return 0 if ref $a ne 'ARRAY' or ref $b ne 'ARRAY' or @$a != @$b;
3486
+ my $i;
3487
+ for ($i=0; $i<scalar(@$a); ++$i) {
3488
+ return 0 unless IsEqual($$a[$i], $$b[$i]);
3489
+ }
3466
3490
  }
3467
3491
  return 1;
3468
3492
  }
@@ -3790,7 +3814,7 @@ sub FindFileWindows($$)
3790
3814
  my $enc = $et->Options('CharsetFileName');
3791
3815
  $wildfile = $et->Decode($wildfile, $enc, undef, 'UTF8') if $enc and $enc ne 'UTF8';
3792
3816
  $wildfile =~ tr/\\/\//; # use forward slashes
3793
- my ($dir, $wildname) = ($wildfile =~ m{(.*/)(.*)}) ? ($1, $2) : ('', $wildfile);
3817
+ my ($dir, $wildname) = ($wildfile =~ m{(.*[:/])(.*)}) ? ($1, $2) : ('', $wildfile);
3794
3818
  if ($dir =~ /[*?]/) {
3795
3819
  Warn "Wildcards don't work in the directory specification\n";
3796
3820
  return ();
@@ -3930,7 +3954,7 @@ sub SuggestedExtension($$$)
3930
3954
  $ext = 'xml';
3931
3955
  } elsif ($$valPt =~ /^RIFF....WAVE/s) {
3932
3956
  $ext = 'wav';
3933
- } elsif ($tag eq 'OriginalRawFileData' and defined($ext = $et->GetValue('OriginalRawFileName'))) {
3957
+ } elsif ($tag eq 'OriginalRawImage' and defined($ext = $et->GetValue('OriginalRawFileName'))) {
3934
3958
  $ext =~ s/^.*\.//s;
3935
3959
  $ext = $ext ? lc($ext) : 'raw';
3936
3960
  } elsif ($tag eq 'EXIF') {
@@ -3982,14 +4006,15 @@ sub LoadPrintFormat($)
3982
4006
  # A sort of sprintf for filenames
3983
4007
  # Inputs: 0) format string (%d=dir, %f=file name, %e=ext),
3984
4008
  # 1) source filename or undef to test format string
3985
- # 2-4) [%t %g %s only] tag name, ref to array of group names, suggested extension
4009
+ # 2-4) [%t %g %s %o only] tag name, ref to array of group names,
4010
+ # suggested extension, original raw file name
3986
4011
  # Returns: new filename or undef on error (or if no file and fmt contains token)
3987
4012
  sub FilenameSPrintf($;$@)
3988
4013
  {
3989
4014
  my ($fmt, $file, @extra) = @_;
3990
4015
  local $_;
3991
4016
  # return format string straight away if no tokens
3992
- return $fmt unless $fmt =~ /%[-+]?\d*[.:]?\d*[lu]?[dDfFeEtgs]/;
4017
+ return $fmt unless $fmt =~ /%[-+]?\d*[.:]?\d*[lu]?[dDfFeEtgso]/;
3993
4018
  return undef unless defined $file;
3994
4019
  CleanFilename($file); # make sure we are using forward slashes
3995
4020
  # split filename into directory, file, extension
@@ -4003,9 +4028,9 @@ sub FilenameSPrintf($;$@)
4003
4028
  }
4004
4029
  $part{F} = $part{f} . $part{E};
4005
4030
  ($part{D} = $part{d}) =~ s{/+$}{};
4006
- @part{qw(t g s)} = @extra;
4031
+ @part{qw(t g s o)} = @extra;
4007
4032
  my ($filename, $pos) = ('', 0);
4008
- while ($fmt =~ /(%([-+]?)(\d*)([.:]?)(\d*)([lu]?)([dDfFeEtgs]))/g) {
4033
+ while ($fmt =~ /(%([-+]?)(\d*)([.:]?)(\d*)([lu]?)([dDfFeEtgso]))/g) {
4009
4034
  $filename .= substr($fmt, $pos, pos($fmt) - $pos - length($1));
4010
4035
  $pos = pos($fmt);
4011
4036
  my ($sign, $wid, $dot, $skip, $mod, $code) = ($2, $3, $4, $5 || 0, $6, $7);
@@ -4168,7 +4193,7 @@ sub OpenOutputFile($;@)
4168
4193
  if ($textOut) {
4169
4194
  $outfile = $file;
4170
4195
  CleanFilename($outfile);
4171
- if ($textOut =~ /%[-+]?\d*[.:]?\d*[lun]?[dDfFeEtgscC]/ or defined $tagOut) {
4196
+ if ($textOut =~ /%[-+]?\d*[.:]?\d*[lun]?[dDfFeEtgsocC]/ or defined $tagOut) {
4172
4197
  # make filename from printf-like $textOut
4173
4198
  $outfile = FilenameSPrintf($textOut, $file, @args);
4174
4199
  return () unless defined $outfile;
@@ -4713,6 +4738,15 @@ OPTIONS
4713
4738
  4 below). Instead, individual tags may be recovered using the
4714
4739
  -tagsFromFile option (eg. "-all= -tagsfromfile @ -artist").
4715
4740
 
4741
+ To speed processing when reading XMP, exclusions in XMP groups also
4742
+ bypass processing of the corresponding XMP property and any
4743
+ contained properties. For example, "--xmp-crs:all" may speed
4744
+ processing significantly in cases where a large number of XMP-crs
4745
+ tags exist. To use this feature to bypass processing of a specific
4746
+ XMP property, the property name must be used instead of the
4747
+ ExifTool tag name (eg. "--xmp-crs:dabs"). Also, "XMP-all" may be
4748
+ used to to indicate any XMP namespace (eg. <C--xmp-all:dabs>).
4749
+
4716
4750
  -*TAG*[+-^]=[*VALUE*]
4717
4751
  Write a new value for the specified tag (eg. "-comment=wow"), or
4718
4752
  delete the tag if no *VALUE* is given (eg. "-comment="). "+=" and
@@ -4723,18 +4757,20 @@ OPTIONS
4723
4757
  may be used to conditionally delete or replace a tag (see "WRITING
4724
4758
  EXAMPLES" for examples). "^=" is used to write an empty string
4725
4759
  instead of deleting the tag when no *VALUE* is given, but otherwise
4726
- it is equivalent to "=".
4760
+ it is equivalent to "=", but note that the caret must be quoted on
4761
+ the Windows command line.
4727
4762
 
4728
4763
  *TAG* may contain one or more leading family 0, 1, 2 or 7 group
4729
4764
  names, prefixed by optional family numbers, and separated colons.
4730
4765
  If no group name is specified, the tag is created in the preferred
4731
4766
  group, and updated in any other location where a same-named tag
4732
- already exists. The preferred group is the first group in the
4733
- following list where *TAG* is valid: 1) EXIF, 2) IPTC, 3) XMP.
4767
+ already exists. The preferred group in JPEG and TIFF-format images
4768
+ is the first group in the following list where *TAG* is valid: 1)
4769
+ EXIF, 2) IPTC, 3) XMP.
4734
4770
 
4735
4771
  The wildcards "*" and "?" may be used in tag names to assign the
4736
4772
  same value to multiple tags. When specified with wildcards,
4737
- "unsafe" tags are not written. A tag name of "All" is equivalent to
4773
+ "Unsafe" tags are not written. A tag name of "All" is equivalent to
4738
4774
  "*" (except that it doesn't require quoting, while arguments with
4739
4775
  wildcards do on systems with shell globbing), and is often used
4740
4776
  when deleting all metadata (ie. "-All=") or an entire group (eg.
@@ -4889,9 +4925,9 @@ OPTIONS
4889
4925
  Notes:
4890
4926
 
4891
4927
  1) Some tags (generally tags which may affect the appearance of the
4892
- image) are considered "unsafe" to write, and are only copied if
4928
+ image) are considered "Unsafe" to write, and are only copied if
4893
4929
  specified explicitly (ie. no wildcards). See the tag name
4894
- documentation for more details about "unsafe" tags.
4930
+ documentation for more details about "Unsafe" tags.
4895
4931
 
4896
4932
  2) Be aware of the difference between excluding a tag from being
4897
4933
  copied (--*TAG*), and deleting a tag (-*TAG*=). Excluding a tag
@@ -4989,7 +5025,7 @@ OPTIONS
4989
5025
  exiftool -@ out.args -sep ", " dst.jpg
4990
5026
 
4991
5027
  Note: Be careful when copying information with this technique since
4992
- it is easy to write tags which are normally considered "unsafe".
5028
+ it is easy to write tags which are normally considered "Unsafe".
4993
5029
  For instance, the FileName and Directory tags are excluded in the
4994
5030
  example above to avoid renaming and moving the destination file.
4995
5031
  Also note that the second command above will produce warning
@@ -5009,9 +5045,9 @@ OPTIONS
5009
5045
  output. By default, list items are separated by a newline when
5010
5046
  extracted with the -b option, but this may be changed (see the -sep
5011
5047
  option for details). May be combined with -j, -php or -X to extract
5012
- binary data in JSON, PHP or XML format, but note that "unsafe" tags
5013
- must be specified explicitly to be extracted as binary in these
5014
- formats.
5048
+ binary data in JSON, PHP or XML format, but note that "Unsafe" tags
5049
+ are not extracted as binary unless they are specified explicitly or
5050
+ the API RequestAll option is set to 3 or higher.
5015
5051
 
5016
5052
  With a leading double dash (--b or --binary), tags which contain
5017
5053
  binary data are suppressed in the output when reading.
@@ -5178,7 +5214,10 @@ OPTIONS
5178
5214
  "strftime" man page on your system for details. The default format
5179
5215
  is equivalent to "%Y:%m:%d %H:%M:%S". This option has no effect on
5180
5216
  date-only or time-only tags and ignores timezone information if
5181
- present. Only one -d option may be used per command. Requires
5217
+ present. ExifTool adds a %f format code to represent fractional
5218
+ seconds, and supports an optional width to specify the number of
5219
+ digits after the decimal point (eg. %3f would give something like
5220
+ .437). Only one -d option may be used per command. Requires
5182
5221
  POSIX::strptime or Time::Piece for the inversion conversion when
5183
5222
  writing.
5184
5223
 
@@ -5215,7 +5254,7 @@ OPTIONS
5215
5254
  collapsing adjacent identical group names, but this can be avoided
5216
5255
  by placing a colon before the first family number (eg. -g:3:1). Use
5217
5256
  the -listg option to list group names for a specified family. The
5218
- SavePath and SaveFormat API options are automatically enabled if
5257
+ API SavePath and SaveFormat options are automatically enabled if
5219
5258
  the respective family 5 or 6 group names are requested. See the API
5220
5259
  GetGroup documentation for more information.
5221
5260
 
@@ -5407,7 +5446,8 @@ OPTIONS
5407
5446
  beginning with "#" are output for each processed file. Lines
5408
5447
  beginning with "#[IF]" are not output, but all BODY lines are
5409
5448
  skipped if any tag on an IF line doesn't exist. Other lines
5410
- beginning with "#" are ignored. For example, this format file:
5449
+ beginning with "#" are ignored. (To output a line beginning with
5450
+ "#", use "#[BODY]#".) For example, this format file:
5411
5451
 
5412
5452
  # this is a comment line
5413
5453
  #[HEAD]-- Generated by ExifTool $exifToolVersion --
@@ -5421,7 +5461,7 @@ OPTIONS
5421
5461
 
5422
5462
  produces output like this:
5423
5463
 
5424
- -- Generated by ExifTool 12.30 --
5464
+ -- Generated by ExifTool 12.38 --
5425
5465
  File: a.jpg - 2003:10:31 15:44:19
5426
5466
  (f/5.6, 1/60s, ISO 100)
5427
5467
  File: b.jpg - 2006:05:23 11:57:38
@@ -5438,7 +5478,7 @@ OPTIONS
5438
5478
  If a specified tag does not exist, a minor warning is issued and
5439
5479
  the line with the missing tag is not printed. However, the -f
5440
5480
  option may be used to set the value of missing tags to '-' (but
5441
- this may be configured via the MissingTagValue API option), or the
5481
+ this may be configured via the API MissingTagValue option), or the
5442
5482
  -m option may be used to ignore minor warnings and leave the
5443
5483
  missing values empty. Alternatively, -q -q may be used to simply
5444
5484
  suppress the warning messages.
@@ -5678,13 +5718,15 @@ OPTIONS
5678
5718
 
5679
5719
  1) With -W, a new output file is created for each extracted tag.
5680
5720
 
5681
- 2) -W supports three additional format codes: %t, %g and %s
5721
+ 2) -W supports four additional format codes: %t, %g and %s
5682
5722
  represent the tag name, group name, and suggested extension for the
5683
- output file (based on the format of the data). The %g code may be
5684
- followed by a single digit to specify the group family number (eg.
5685
- %g1), otherwise family 0 is assumed. The substring
5686
- width/position/case specifiers may be used with these format codes
5687
- in exactly the same way as with %f and %e.
5723
+ output file (based on the format of the data), and %o represents
5724
+ the value of the OriginalRawFileName or OriginalFileName tag from
5725
+ the input file (including extension). The %g code may be followed
5726
+ by a single digit to specify the group family number (eg. %g1),
5727
+ otherwise family 0 is assumed. The substring width/position/case
5728
+ specifiers may be used with these format codes in exactly the same
5729
+ way as with %f and %e.
5688
5730
 
5689
5731
  3) The argument for -W is interpreted as a file name if it contains
5690
5732
  no format codes. (For -w, this would be a file extension.) This
@@ -5706,7 +5748,7 @@ OPTIONS
5706
5748
  file names to the console instead of giving a verbose dump of the
5707
5749
  entire file. (Unless appending all output to one file for each
5708
5750
  source file by using -W+ with an output file *FMT* that does not
5709
- contain %t, $g or %s.)
5751
+ contain %t, %g, %s or %o.)
5710
5752
 
5711
5753
  5) Individual list items are stored in separate files when -W is
5712
5754
  combined with -b, but note that for separate files to be created %c
@@ -5743,9 +5785,9 @@ OPTIONS
5743
5785
 
5744
5786
  Note: This output is NOT the same as XMP because it uses
5745
5787
  dynamically-generated property names corresponding to the ExifTool
5746
- tag names, and not the standard XMP properties. To write XMP
5747
- instead, use the -o option with an XMP extension for the output
5748
- file.
5788
+ tag names with ExifTool family 1 group names as namespaces, and not
5789
+ the standard XMP properties and namespaces. To write XMP instead,
5790
+ use the -o option with an XMP extension for the output file.
5749
5791
 
5750
5792
  Processing control
5751
5793
  -a, --a (-duplicates, --duplicates)
@@ -13,7 +13,7 @@
13
13
  # 2019/10/24 - PH Preserve sub-seconds in GPSDateTime value
14
14
  #
15
15
  # Notes: 1) Input file(s) must contain GPSLatitude and GPSLongitude.
16
- # 2) The -ee option is to extract the full track from video files.
16
+ # 2) The -ee3 option is to extract the full track from video files.
17
17
  # 3) The -fileOrder option may be used to control the order of the
18
18
  # generated track points when processing multiple files.
19
19
  #------------------------------------------------------------------------------
@@ -14,7 +14,7 @@
14
14
  # 2019/10/24 - PH Preserve sub-seconds in GPSDateTime value
15
15
  #
16
16
  # Notes: 1) Input file(s) must contain GPSLatitude and GPSLongitude.
17
- # 2) The -ee option is to extract the full track from video files.
17
+ # 2) The -ee3 option is to extract the full track from video files.
18
18
  # 3) The -fileOrder option may be used to control the order of the
19
19
  # generated track points when processing multiple files.
20
20
  #------------------------------------------------------------------------------