exiftool-vendored.pl 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 (57) hide show
  1. package/bin/Changes +129 -3
  2. package/bin/MANIFEST +2 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +2 -2
  6. package/bin/arg_files/xmp2exif.args +2 -1
  7. package/bin/config_files/example.config +1 -1
  8. package/bin/exiftool +88 -55
  9. package/bin/fmt_files/gpx.fmt +1 -1
  10. package/bin/fmt_files/gpx_wpt.fmt +1 -1
  11. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +13 -3
  12. package/bin/lib/Image/ExifTool/CBOR.pm +331 -0
  13. package/bin/lib/Image/ExifTool/Canon.pm +175 -12
  14. package/bin/lib/Image/ExifTool/CanonCustom.pm +12 -2
  15. package/bin/lib/Image/ExifTool/Charset.pm +2 -0
  16. package/bin/lib/Image/ExifTool/DPX.pm +13 -2
  17. package/bin/lib/Image/ExifTool/DarwinCore.pm +2 -2
  18. package/bin/lib/Image/ExifTool/Exif.pm +109 -3
  19. package/bin/lib/Image/ExifTool/FLIR.pm +33 -8
  20. package/bin/lib/Image/ExifTool/GIF.pm +5 -1
  21. package/bin/lib/Image/ExifTool/GPS.pm +14 -10
  22. package/bin/lib/Image/ExifTool/Geotag.pm +13 -2
  23. package/bin/lib/Image/ExifTool/GoPro.pm +16 -1
  24. package/bin/lib/Image/ExifTool/ICC_Profile.pm +96 -4
  25. package/bin/lib/Image/ExifTool/JSON.pm +7 -3
  26. package/bin/lib/Image/ExifTool/Jpeg2000.pm +154 -24
  27. package/bin/lib/Image/ExifTool/M2TS.pm +27 -12
  28. package/bin/lib/Image/ExifTool/MacOS.pm +2 -2
  29. package/bin/lib/Image/ExifTool/Nikon.pm +1204 -96
  30. package/bin/lib/Image/ExifTool/NikonCustom.pm +5 -1
  31. package/bin/lib/Image/ExifTool/NikonSettings.pm +135 -71
  32. package/bin/lib/Image/ExifTool/Olympus.pm +5 -1
  33. package/bin/lib/Image/ExifTool/OpenEXR.pm +4 -2
  34. package/bin/lib/Image/ExifTool/PDF.pm +11 -12
  35. package/bin/lib/Image/ExifTool/PNG.pm +4 -1
  36. package/bin/lib/Image/ExifTool/Panasonic.pm +2 -2
  37. package/bin/lib/Image/ExifTool/Pentax.pm +2 -1
  38. package/bin/lib/Image/ExifTool/QuickTime.pm +69 -10
  39. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +141 -111
  40. package/bin/lib/Image/ExifTool/README +9 -2
  41. package/bin/lib/Image/ExifTool/Sony.pm +56 -13
  42. package/bin/lib/Image/ExifTool/TagInfoXML.pm +9 -4
  43. package/bin/lib/Image/ExifTool/TagLookup.pm +6473 -5827
  44. package/bin/lib/Image/ExifTool/TagNames.pod +1401 -54
  45. package/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  46. package/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
  47. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +10 -0
  48. package/bin/lib/Image/ExifTool/WriteXMP.pl +10 -11
  49. package/bin/lib/Image/ExifTool/Writer.pl +50 -5
  50. package/bin/lib/Image/ExifTool/XMP.pm +125 -31
  51. package/bin/lib/Image/ExifTool/XMP2.pl +3 -1
  52. package/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
  53. package/bin/lib/Image/ExifTool.pm +89 -22
  54. package/bin/lib/Image/ExifTool.pod +21 -13
  55. package/bin/perl-Image-ExifTool.spec +1 -1
  56. package/bin/pp_build_exe.args +5 -4
  57. package/package.json +3 -3
package/bin/Changes CHANGED
@@ -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)
package/bin/MANIFEST CHANGED
@@ -48,6 +48,7 @@ html/TagNames/Apple.html
48
48
  html/TagNames/Audible.html
49
49
  html/TagNames/BMP.html
50
50
  html/TagNames/BPG.html
51
+ html/TagNames/CBOR.html
51
52
  html/TagNames/Canon.html
52
53
  html/TagNames/CanonCustom.html
53
54
  html/TagNames/CanonRaw.html
@@ -217,6 +218,7 @@ lib/Image/ExifTool/BPG.pm
217
218
  lib/Image/ExifTool/BZZ.pm
218
219
  lib/Image/ExifTool/BigTIFF.pm
219
220
  lib/Image/ExifTool/BuildTagLookup.pm
221
+ lib/Image/ExifTool/CBOR.pm
220
222
  lib/Image/ExifTool/Canon.pm
221
223
  lib/Image/ExifTool/CanonCustom.pm
222
224
  lib/Image/ExifTool/CanonRaw.pm
package/bin/META.json CHANGED
@@ -47,6 +47,6 @@
47
47
  }
48
48
  },
49
49
  "release_status" : "stable",
50
- "version" : "12.30",
50
+ "version" : "12.38",
51
51
  "x_serialization_backend" : "JSON::PP version 4.02"
52
52
  }
package/bin/META.yml CHANGED
@@ -28,5 +28,5 @@ recommends:
28
28
  Time::HiRes: 0
29
29
  requires:
30
30
  perl: 5.004
31
- version: 12.30
31
+ version: 12.38
32
32
  x_serialization_backend: 'JSON::PP version 4.02'
package/bin/README CHANGED
@@ -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
  },
package/bin/exiftool CHANGED
@@ -10,24 +10,26 @@
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;
17
16
  BEGIN {
18
17
  # (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;
18
+ my $exePath = @ARGV && lc($ARGV[0]) eq '-xpath' && shift() ? $^X : $0;
20
19
  # get exe directory
21
- $exeDir = ($Image::ExifTool::exePath =~ /(.*)[\\\/]/) ? $1 : '.';
20
+ my $exeDir = ($exePath =~ /(.*)[\\\/]/) ? $1 : '.';
21
+ my $incDir = ($0 =~ /(.*)[\\\/]/) ? "$1/lib" : './lib';
22
22
  if (-l $0) {
23
23
  my $lnk = eval { readlink $0 };
24
24
  if (defined $lnk) {
25
25
  my $lnkDir = ($lnk =~ /(.*)[\\\/]/) ? $1 : '.';
26
26
  $exeDir = (($lnk =~ m(^/)) ? '' : $exeDir . '/') . $lnkDir;
27
+ $incDir = "$exeDir/lib";
27
28
  }
28
29
  }
30
+ $Image::ExifTool::exeDir = $exeDir; # use our exeDir for loading config file
29
31
  # add lib directory at start of include path
30
- unshift @INC, ($0 =~ /(.*)[\\\/]/) ? "$1/lib" : './lib';
32
+ unshift @INC, $incDir;
31
33
  # load or disable config file if specified
32
34
  if (@ARGV and lc($ARGV[0]) eq '-config') {
33
35
  shift;
@@ -757,7 +759,7 @@ for (;;) {
757
759
  }
758
760
  my $fp = ($stayOpen == 1 ? \*STAYOPEN : \*ARGFILE);
759
761
  unless ($mt->Open($fp, $argFile)) {
760
- unless ($argFile !~ /^\// and $mt->Open($fp, "$exeDir/$argFile")) {
762
+ unless ($argFile !~ /^\// and $mt->Open($fp, "$Image::ExifTool::exeDir/$argFile")) {
761
763
  Error "Error opening arg file $argFile\n";
762
764
  $badCmd = 1;
763
765
  next
@@ -1235,7 +1237,7 @@ for (;;) {
1235
1237
  $textOverwrite += 2 if $t2 =~ /\+/; # append
1236
1238
  if ($t1 ne 'W' and lc($t1) ne 'tagout') {
1237
1239
  undef $tagOut;
1238
- } elsif ($textOverwrite >= 2 and $textOut !~ /%[-+]?\d*[.:]?\d*[lu]?[tgs]/) {
1240
+ } elsif ($textOverwrite >= 2 and $textOut !~ /%[-+]?\d*[.:]?\d*[lu]?[tgso]/) {
1239
1241
  $tagOut = 0; # append tags to one file
1240
1242
  } else {
1241
1243
  $tagOut = 1; # separate file for each tag
@@ -1619,7 +1621,7 @@ if (@newValues) {
1619
1621
  next;
1620
1622
  }
1621
1623
  my %opts = ( Shift => 0 ); # shift values if possible instead of adding/deleting
1622
- # allow writing of 'unsafe' tags unless specified by wildcard
1624
+ # allow writing of 'Unsafe' tags unless specified by wildcard
1623
1625
  $opts{Protected} = 1 unless $tag =~ /[?*]/;
1624
1626
 
1625
1627
  if ($tag =~ s/<// and defined $newVal) {
@@ -1967,6 +1969,7 @@ sub GetImageInfo($$)
1967
1969
  } else {
1968
1970
  $pipe = qq{bzip2 -dc "$file" |};
1969
1971
  }
1972
+ $$et{TRUST_PIPE} = 1;
1970
1973
  }
1971
1974
  }
1972
1975
  # evaluate -if expression for conditional processing
@@ -2237,12 +2240,13 @@ sub GetImageInfo($$)
2237
2240
  next unless defined $forcePrint;
2238
2241
  $grp0 = $grp1 = 'Unknown';
2239
2242
  }
2243
+ # add groups from structure fields
2244
+ AddGroups($$info{$tag}, $grp0, \%groups, \@groups) if ref $$info{$tag};
2240
2245
  next if $groups{$grp1};
2241
2246
  # include family 0 and 1 groups in URI except for internal tags
2242
2247
  # (this will put internal tags in the "XML" group on readback)
2243
2248
  $groups{$grp1} = $grp0;
2244
2249
  push @groups, $grp1;
2245
- AddGroups($$info{$tag}, $grp0, \%groups, \@groups) if ref $$info{$tag};
2246
2250
  }
2247
2251
  foreach $grp1 (@groups) {
2248
2252
  my $grp = $groups{$grp1};
@@ -2285,7 +2289,7 @@ TAG: foreach $tag (@foundTags) {
2285
2289
  # avoid extracting Protected binary tags (eg. data blocks) [insider information]
2286
2290
  my $lcTag = lc $tag;
2287
2291
  $lcTag =~ s/ .*//;
2288
- next unless $$et{REQ_TAG_LOOKUP}{$lcTag};
2292
+ next unless $$et{REQ_TAG_LOOKUP}{$lcTag} or ($$et{OPTIONS}{RequestAll} || 0) > 2;
2289
2293
  }
2290
2294
  $val = ConvertBinary($val); # convert SCALAR references
2291
2295
  next unless defined $val;
@@ -2365,7 +2369,8 @@ TAG: foreach $tag (@foundTags) {
2365
2369
  }
2366
2370
  my @groups = $et->GetGroup($tag);
2367
2371
  $outfile and close($fp), undef($tmpText); # (shouldn't happen)
2368
- ($fp, $outfile, $append) = OpenOutputFile($orig, $tagName, \@groups, $ext);
2372
+ my $org = $et->GetValue('OriginalRawFileName') || $et->GetValue('OriginalFileName');
2373
+ ($fp, $outfile, $append) = OpenOutputFile($orig, $tagName, \@groups, $ext, $org);
2369
2374
  $fp or ++$countBad, next TAG;
2370
2375
  $tmpText = $outfile unless $append;
2371
2376
  }
@@ -3061,12 +3066,14 @@ sub SetImageInfo($$$)
3061
3066
  # temporarily disable CTRL-C during this critical operation
3062
3067
  $critical = 1;
3063
3068
  undef $tmpFile; # handle deletion of temporary file ourself
3064
- if ($et->Open(\*ORIG_FILE, $file, '>')) {
3069
+ if ($et->Open(\*ORIG_FILE, $file, '+<')) {
3065
3070
  binmode(ORIG_FILE);
3066
3071
  while (read(NEW_FILE, $buff, 65536)) {
3067
3072
  print ORIG_FILE $buff or $err = 1;
3068
3073
  }
3069
3074
  close(NEW_FILE);
3075
+ # Handle files being shorter than the original
3076
+ eval { truncate(ORIG_FILE, tell(ORIG_FILE)) } or $err = 1;
3070
3077
  close(ORIG_FILE) or $err = 1;
3071
3078
  if ($err) {
3072
3079
  Warn "Couldn't overwrite in place - $file\n";
@@ -3250,7 +3257,8 @@ sub FormatXML($$$)
3250
3257
  } elsif (ref $val eq 'HASH') {
3251
3258
  $gt = " rdf:parseType='Resource'>";
3252
3259
  my $val2 = '';
3253
- foreach (sort keys %$val) {
3260
+ my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3261
+ foreach (@keys) {
3254
3262
  # (some variable-namespace XML structure fields may have a different group)
3255
3263
  my $tok = /:/ ? $_ : ($grp . ':' . $_);
3256
3264
  $val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
@@ -3327,7 +3335,8 @@ sub FormatJSON($$$)
3327
3335
  } elsif (ref $val eq 'HASH') {
3328
3336
  my ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
3329
3337
  print $fp $bra;
3330
- foreach (sort keys %$val) {
3338
+ my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3339
+ foreach (@keys) {
3331
3340
  print $fp ',' if $comma;
3332
3341
  my $key = EscapeJSON($_, 1);
3333
3342
  print $fp qq(\n$ind $key$sep );
@@ -3460,18 +3469,26 @@ sub ConvertBinary($)
3460
3469
  }
3461
3470
 
3462
3471
  #------------------------------------------------------------------------------
3463
- # Compare two tag values to see if they are equal
3472
+ # Compare ValueConv and PrintConv values of a tag to see if they are equal
3464
3473
  # Inputs: 0) value1, 1) value2
3465
3474
  # Returns: true if they are equal
3466
3475
  sub IsEqual($$)
3467
3476
  {
3468
- return 1 if ref $_[0] eq 'SCALAR' or $_[0] eq $_[1];
3469
- return 0 if ref $_[0] ne 'ARRAY' or ref $_[1] ne 'ARRAY' or
3470
- @{$_[0]} ne @{$_[1]};
3471
- # test all elements of an array
3472
- my $i = 0;
3473
- for ($i=0; $i<scalar(@{$_[0]}); ++$i) {
3474
- return 0 if $_[0][$i] ne $_[1][$i];
3477
+ my ($a, $b) = @_;
3478
+ # (scalar values are not print-converted)
3479
+ return 1 if $a eq $b or ref $a eq 'SCALAR';
3480
+ if (ref $a eq 'HASH' and ref $b eq 'HASH') {
3481
+ return 0 if scalar(keys %$a) != scalar(keys %$b);
3482
+ my $key;
3483
+ foreach $key (keys %$a) {
3484
+ return 0 unless IsEqual($$a{$key}, $$b{$key});
3485
+ }
3486
+ } else {
3487
+ return 0 if ref $a ne 'ARRAY' or ref $b ne 'ARRAY' or @$a != @$b;
3488
+ my $i;
3489
+ for ($i=0; $i<scalar(@$a); ++$i) {
3490
+ return 0 unless IsEqual($$a[$i], $$b[$i]);
3491
+ }
3475
3492
  }
3476
3493
  return 1;
3477
3494
  }
@@ -3799,7 +3816,7 @@ sub FindFileWindows($$)
3799
3816
  my $enc = $et->Options('CharsetFileName');
3800
3817
  $wildfile = $et->Decode($wildfile, $enc, undef, 'UTF8') if $enc and $enc ne 'UTF8';
3801
3818
  $wildfile =~ tr/\\/\//; # use forward slashes
3802
- my ($dir, $wildname) = ($wildfile =~ m{(.*/)(.*)}) ? ($1, $2) : ('', $wildfile);
3819
+ my ($dir, $wildname) = ($wildfile =~ m{(.*[:/])(.*)}) ? ($1, $2) : ('', $wildfile);
3803
3820
  if ($dir =~ /[*?]/) {
3804
3821
  Warn "Wildcards don't work in the directory specification\n";
3805
3822
  return ();
@@ -3939,7 +3956,7 @@ sub SuggestedExtension($$$)
3939
3956
  $ext = 'xml';
3940
3957
  } elsif ($$valPt =~ /^RIFF....WAVE/s) {
3941
3958
  $ext = 'wav';
3942
- } elsif ($tag eq 'OriginalRawFileData' and defined($ext = $et->GetValue('OriginalRawFileName'))) {
3959
+ } elsif ($tag eq 'OriginalRawImage' and defined($ext = $et->GetValue('OriginalRawFileName'))) {
3943
3960
  $ext =~ s/^.*\.//s;
3944
3961
  $ext = $ext ? lc($ext) : 'raw';
3945
3962
  } elsif ($tag eq 'EXIF') {
@@ -3991,14 +4008,15 @@ sub LoadPrintFormat($)
3991
4008
  # A sort of sprintf for filenames
3992
4009
  # Inputs: 0) format string (%d=dir, %f=file name, %e=ext),
3993
4010
  # 1) source filename or undef to test format string
3994
- # 2-4) [%t %g %s only] tag name, ref to array of group names, suggested extension
4011
+ # 2-4) [%t %g %s %o only] tag name, ref to array of group names,
4012
+ # suggested extension, original raw file name
3995
4013
  # Returns: new filename or undef on error (or if no file and fmt contains token)
3996
4014
  sub FilenameSPrintf($;$@)
3997
4015
  {
3998
4016
  my ($fmt, $file, @extra) = @_;
3999
4017
  local $_;
4000
4018
  # return format string straight away if no tokens
4001
- return $fmt unless $fmt =~ /%[-+]?\d*[.:]?\d*[lu]?[dDfFeEtgs]/;
4019
+ return $fmt unless $fmt =~ /%[-+]?\d*[.:]?\d*[lu]?[dDfFeEtgso]/;
4002
4020
  return undef unless defined $file;
4003
4021
  CleanFilename($file); # make sure we are using forward slashes
4004
4022
  # split filename into directory, file, extension
@@ -4012,9 +4030,9 @@ sub FilenameSPrintf($;$@)
4012
4030
  }
4013
4031
  $part{F} = $part{f} . $part{E};
4014
4032
  ($part{D} = $part{d}) =~ s{/+$}{};
4015
- @part{qw(t g s)} = @extra;
4033
+ @part{qw(t g s o)} = @extra;
4016
4034
  my ($filename, $pos) = ('', 0);
4017
- while ($fmt =~ /(%([-+]?)(\d*)([.:]?)(\d*)([lu]?)([dDfFeEtgs]))/g) {
4035
+ while ($fmt =~ /(%([-+]?)(\d*)([.:]?)(\d*)([lu]?)([dDfFeEtgso]))/g) {
4018
4036
  $filename .= substr($fmt, $pos, pos($fmt) - $pos - length($1));
4019
4037
  $pos = pos($fmt);
4020
4038
  my ($sign, $wid, $dot, $skip, $mod, $code) = ($2, $3, $4, $5 || 0, $6, $7);
@@ -4177,7 +4195,7 @@ sub OpenOutputFile($;@)
4177
4195
  if ($textOut) {
4178
4196
  $outfile = $file;
4179
4197
  CleanFilename($outfile);
4180
- if ($textOut =~ /%[-+]?\d*[.:]?\d*[lun]?[dDfFeEtgscC]/ or defined $tagOut) {
4198
+ if ($textOut =~ /%[-+]?\d*[.:]?\d*[lun]?[dDfFeEtgsocC]/ or defined $tagOut) {
4181
4199
  # make filename from printf-like $textOut
4182
4200
  $outfile = FilenameSPrintf($textOut, $file, @args);
4183
4201
  return () unless defined $outfile;
@@ -4714,6 +4732,14 @@ group delete (unless a family 2 group is specified, see note 4 below).
4714
4732
  Instead, individual tags may be recovered using the B<-tagsFromFile> option
4715
4733
  (eg. C<-all= -tagsfromfile @ -artist>).
4716
4734
 
4735
+ To speed processing when reading XMP, exclusions in XMP groups also bypass
4736
+ processing of the corresponding XMP property and any contained properties.
4737
+ For example, C<--xmp-crs:all> may speed processing significantly in cases
4738
+ where a large number of XMP-crs tags exist. To use this feature to bypass
4739
+ processing of a specific XMP property, the property name must be used
4740
+ instead of the ExifTool tag name (eg. C<--xmp-crs:dabs>). Also, C<XMP-all>
4741
+ may be used to to indicate any XMP namespace (eg. <C--xmp-all:dabs>).
4742
+
4717
4743
  =item B<->I<TAG>[+-^]B<=>[I<VALUE>]
4718
4744
 
4719
4745
  Write a new value for the specified tag (eg. C<-comment=wow>), or delete the
@@ -4724,17 +4750,18 @@ for more details). C<+=> may also be used to increment numerical values (or
4724
4750
  decrement if I<VALUE> is negative), and C<-=> may be used to conditionally
4725
4751
  delete or replace a tag (see L</WRITING EXAMPLES> for examples). C<^=> is
4726
4752
  used to write an empty string instead of deleting the tag when no I<VALUE>
4727
- is given, but otherwise it is equivalent to C<=>.
4753
+ is given, but otherwise it is equivalent to C<=>, but note that the caret
4754
+ must be quoted on the Windows command line.
4728
4755
 
4729
4756
  I<TAG> may contain one or more leading family 0, 1, 2 or 7 group names,
4730
4757
  prefixed by optional family numbers, and separated colons. If no group name
4731
4758
  is specified, the tag is created in the preferred group, and updated in any
4732
4759
  other location where a same-named tag already exists. The preferred group
4733
- is the first group in the following list where I<TAG> is valid: 1) EXIF, 2)
4734
- IPTC, 3) XMP.
4760
+ in JPEG and TIFF-format images is the first group in the following list
4761
+ where I<TAG> is valid: 1) EXIF, 2) IPTC, 3) XMP.
4735
4762
 
4736
4763
  The wildcards C<*> and C<?> may be used in tag names to assign the same
4737
- value to multiple tags. When specified with wildcards, "unsafe" tags are
4764
+ value to multiple tags. When specified with wildcards, "Unsafe" tags are
4738
4765
  not written. A tag name of C<All> is equivalent to C<*> (except that it
4739
4766
  doesn't require quoting, while arguments with wildcards do on systems with
4740
4767
  shell globbing), and is often used when deleting all metadata (ie. C<-All=>)
@@ -4880,10 +4907,10 @@ See L</COPYING EXAMPLES> for examples using B<-tagsFromFile>.
4880
4907
  Notes:
4881
4908
 
4882
4909
  1) Some tags (generally tags which may affect the appearance of the image)
4883
- are considered "unsafe" to write, and are only copied if specified
4910
+ are considered "Unsafe" to write, and are only copied if specified
4884
4911
  explicitly (ie. no wildcards). See the
4885
4912
  L<tag name documentation|Image::ExifTool::TagNames> for more details about
4886
- "unsafe" tags.
4913
+ "Unsafe" tags.
4887
4914
 
4888
4915
  2) Be aware of the difference between excluding a tag from being copied
4889
4916
  (--I<TAG>), and deleting a tag (-I<TAG>=). Excluding a tag prevents it from
@@ -4981,7 +5008,7 @@ intermediate file (C<out.args> in this example):
4981
5008
  exiftool -@ out.args -sep ', ' dst.jpg
4982
5009
 
4983
5010
  Note: Be careful when copying information with this technique since it is
4984
- easy to write tags which are normally considered "unsafe". For instance,
5011
+ easy to write tags which are normally considered "Unsafe". For instance,
4985
5012
  the FileName and Directory tags are excluded in the example above to avoid
4986
5013
  renaming and moving the destination file. Also note that the second command
4987
5014
  above will produce warning messages for any tags which are not writable.
@@ -5001,8 +5028,8 @@ are in the default output. By default, list items are separated by a
5001
5028
  newline when extracted with the B<-b> option, but this may be changed (see
5002
5029
  the B<-sep> option for details). May be combined with B<-j>, B<-php> or
5003
5030
  B<-X> to extract binary data in JSON, PHP or XML format, but note that
5004
- "unsafe" tags must be specified explicitly to be extracted as binary in
5005
- these formats.
5031
+ "Unsafe" tags are not extracted as binary unless they are specified explicitly or
5032
+ the API RequestAll option is set to 3 or higher.
5006
5033
 
5007
5034
  With a leading double dash (B<--b> or B<--binary>), tags which contain
5008
5035
  binary data are suppressed in the output when reading.
@@ -5163,9 +5190,11 @@ various components of a date/time value. The specifics of the I<FMT> syntax
5163
5190
  are system dependent -- consult the C<strftime> man page on your system for
5164
5191
  details. The default format is equivalent to "%Y:%m:%d %H:%M:%S". This
5165
5192
  option has no effect on date-only or time-only tags and ignores timezone
5166
- information if present. Only one B<-d> option may be used per command.
5167
- Requires POSIX::strptime or Time::Piece for the inversion conversion when
5168
- writing.
5193
+ information if present. ExifTool adds a C<%f> format code to represent
5194
+ fractional seconds, and supports an optional width to specify the number of
5195
+ digits after the decimal point (eg. C<%3f> would give something like
5196
+ C<.437>). Only one B<-d> option may be used per command. Requires
5197
+ POSIX::strptime or Time::Piece for the inversion conversion when writing.
5169
5198
 
5170
5199
  =item B<-D> (B<-decimal>)
5171
5200
 
@@ -5203,7 +5232,7 @@ By default the resulting group name is simplified by removing any leading
5203
5232
  C<Main:> and collapsing adjacent identical group names, but this can be
5204
5233
  avoided by placing a colon before the first family number (eg. B<-g:3:1>).
5205
5234
  Use the B<-listg> option to list group names for a specified family. The
5206
- SavePath and SaveFormat API options are automatically enabled if the
5235
+ API SavePath and SaveFormat options are automatically enabled if the
5207
5236
  respective family 5 or 6 group names are requested. See the
5208
5237
  L<API GetGroup documentation|Image::ExifTool/GetGroup> for more information.
5209
5238
 
@@ -5392,7 +5421,8 @@ directory if C<#[SECT]> contains C<$directory>). Lines beginning with
5392
5421
  C<#[BODY]> and lines not beginning with C<#> are output for each processed
5393
5422
  file. Lines beginning with C<#[IF]> are not output, but all BODY lines are
5394
5423
  skipped if any tag on an IF line doesn't exist. Other lines beginning with
5395
- C<#> are ignored. For example, this format file:
5424
+ C<#> are ignored. (To output a line beginning with C<#>, use C<#[BODY]#>.)
5425
+ For example, this format file:
5396
5426
 
5397
5427
  # this is a comment line
5398
5428
  #[HEAD]-- Generated by ExifTool $exifToolVersion --
@@ -5406,7 +5436,7 @@ with this command:
5406
5436
 
5407
5437
  produces output like this:
5408
5438
 
5409
- -- Generated by ExifTool 12.30 --
5439
+ -- Generated by ExifTool 12.38 --
5410
5440
  File: a.jpg - 2003:10:31 15:44:19
5411
5441
  (f/5.6, 1/60s, ISO 100)
5412
5442
  File: b.jpg - 2006:05:23 11:57:38
@@ -5423,7 +5453,7 @@ are effectively processed as separate input files.
5423
5453
  If a specified tag does not exist, a minor warning is issued and the line
5424
5454
  with the missing tag is not printed. However, the B<-f> option may be used
5425
5455
  to set the value of missing tags to '-' (but this may be configured via the
5426
- MissingTagValue API option), or the B<-m> option may be used to ignore minor
5456
+ API MissingTagValue option), or the B<-m> option may be used to ignore minor
5427
5457
  warnings and leave the missing values empty. Alternatively, B<-q -q> may be
5428
5458
  used to simply suppress the warning messages.
5429
5459
 
@@ -5661,12 +5691,14 @@ between B<-W> and B<-w>:
5661
5691
 
5662
5692
  1) With B<-W>, a new output file is created for each extracted tag.
5663
5693
 
5664
- 2) B<-W> supports three additional format codes: %t, %g and %s represent
5665
- the tag name, group name, and suggested extension for the output file (based
5666
- on the format of the data). The %g code may be followed by a single digit
5667
- to specify the group family number (eg. %g1), otherwise family 0 is assumed.
5668
- The substring width/position/case specifiers may be used with these format
5669
- codes in exactly the same way as with %f and %e.
5694
+ 2) B<-W> supports four additional format codes: %t, %g and %s represent the
5695
+ tag name, group name, and suggested extension for the output file (based on
5696
+ the format of the data), and %o represents the value of the
5697
+ OriginalRawFileName or OriginalFileName tag from the input file (including
5698
+ extension). The %g code may be followed by a single digit to specify the
5699
+ group family number (eg. %g1), otherwise family 0 is assumed. The substring
5700
+ width/position/case specifiers may be used with these format codes in
5701
+ exactly the same way as with %f and %e.
5670
5702
 
5671
5703
  3) The argument for B<-W> is interpreted as a file name if it contains no
5672
5704
  format codes. (For B<-w>, this would be a file extension.) This change
@@ -5686,7 +5718,7 @@ example, the following pairs of commands give the same result:
5686
5718
  4) Adding the B<-v> option to B<-W> sends a list of the tags and output file
5687
5719
  names to the console instead of giving a verbose dump of the entire file.
5688
5720
  (Unless appending all output to one file for each source file by using
5689
- B<-W+> with an output file I<FMT> that does not contain %t, $g or %s.)
5721
+ B<-W+> with an output file I<FMT> that does not contain %t, %g, %s or %o.)
5690
5722
 
5691
5723
  5) Individual list items are stored in separate files when B<-W> is combined
5692
5724
  with B<-b>, but note that for separate files to be created %c or %C must be
@@ -5722,9 +5754,10 @@ The B<-t> option adds tag table information to the output (see B<-t> for
5722
5754
  details).
5723
5755
 
5724
5756
  Note: This output is NOT the same as XMP because it uses
5725
- dynamically-generated property names corresponding to the ExifTool tag
5726
- names, and not the standard XMP properties. To write XMP instead, use the
5727
- B<-o> option with an XMP extension for the output file.
5757
+ dynamically-generated property names corresponding to the ExifTool tag names
5758
+ with ExifTool family 1 group names as namespaces, and not the standard XMP
5759
+ properties and namespaces. To write XMP instead, use the B<-o> option with
5760
+ an XMP extension for the output file.
5728
5761
 
5729
5762
  =back
5730
5763
 
@@ -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
  #------------------------------------------------------------------------------