exiftool-vendored.pl 12.39.0 → 12.42.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 (46) hide show
  1. package/bin/Changes +66 -1
  2. package/bin/MANIFEST +1 -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/exif2xmp.args +5 -0
  7. package/bin/arg_files/xmp2exif.args +6 -0
  8. package/bin/config_files/acdsee.config +6 -6
  9. package/bin/config_files/photoshop_paths.config +30 -7
  10. package/bin/config_files/picasa_faces.config +1 -1
  11. package/bin/config_files/pix4d.config +2 -2
  12. package/bin/config_files/tiff_version.config +2 -2
  13. package/bin/exiftool +54 -22
  14. package/bin/lib/Image/ExifTool/Canon.pm +89 -6
  15. package/bin/lib/Image/ExifTool/DJI.pm +59 -1
  16. package/bin/lib/Image/ExifTool/DNG.pm +8 -2
  17. package/bin/lib/Image/ExifTool/Exif.pm +53 -20
  18. package/bin/lib/Image/ExifTool/Geotag.pm +3 -2
  19. package/bin/lib/Image/ExifTool/ICC_Profile.pm +10 -8
  20. package/bin/lib/Image/ExifTool/ID3.pm +5 -5
  21. package/bin/lib/Image/ExifTool/MacOS.pm +9 -9
  22. package/bin/lib/Image/ExifTool/MakerNotes.pm +17 -1
  23. package/bin/lib/Image/ExifTool/Nikon.pm +44 -12
  24. package/bin/lib/Image/ExifTool/NikonCustom.pm +4 -1
  25. package/bin/lib/Image/ExifTool/Olympus.pm +27 -7
  26. package/bin/lib/Image/ExifTool/PDF.pm +2 -1
  27. package/bin/lib/Image/ExifTool/Panasonic.pm +10 -1
  28. package/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  29. package/bin/lib/Image/ExifTool/Photoshop.pm +6 -5
  30. package/bin/lib/Image/ExifTool/QuickTime.pm +9 -5
  31. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +2 -2
  32. package/bin/lib/Image/ExifTool/Samsung.pm +237 -2
  33. package/bin/lib/Image/ExifTool/Shortcuts.pm +3 -1
  34. package/bin/lib/Image/ExifTool/Sony.pm +10 -4
  35. package/bin/lib/Image/ExifTool/TagLookup.pm +6376 -6354
  36. package/bin/lib/Image/ExifTool/TagNames.pod +79 -28
  37. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +7 -3
  38. package/bin/lib/Image/ExifTool/WriteXMP.pl +2 -0
  39. package/bin/lib/Image/ExifTool/Writer.pl +1 -1
  40. package/bin/lib/Image/ExifTool/XMP.pm +9 -1
  41. package/bin/lib/Image/ExifTool/XMPStruct.pl +21 -7
  42. package/bin/lib/Image/ExifTool.pm +20 -12
  43. package/bin/lib/Image/ExifTool.pod +7 -6
  44. package/bin/perl-Image-ExifTool.spec +1 -1
  45. package/bin/pp_build_exe.args +4 -4
  46. package/package.json +14 -3
package/bin/Changes CHANGED
@@ -4,9 +4,74 @@ ExifTool Version History
4
4
 
5
5
  RSS feed: https://exiftool.org/rss.xml
6
6
 
7
- Note: The most recent production release is Version 12.30. (Other versions are
7
+ Note: The most recent production release is Version 12.42. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ June 1, 2022 - Version 12.42 (production release)
11
+
12
+ - Added support for reading maker notes from Panasonic DC-GH6 videos
13
+ - Added conversion for Samsung MCCData
14
+ - Added a new Nikon LensID (thanks Chris)
15
+ - Added a few new Canon LensType values
16
+ - Added a couple of new Olympus StackedImage values (thanks Eberhard)
17
+ - Added a few new values for some Nikon Settings tags (thanks Warren Hatch)
18
+ - Added a "lang:" element to the -json output for alternate language tags when
19
+ -D, -H or -t is used
20
+ - Update DNG writer to not issue an error when writing DNG 1.6 files
21
+ - Decode information from DJI "ae_dbg_info" maker notes
22
+ - Decode Olympus AISubjectTrackingMode
23
+ - Changed ExifTool FileSize print conversion to use kB/MB/GB units instead of
24
+ KiB/MiB/GiB
25
+ - Changed "is not shiftable" warning to appear in -v (instead of just -v3)
26
+ output
27
+ - Patched to allow PDF Encrypt object to be "null"
28
+ - Fixed bug reading ICC_Profile 'meta' tags
29
+
30
+ Apr. 7, 2022 - Version 12.41
31
+
32
+ - Added support for "OM SYSTEM" maker notes
33
+ - Added 2 new Sony LensType values (thanks Jos Roost)
34
+ - Added some new Canon lenses (thanks LibRaw)
35
+ - Added a new Nikon LensID (thanks Bert Ligtvoet)
36
+ - Added a new Canon ContinuousDrive value (thanks Wolfgang Gulcker)
37
+ - Enhanced -v0 option to also print new file name when renaming, moving or
38
+ copying a file
39
+ - Updated xmp2exif.args and exif2xmp.args helper files to reflect the IPTC
40
+ Photometadata Mapping Guidelines version 2202.1
41
+ - Made "Invalid Xxx data" a minor warning for MakerNote data
42
+ - Patched to allow writing of MP4 videos which have other tracks with a
43
+ missing sample description entry
44
+ - Patched MacOS version to specify directory for external utilities (setfile,
45
+ xattr, stat, mdls and osascript from /usr/bin, and tag from /usr/local/bin)
46
+ - Fixed long-standing problem where Windows version could behave differently
47
+ for -if conditions containing undefined tags
48
+ - Fixed problem where -W+! combined with -j or -X produced invalid JSON or XML
49
+ when processing multiple files
50
+ - Fixed potential "uninitialized value $time in division" runtime warning when
51
+ reading MP4 videos
52
+
53
+ Feb. 9, 2022 - Version 12.40
54
+
55
+ - Added PageCount tag to return the number of pages in a multi-page TIFF
56
+ - Added a new Nikon LensID (thanks Wolfgang Exler)
57
+ - Added a few more Sony LensTypes (thanks Jos Roost)
58
+ - Decode some new Canon tags (thanks Mark Reid)
59
+ - Decode another Nikon Z9 tag (thanks Warren Hatch)
60
+ - Decode Nikon NKSC GPSImgDirection (thanks Olaf)
61
+ - Improved handling of empty XMP structures in lists
62
+ - Tolerate leading UTF-8 BOM in -geotag log files
63
+ - Updated photoshop_paths.config to include WorkingPath
64
+ - Patched to allow writing of MP4 videos which have url tracks with a missing
65
+ sample description entry
66
+ - Fixed deep recursion error when reading multi-page TIFF images with more
67
+ than 100 pages
68
+ - Fixed potential deep recursion runtime error when writing nested XMP
69
+ structures
70
+ - Fixed warning which could be generated when writing new
71
+ Composite:GPSCoordinates tag
72
+ - Fixed description of GPR (General Purpose RAW) file type
73
+ - Fixed typo in the name of a new Nikon tag (thanks Herb)
74
+
10
75
  Jan. 13, 2022 - Version 12.39
11
76
 
12
77
  - Added a new Pentax LensType (thanks Christian Shulz)
package/bin/MANIFEST CHANGED
@@ -194,6 +194,7 @@ html/idiosyncracies.html
194
194
  html/index.html
195
195
  html/install.html
196
196
  html/metafiles.html
197
+ html/mistakes.html
197
198
  html/overview.png
198
199
  html/standards.html
199
200
  html/struct.html
package/bin/META.json CHANGED
@@ -47,6 +47,6 @@
47
47
  }
48
48
  },
49
49
  "release_status" : "stable",
50
- "version" : "12.39",
50
+ "version" : "12.42",
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.39
31
+ version: 12.42
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.39.tar.gz | tar -xf -
111
- cd Image-ExifTool-12.39
110
+ gzip -dc Image-ExifTool-12.42.tar.gz | tar -xf -
111
+ cd Image-ExifTool-12.42
112
112
  ./exiftool t/images/ExifTool.jpg
113
113
 
114
114
  Note: These commands extract meta information from one of the test images.
@@ -12,8 +12,10 @@
12
12
  # 2013/06/12 - PH Additions for the Exif 2.3 for XMP spec
13
13
  # 2015/01/12 - PH Avoid copying to non-standard namespaces
14
14
  # 2018/05/07 - PH Added support for GPSDestXxxRef tags
15
+ # 2022/03/31 - PH IPTC Photometadata Mapping Guidelines 2202.1 update
15
16
  #
16
17
  # References: http://www.metadataworkinggroup.org/specs/
18
+ # https://iptc.org/std/photometadata/documentation/mappingguidelines/
17
19
  #
18
20
  # Notes: 1) The first three arguments copy most of the EXIF and GPS tags to
19
21
  # XMP-exif/XMP-tiff, and the remaining arguments handle tags
@@ -22,6 +24,8 @@
22
24
  # 2) These arguments will not delete existing XMP tags which are
23
25
  # missing from the EXIF. The XMP tags should be deleted
24
26
  # beforehand if required.
27
+ #
28
+ # 3) EXIF:SubjectArea is not currently mapped into XMP-iptcExt:ImageRegion
25
29
  #------------------------------------------------------------------------------
26
30
  -XMP-exif:all < EXIF:all
27
31
  -XMP-exifEX:all < EXIF:all
@@ -37,6 +41,7 @@
37
41
  -XMP-xmp:CreatorTool < EXIF:Software
38
42
  -XMP-dc:Rights < EXIF:Copyright
39
43
  -XMP-dc:Creator < EXIF:Artist
44
+ -XMP-iptcExt:DigitalImageGUID < EXIF:DigImageGUID
40
45
  # XMP flash information is translated by the Composite Flash tag
41
46
  -Composite:Flash < EXIF:Flash
42
47
  # overwrite GPS tags which have different formats in XMP
@@ -14,8 +14,10 @@
14
14
  # 2016/09/26 - PH Write Composite SubSec tags
15
15
  # 2018/05/07 - PH Added support for GPSDestXxxRef tags
16
16
  # 2021/09/30 - PH Removed erroneous "-" when copying CreatorTool
17
+ # 2022/03/31 - PH IPTC Photometadata Mapping Guidelines 2202.1 update
17
18
  #
18
19
  # References: http://www.metadataworkinggroup.org/specs/
20
+ # https://iptc.org/std/photometadata/documentation/mappingguidelines/
19
21
  #
20
22
  # Notes: 1) The first three arguments copy the bulk of the EXIF and GPS
21
23
  # information, and the remaining arguments handle the tags
@@ -24,6 +26,8 @@
24
26
  # 2) These arguments will not delete existing EXIF tags which are
25
27
  # missing from the XMP. The EXIF tags should be deleted
26
28
  # beforehand if required.
29
+ #
30
+ # 3) XMP-iptcExt:ImageRegion is not currently mapped into EXIF:SubjectArea
27
31
  #------------------------------------------------------------------------------
28
32
  -EXIF:all < XMP-exif:all
29
33
  -EXIF:all < XMP-exifEX:all
@@ -37,7 +41,9 @@
37
41
  -Composite:SubSecModifyDate < XMP-xmp:ModifyDate
38
42
  -EXIF:Software < XMP-xmp:CreatorTool
39
43
  -EXIF:Copyright < XMP-dc:Rights
44
+ -EXIF:Artist < XMP-plus:ImageCreatorName
40
45
  -EXIF:Artist < XMP-dc:Creator
46
+ -EXIF:DigImageGUID < XMP-iptcExt:DigitalImageGUID
41
47
  # XMP flash information is translated by the Composite Flash tag
42
48
  -EXIF:Flash < Composite:Flash
43
49
  # generate GPS tags which have been combined into other XMP tags
@@ -97,8 +97,8 @@ my %sACDSeeRegionStruct = (
97
97
  # new XMP namespaces for ACDSee regions
98
98
  'Image::ExifTool::XMP::Main' => {
99
99
  'acdsee-rs' => { # <-- must be the same as the NAMESPACE prefix
100
- SubDirectory => {
101
- TagTable => 'Image::ExifTool::UserDefined::ACDSeeRegions'
100
+ SubDirectory => {
101
+ TagTable => 'Image::ExifTool::UserDefined::ACDSeeRegions'
102
102
  },
103
103
  },
104
104
  },
@@ -147,7 +147,7 @@ my %sACDSeeRegionStruct = (
147
147
  },
148
148
  ValueConv => q{
149
149
  my ($rgn, @newRgns);
150
- my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
150
+ my $rgns = ref $val[0] eq 'ARRAY' ? $val[0] : [ $val[0] ];
151
151
  foreach $rgn (@$rgns) {
152
152
  my %newRgn = ( Type => 'Face' );
153
153
  if ($$rgn{RegionBoundary} and $$rgn{RegionBoundary}{RbShape} eq 'rectangle') {
@@ -220,13 +220,13 @@ my %sACDSeeRegionStruct = (
220
220
  # the "Struct" entry defines the structure fields
221
221
  Struct => {
222
222
  # optional structure name (used for warning messages only)
223
- STRUCT_NAME => 'ACDSee RegionInfo',
223
+ STRUCT_NAME => 'ACDSee RegionInfo',
224
224
  RegionList => {
225
225
  FlatName => 'Region',
226
226
  Struct => \%sACDSeeRegionStruct,
227
227
  List => 'Bag',
228
228
  },
229
- AppliedToDimensions => {
229
+ AppliedToDimensions => {
230
230
  FlatName => 'RegionAppliedToDimensions',Struct => \%sACDSeeDimensions },
231
231
  },
232
232
  },
@@ -239,7 +239,7 @@ my %sACDSeeRegionStruct = (
239
239
  RegionInfoACDSeeAppliedToDimensionsW => 'ACDSeeRegionAppliedToDimensionsW',
240
240
  RegionInfoACDSeeRegionListDLYAreaH => 'ACDSeeRegionDLYAreaH',
241
241
  RegionInfoACDSeeRegionListDLYAreaW => 'ACDSeeRegionDLYAreaW',
242
- RegionInfoACDSeeRegionListDLYAreaX => 'ACDSeeRegionDLYAreaX',
242
+ RegionInfoACDSeeRegionListDLYAreaX => 'ACDSeeRegionDLYAreaX',
243
243
  RegionInfoACDSeeRegionListDLYAreaY => 'ACDSeeRegionDLYAreaY',
244
244
  RegionInfoACDSeeRegionListALGAreaH => 'ACDSeeRegionALGAreaH',
245
245
  RegionInfoACDSeeRegionListALGAreaW => 'ACDSeeRegionALGAreaW',
@@ -34,15 +34,15 @@
34
34
  # Usage:
35
35
  #
36
36
  # 1) Extract Photoshop path names:
37
- #
37
+ #
38
38
  # exiftool -config photoshop_paths.config -allpaths FILE
39
39
  #
40
40
  # 2) Extract Photoshop path names and anchor points:
41
- #
41
+ #
42
42
  # exiftool -config photoshop_paths.config -userparam anchor -allpaths FILE
43
43
  #
44
44
  # 3) Extract Photoshop path anchor points only:
45
- #
45
+ #
46
46
  # exiftool -config photoshop_paths.config -userparam anchoronly -allpaths FILE
47
47
  #
48
48
  # 4) Copy all Photoshop paths from one file (SRC) to another (DST):
@@ -68,6 +68,7 @@
68
68
  # subpath respectively
69
69
  # 2017/06/03 - PH Added TotalPathPoints
70
70
  # 2017/07/17 - PH Added UniquePathPoints
71
+ # 2022/02/03 - PH Added WorkingPath and WorkingPathPix
71
72
  #
72
73
  # References: https://exiftool.org/forum/index.php/topic,1621.0.html
73
74
  # https://exiftool.org/forum/index.php/topic,3910.0.html
@@ -77,10 +78,11 @@
77
78
  # Print Photoshop path name and/or anchor points
78
79
  # Inputs: 0) reference to Photoshop path data, 1) ExifTool object reference
79
80
  # 2-3) optional image width/height to convert anchor points to pixels
81
+ # 4) optional path name
80
82
  # Returns: String with name and/or Bezier knot anchor points
81
- sub PrintPath($$;$$)
83
+ sub PrintPath($$;$$$)
82
84
  {
83
- my ($val, $et, $w, $h) = @_;
85
+ my ($val, $et, $w, $h, $nm) = @_;
84
86
  my ($pos, $name, @rtn);
85
87
  my $len = length($$val) - 26;
86
88
 
@@ -88,8 +90,9 @@ sub PrintPath($$;$$)
88
90
  if ($$val =~ m{.*/#(.{0,255})#/$}s) {
89
91
  $name = $1;
90
92
  $len -= length($1) + 4;
93
+ $name = $nm if defined $nm and not length $name;
91
94
  } else {
92
- $name = '<none>';
95
+ $name = defined $nm ? $nm : '<none>';
93
96
  }
94
97
  my $anchorOnly = $et->Options(UserParam => 'AnchorOnly');
95
98
  push @rtn, $name unless $anchorOnly;
@@ -118,7 +121,7 @@ sub PrintPath($$;$$)
118
121
  }
119
122
 
120
123
  %Image::ExifTool::Shortcuts::UserDefined = (
121
- # create "AllPaths" shortcut for all Photoshop path tags
124
+ # create "AllPaths" shortcut for all Photoshop path tags (except WorkingPath)
122
125
  AllPaths => [
123
126
  map { sprintf "Path%x", $_ } (0x7d0 .. 0xbb5),
124
127
  ],
@@ -133,6 +136,14 @@ sub PrintPath($$;$$)
133
136
  Name => 'OriginPathInfo',
134
137
  Flags => [ qw(Writable Protected Binary SetResourceName) ],
135
138
  },
139
+ 0x401 => {
140
+ Name => 'WorkingPath',
141
+ Flags => [ qw(Writable Protected Binary ConvertBinary SetResourceName) ],
142
+ PrintConv => sub {
143
+ my ($val, $et) = @_;
144
+ PrintPath($val, $et, undef, undef, 'Work Path');
145
+ },
146
+ },
136
147
  # generate tags for each of the 998 possible Photoshop paths
137
148
  map { $_ => {
138
149
  Name => sprintf('Path%x', $_),
@@ -143,6 +154,7 @@ sub PrintPath($$;$$)
143
154
  },
144
155
  'Image::ExifTool::Composite' => {
145
156
  PathCount => {
157
+ # (PathCount statistics do not include WorkingPath)
146
158
  Desire => {
147
159
  map { $_-0x7d0 => sprintf('Path%x', $_) } (0x7d0 .. 0xbb5),
148
160
  },
@@ -180,6 +192,17 @@ sub PrintPath($$;$$)
180
192
  Require => 'PathCount',
181
193
  ValueConv => '$$self{TotalPathPoints}',
182
194
  },
195
+ WorkingPathPix => {
196
+ Require => {
197
+ 0 => 'ImageWidth',
198
+ 1 => 'ImageHeight',
199
+ 2 => 'WorkingPath',
200
+ },
201
+ ValueConv => sub {
202
+ my ($val, $et) = @_;
203
+ PrintPath($$val[2], $et, $$val[0], $$val[1], 'Work Path');
204
+ },
205
+ },
183
206
  map { sprintf('PathPix%x', $_) => {
184
207
  Require => {
185
208
  0 => 'ImageWidth',
@@ -63,7 +63,7 @@
63
63
  # 2015/05/12 - PH Minor code tweaks
64
64
  # 2015/10/26 - BKW Round off area sizes to 7 decimal places
65
65
  # 2016/01/18 - BKW Improved rounding algorithm
66
- # 2016/05/14 - BKW Increased rounding to 9 decimal places (Max Picasa accepts),
66
+ # 2016/05/14 - BKW Increased rounding to 9 decimal places (Max Picasa accepts),
67
67
  # moved rounding operation to subroutine
68
68
  #
69
69
  # References: https://exiftool.org/forum/index.php/topic,6354.0.html
@@ -16,13 +16,13 @@
16
16
 
17
17
  %Image::ExifTool::UserDefined = (
18
18
  'Image::ExifTool::XMP::Main' => {
19
- Camera => {
19
+ Camera => {
20
20
  SubDirectory => {
21
21
  TagTable => 'Image::ExifTool::UserDefined::Camera',
22
22
  },
23
23
  },
24
24
  },
25
- );
25
+ );
26
26
 
27
27
  %Image::ExifTool::UserDefined::Camera = (
28
28
  GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Camera' },
@@ -68,9 +68,9 @@ sub has_defined {
68
68
  35 => 'EXIF:TransferRange', # TransferRange (342/0x0156)
69
69
  36 => 'EXIF:YCbCrCoefficients', # YCbCrCoefficients (529/0x0211)
70
70
  37 => 'EXIF:YCbCrPositioning', # YCbCrPositioning (531/0x0213)
71
- 38 => 'EXIF:YCbCrSubSampling', # YCbCrSubSampling (530/0x0212)
71
+ 38 => 'EXIF:YCbCrSubSampling', # YCbCrSubSampling (530/0x0212)
72
72
  # Other tags to check
73
- 39 => 'EXIF:PhotometricInterpretation', # PhotometricInterpretation (262/0x0106)
73
+ 39 => 'EXIF:PhotometricInterpretation', # PhotometricInterpretation (262/0x0106)
74
74
  40 => 'EXIF:Compression', # Compression (259/0x0103)
75
75
  },
76
76
  ValueConv => q{
package/bin/exiftool CHANGED
@@ -8,9 +8,10 @@
8
8
  # (See html/history.html for revision history)
9
9
  #------------------------------------------------------------------------------
10
10
  use strict;
11
+ use warnings;
11
12
  require 5.004;
12
13
 
13
- my $version = '12.39';
14
+ my $version = '12.42';
14
15
 
15
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
16
17
  BEGIN {
@@ -109,6 +110,8 @@ my %database; # lookup for database information based on file name (in Exi
109
110
  my %filterExt; # lookup for filtered extensions
110
111
  my %ignore; # directory names to ignore
111
112
  my $ignoreHidden; # flag to ignore hidden files
113
+ my %outComma; # flag that output text file needs a comma
114
+ my %outTrailer; # trailer for output text file
112
115
  my %preserveTime; # preserved timestamps for files
113
116
  my %printFmt; # the contents of the print format file
114
117
  my %setTags; # hash of list references for tags to set from files
@@ -441,6 +444,8 @@ undef %database;
441
444
  undef %endDir;
442
445
  undef %filterExt;
443
446
  undef %ignore;
447
+ undef %outComma;
448
+ undef %outTrailer;
444
449
  undef %printFmt;
445
450
  undef %preserveTime;
446
451
  undef %setTags;
@@ -1821,8 +1826,21 @@ if ($filtered and not $validFile) {
1821
1826
  PrintCSV() if $csv and not $isWriting;
1822
1827
 
1823
1828
  # print folder/file trailer if necessary
1824
- print $sectTrailer if $sectTrailer and not $textOut;
1825
- print $fileTrailer if $fileTrailer and not $textOut and not $fileHeader;
1829
+ if ($textOut) {
1830
+ foreach (keys %outTrailer) {
1831
+ next unless $outTrailer{$_};
1832
+ if ($mt->Open(\*OUTTRAIL, $_, '>>')) {
1833
+ my $fp = \*OUTTRAIL;
1834
+ print $fp $outTrailer{$_};
1835
+ close $fp;
1836
+ } else {
1837
+ Error("Error appending to $_\n");
1838
+ }
1839
+ }
1840
+ } else {
1841
+ print $sectTrailer if $sectTrailer;
1842
+ print $fileTrailer if $fileTrailer and not $fileHeader;
1843
+ }
1826
1844
 
1827
1845
  my $totWr = $countGoodWr + $countBadWr + $countSameWr + $countCopyWr +
1828
1846
  $countGoodCr + $countBadCr;
@@ -2160,6 +2178,9 @@ sub GetImageInfo($$)
2160
2178
  $tmpText = $outfile unless $append;
2161
2179
  }
2162
2180
 
2181
+ # restore state of comma flag for this file if appending
2182
+ $comma = $outComma{$outfile} if $append and ($textOverwrite & 0x02);
2183
+
2163
2184
  # print the results for this file
2164
2185
  if (%printFmt) {
2165
2186
  # output using print format file (-p) option
@@ -2221,7 +2242,7 @@ sub GetImageInfo($$)
2221
2242
  if ($fp) {
2222
2243
  # print file header (only once)
2223
2244
  if ($fileHeader) {
2224
- print $fp $fileHeader;
2245
+ print $fp $fileHeader unless defined $outfile and ($created{$outfile} or $appended{$outfile});
2225
2246
  undef $fileHeader unless $textOut;
2226
2247
  }
2227
2248
  if ($html) {
@@ -2533,8 +2554,9 @@ TAG: foreach $tag (@foundTags) {
2533
2554
  if ($showTagID or $outFormat < 0) {
2534
2555
  $val = { val => $val };
2535
2556
  if ($showTagID) {
2536
- my $id = $et->GetTagID($tag);
2557
+ my ($id, $lang) = $et->GetTagID($tag);
2537
2558
  $id = sprintf('0x%.4x', $id) if $showTagID eq 'H' and $id =~ /^\d+$/;
2559
+ $$val{lang} = $lang if $lang;
2538
2560
  $$val{id} = $id;
2539
2561
  }
2540
2562
  if ($tabFormat) {
@@ -2674,9 +2696,17 @@ TAG: foreach $tag (@foundTags) {
2674
2696
  }
2675
2697
  }
2676
2698
  if ($outfile) {
2677
- # write section and file trailers before closing the file
2678
- print $fp $sectTrailer and $sectTrailer = '' if $sectTrailer;
2679
- print $fp $fileTrailer if $fileTrailer;
2699
+ if ($textOverwrite & 0x02) {
2700
+ # save state of this file if we may be appending
2701
+ $outComma{$outfile} = $comma;
2702
+ $outTrailer{$outfile} = '';
2703
+ $outTrailer{$outfile} .= $sectTrailer and $sectTrailer = '' if $sectTrailer;
2704
+ $outTrailer{$outfile} .= $fileTrailer if $fileTrailer;
2705
+ } else {
2706
+ # write section and file trailers before closing the file
2707
+ print $fp $sectTrailer and $sectTrailer = '' if $sectTrailer;
2708
+ print $fp $fileTrailer if $fileTrailer;
2709
+ }
2680
2710
  close($fp);
2681
2711
  undef $tmpText;
2682
2712
  if ($lineCount) {
@@ -2926,7 +2956,7 @@ sub SetImageInfo($$$)
2926
2956
  }
2927
2957
  }
2928
2958
  if (defined $outfile) {
2929
- $verbose and print $vout "'${infile}' --> '${outfile}'\n";
2959
+ defined $verbose and print $vout "'${infile}' --> '${outfile}'\n";
2930
2960
  # create output directory if necessary
2931
2961
  CreateDirectory($outfile);
2932
2962
  # set temporary file (automatically erased on abnormal exit)
@@ -5136,13 +5166,14 @@ The following examples demonstrate basic use of the B<-csv> option:
5136
5166
  # update metadata for all images in a directory from CSV file
5137
5167
  exiftool -csv=a.csv dir
5138
5168
 
5139
- Empty values are ignored when importing (unless the B<-f> option is used and
5140
- the API MissingTagValue is set to an empty string, in which case the tag is
5169
+ When importing, empty values are ignored unless the B<-f> option is used and
5170
+ the API MissingTagValue is set to an empty string (in which case the tag is
5141
5171
  deleted). Also, FileName and Directory columns are ignored if they exist
5142
- (ie. ExifTool will not attempt to write these tags with a CSV import). To
5143
- force a tag to be deleted, use the B<-f> option and set the value to "-" in
5144
- the CSV file (or to the MissingTagValue if this API option was used).
5145
- Multiple databases may be imported in a single command.
5172
+ (ie. ExifTool will not attempt to write these tags with a CSV import), but
5173
+ all other columns are imported. To force a tag to be deleted, use the B<-f>
5174
+ option and set the value to "-" in the CSV file (or to the MissingTagValue
5175
+ if this API option was used). Multiple databases may be imported in a
5176
+ single command.
5146
5177
 
5147
5178
  When exporting a CSV file, the B<-g> or B<-G> option adds group names to the
5148
5179
  tag headings. If the B<-a> option is used to allow duplicate tag names, the
@@ -5436,7 +5467,7 @@ with this command:
5436
5467
 
5437
5468
  produces output like this:
5438
5469
 
5439
- -- Generated by ExifTool 12.39 --
5470
+ -- Generated by ExifTool 12.42 --
5440
5471
  File: a.jpg - 2003:10:31 15:44:19
5441
5472
  (f/5.6, 1/60s, ISO 100)
5442
5473
  File: b.jpg - 2006:05:23 11:57:38
@@ -5555,7 +5586,9 @@ level greater than 0, most other options are ignored and normal console
5555
5586
  output is suppressed unless specific tags are extracted. Using B<-v0>
5556
5587
  causes the console output buffer to be flushed after each line (which may be
5557
5588
  useful to avoid delays when piping exiftool output), and prints the name of
5558
- each processed file when writing. Also see the B<-progress> option.
5589
+ each processed file when writing and the new file name when renaming,
5590
+ moving or copying. Verbose levels above B<-v0> do not flush after each
5591
+ line. Also see the B<-progress> option.
5559
5592
 
5560
5593
  =item B<-w>[+|!] I<EXT> or I<FMT> (B<-textOut>)
5561
5594
 
@@ -5768,11 +5801,10 @@ an XMP extension for the output file.
5768
5801
  =item B<-a>, B<--a> (B<-duplicates>, B<--duplicates>)
5769
5802
 
5770
5803
  Allow (B<-a>) or suppress (B<--a>) duplicate tag names to be extracted. By
5771
- default, duplicate tags are suppressed when reading unless the B<-ee> or
5772
- B<-X> options are used or the Duplicates option is enabled in the
5773
- configuration file. This option has an affect when writing only to allow
5774
- duplicate Warning messages to be shown. Duplicate tags are always extracted
5775
- when copying.
5804
+ default, duplicate tags are suppressed when reading unless the B<-ee> or B<-X>
5805
+ options are used or the Duplicates option is enabled in the configuration file.
5806
+ When writing, this option allows multiple Warning messages to be shown.
5807
+ Duplicate tags are always extracted when copying.
5776
5808
 
5777
5809
  =item B<-e> (B<--composite>)
5778
5810