exiftool-vendored.pl 12.78.0 → 12.82.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 (58) hide show
  1. package/bin/Changes +80 -3
  2. package/bin/MANIFEST +29 -2
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +3 -2
  6. package/bin/config_files/acdsee.config +37 -57
  7. package/bin/config_files/example.config +6 -0
  8. package/bin/exiftool +67 -25
  9. package/bin/lib/Image/ExifTool/BuildTagLookup.pm +44 -31
  10. package/bin/lib/Image/ExifTool/CanonVRD.pm +2 -2
  11. package/bin/lib/Image/ExifTool/FujiFilm.pm +21 -5
  12. package/bin/lib/Image/ExifTool/GM.pm +543 -0
  13. package/bin/lib/Image/ExifTool/GeoLang/cs.pm +978 -0
  14. package/bin/lib/Image/ExifTool/GeoLang/de.pm +1975 -0
  15. package/bin/lib/Image/ExifTool/GeoLang/en_ca.pm +44 -0
  16. package/bin/lib/Image/ExifTool/GeoLang/en_gb.pm +124 -0
  17. package/bin/lib/Image/ExifTool/GeoLang/es.pm +2921 -0
  18. package/bin/lib/Image/ExifTool/GeoLang/fi.pm +1116 -0
  19. package/bin/lib/Image/ExifTool/GeoLang/fr.pm +3171 -0
  20. package/bin/lib/Image/ExifTool/GeoLang/it.pm +2750 -0
  21. package/bin/lib/Image/ExifTool/GeoLang/ja.pm +10256 -0
  22. package/bin/lib/Image/ExifTool/GeoLang/ko.pm +4499 -0
  23. package/bin/lib/Image/ExifTool/GeoLang/nl.pm +1270 -0
  24. package/bin/lib/Image/ExifTool/GeoLang/pl.pm +3019 -0
  25. package/bin/lib/Image/ExifTool/GeoLang/ru.pm +18220 -0
  26. package/bin/lib/Image/ExifTool/GeoLang/sk.pm +441 -0
  27. package/bin/lib/Image/ExifTool/GeoLang/sv.pm +714 -0
  28. package/bin/lib/Image/ExifTool/GeoLang/tr.pm +452 -0
  29. package/bin/lib/Image/ExifTool/GeoLang/zh_cn.pm +2225 -0
  30. package/bin/lib/Image/ExifTool/GeoLang/zh_tw.pm +72 -0
  31. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  32. package/bin/lib/Image/ExifTool/Geolocation.pm +867 -146
  33. package/bin/lib/Image/ExifTool/Geotag.pm +13 -1
  34. package/bin/lib/Image/ExifTool/JSON.pm +7 -2
  35. package/bin/lib/Image/ExifTool/M2TS.pm +32 -4
  36. package/bin/lib/Image/ExifTool/MakerNotes.pm +2 -2
  37. package/bin/lib/Image/ExifTool/Microsoft.pm +1 -1
  38. package/bin/lib/Image/ExifTool/Nikon.pm +331 -22
  39. package/bin/lib/Image/ExifTool/NikonCustom.pm +55 -1
  40. package/bin/lib/Image/ExifTool/Olympus.pm +1 -0
  41. package/bin/lib/Image/ExifTool/OpenEXR.pm +37 -19
  42. package/bin/lib/Image/ExifTool/PNG.pm +3 -3
  43. package/bin/lib/Image/ExifTool/QuickTime.pm +40 -24
  44. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +61 -30
  45. package/bin/lib/Image/ExifTool/README +8 -5
  46. package/bin/lib/Image/ExifTool/Sony.pm +1 -1
  47. package/bin/lib/Image/ExifTool/TagLookup.pm +4820 -4750
  48. package/bin/lib/Image/ExifTool/TagNames.pod +1000 -615
  49. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +31 -8
  50. package/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  51. package/bin/lib/Image/ExifTool/Writer.pl +58 -2
  52. package/bin/lib/Image/ExifTool/XMP.pm +20 -3
  53. package/bin/lib/Image/ExifTool/XMP2.pl +64 -0
  54. package/bin/lib/Image/ExifTool.pm +210 -97
  55. package/bin/lib/Image/ExifTool.pod +44 -18
  56. package/bin/perl-Image-ExifTool.spec +1 -1
  57. package/bin/pp_build_exe.args +4 -4
  58. package/package.json +3 -3
package/bin/Changes CHANGED
@@ -7,6 +7,85 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 12.76. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Apr. 5, 2024 - Version 12.82 - "GM PDR"
11
+
12
+ - Added support for reading GM PDR data from MP4 videos written by cars such
13
+ as Corvettes and Cameros
14
+ - Added support for reading timed GPS from Wolfbox dashcam videos
15
+ - Added "Unknown trailer" to QuickTime warnings originating from an unknown
16
+ trailer
17
+ - Added a new Nikon LensID
18
+ - Extract PreviewImage from Chigee AIO-5 dashcam videos
19
+ - Changed name and print conversion of a recently added FujiFilm tag
20
+ - Only issue "Tag not defined" warnings for the first sub-document when using
21
+ the -p option
22
+ - Fixed a Nikon Z lens name (github #250)
23
+ - Fixed Windows version so -sort works properly with -listgeo
24
+ - API Changes:
25
+ - Added PrintCSV option for optimized extraction of GM PDR data in CSV
26
+ format
27
+
28
+ Mar. 27, 2024 - Version 12.81
29
+
30
+ - Added ability to read EXIF and XMP from EXR images
31
+ - Added ability to delete unknown trailer when writing MOV/MP4 videos
32
+ - Added ability to write a couple of Stable Diffusion PNG tags
33
+ - Added ability to write one of the Microsoft Xtra Description tags (github
34
+ #248)
35
+ - Added support for using alternate city names in reverse Geolocation
36
+ - Added support for reading timed GPS from DOD LS600W TS videos
37
+ - Added support for new version of Canon DR4 files
38
+ - Added a number of new iTunesInfo tags
39
+ - Added a new Olympus LensType
40
+ - Decode a number of new Nikon tags (thanks Warren Hatch)
41
+ - Allow regular expressions to be used when writing Geolocate tag
42
+ - Enhanced writing of Geolocate tag to also write Keys:LocationName
43
+ - Cache the results of the last reverse geolocation search to speed batch
44
+ processing when multiple files have the same search parameters
45
+ - Patched problem that could cause runtime errors with some invaid tag names
46
+ - Fixed a couple of newly added FujiFilm tags
47
+ - Fixed decoding of FujiFilm AFAreaZoneSize
48
+ - API Changes:
49
+ - Added GeolocAltNames option
50
+
51
+ Mar. 19, 2024 - Version 12.80
52
+
53
+ - Added GeolocationFeatureCode tag
54
+ - Added XMP-acdsee-rs tags and a new XMP-xmpDM tag
55
+ - Added ACDSeeRegion2MWGRegion conversion to config_files/acdsee.config
56
+ - Added GPSAltitudeRef to XMP-iptcExt LocationDetails structure
57
+ - Added a couple of new FujiFilm tags and a new CropMode value
58
+ - Added conversion for XMP-aux:ApproximateFocusDistance "infinity"
59
+ - Improved Geolocation regular expressions to allow negative matches
60
+ - Improved accuracy of Geolocation distance/bearing calculations
61
+ - Changed structure of Geolocation database (now version 1.02)
62
+ - Minor change to key format for user-defined Geolocation name translations
63
+ - Ignore API Geolocation option when copying tags if none of the Geolocation
64
+ tags are being copied
65
+ - Fixed case/spacing of "C2PA" in some CBOR tag descriptions
66
+ - Fixed bug extracting binary data from EXR files
67
+ - API Changes:
68
+ - Added GeolocFeature option
69
+
70
+ Mar. 15, 2024 - Version 12.79
71
+
72
+ - Improvements to new Geolocation feature:
73
+ - Added reverse Geolocation ability (obtain GPS coordinates from city
74
+ name), with support for regular expressions
75
+ - Added ability to geolocate while geotagging
76
+ - Added -listgeo option to list the Geolocation database
77
+ - Added the ability to include user-defined cities in the Geolocation
78
+ database
79
+ - Added the ability to write XMP-iptcExt LocationShown tags using Geolocate
80
+ feature
81
+ - Added the ability to specify which tags to read from file for the API
82
+ Geolocation option
83
+ - Added language translations for Geolocation names
84
+ - Increased resolution of Geolocation GPS positions and stored populations
85
+ - API Changes:
86
+ - Save necessary data members to allow GetInfo to be accessed by
87
+ user-defined tags
88
+
10
89
  Mar. 5, 2024 - Version 12.78 - "Geolocation"
11
90
 
12
91
  - Added new Geolocation feature and write-only Geolocate tag
@@ -32,9 +111,7 @@ Mar. 5, 2024 - Version 12.78 - "Geolocation"
32
111
  - Fixed issue where some tags from alternate files using the -fileNUM option
33
112
  weren't generated as requested
34
113
  - API Changes:
35
- - Added Geolocation,
36
- GeolocMaxDist and
37
- GeolocMinPop API options
114
+ - Added Geolocation, GeolocMaxDist and GeolocMinPop API options
38
115
 
39
116
  Feb. 16, 2024 - Version 12.77
40
117
 
package/bin/MANIFEST CHANGED
@@ -80,6 +80,7 @@ html/TagNames/FujiFilm.html
80
80
  html/TagNames/GE.html
81
81
  html/TagNames/GIF.html
82
82
  html/TagNames/GIMP.html
83
+ html/TagNames/GM.html
83
84
  html/TagNames/GPS.html
84
85
  html/TagNames/GeoTiff.html
85
86
  html/TagNames/GoPro.html
@@ -195,6 +196,7 @@ html/data_members.html
195
196
  html/exiftool_pod.html
196
197
  html/faq.html
197
198
  html/filename.html
199
+ html/geolocation.html
198
200
  html/geotag.html
199
201
  html/history.html
200
202
  html/htmldump.html
@@ -292,7 +294,26 @@ lib/Image/ExifTool/FujiFilm.pm
292
294
  lib/Image/ExifTool/GE.pm
293
295
  lib/Image/ExifTool/GIF.pm
294
296
  lib/Image/ExifTool/GIMP.pm
297
+ lib/Image/ExifTool/GM.pm
295
298
  lib/Image/ExifTool/GPS.pm
299
+ lib/Image/ExifTool/GeoLang/cs.pm
300
+ lib/Image/ExifTool/GeoLang/de.pm
301
+ lib/Image/ExifTool/GeoLang/en_ca.pm
302
+ lib/Image/ExifTool/GeoLang/en_gb.pm
303
+ lib/Image/ExifTool/GeoLang/es.pm
304
+ lib/Image/ExifTool/GeoLang/fi.pm
305
+ lib/Image/ExifTool/GeoLang/fr.pm
306
+ lib/Image/ExifTool/GeoLang/it.pm
307
+ lib/Image/ExifTool/GeoLang/ja.pm
308
+ lib/Image/ExifTool/GeoLang/ko.pm
309
+ lib/Image/ExifTool/GeoLang/nl.pm
310
+ lib/Image/ExifTool/GeoLang/pl.pm
311
+ lib/Image/ExifTool/GeoLang/ru.pm
312
+ lib/Image/ExifTool/GeoLang/sk.pm
313
+ lib/Image/ExifTool/GeoLang/sv.pm
314
+ lib/Image/ExifTool/GeoLang/tr.pm
315
+ lib/Image/ExifTool/GeoLang/zh_cn.pm
316
+ lib/Image/ExifTool/GeoLang/zh_tw.pm
296
317
  lib/Image/ExifTool/GeoTiff.pm
297
318
  lib/Image/ExifTool/Geolocation.dat
298
319
  lib/Image/ExifTool/Geolocation.pm
@@ -545,7 +566,6 @@ t/ExifTool_32.out
545
566
  t/ExifTool_33.out
546
567
  t/ExifTool_34.out
547
568
  t/ExifTool_35.out
548
- t/ExifTool_36.out
549
569
  t/ExifTool_4.out
550
570
  t/ExifTool_5.out
551
571
  t/ExifTool_6.out
@@ -602,6 +622,14 @@ t/GeoTiff.t
602
622
  t/GeoTiff_2.out
603
623
  t/GeoTiff_3.out
604
624
  t/GeoTiff_4.out
625
+ t/Geolocation.t
626
+ t/Geolocation_2.out
627
+ t/Geolocation_3.out
628
+ t/Geolocation_4.out
629
+ t/Geolocation_5.out
630
+ t/Geolocation_6.out
631
+ t/Geolocation_7.out
632
+ t/Geolocation_8.out
605
633
  t/Geotag.t
606
634
  t/Geotag_10.out
607
635
  t/Geotag_11.out
@@ -923,7 +951,6 @@ t/Writer_58.out
923
951
  t/Writer_59.out
924
952
  t/Writer_6.out
925
953
  t/Writer_60.out
926
- t/Writer_61.out
927
954
  t/Writer_7.out
928
955
  t/Writer_9.out
929
956
  t/XISF.t
package/bin/META.json CHANGED
@@ -50,5 +50,5 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "12.78"
53
+ "version" : "12.82"
54
54
  }
package/bin/META.yml CHANGED
@@ -31,4 +31,4 @@ recommends:
31
31
  Time::HiRes: 0
32
32
  requires:
33
33
  perl: 5.004
34
- version: 12.78
34
+ version: 12.82
package/bin/README CHANGED
@@ -109,8 +109,8 @@ your home directory, then you would type the following commands in a
109
109
  terminal window to extract and run ExifTool:
110
110
 
111
111
  cd ~/Desktop
112
- gzip -dc Image-ExifTool-12.78.tar.gz | tar -xf -
113
- cd Image-ExifTool-12.78
112
+ gzip -dc Image-ExifTool-12.82.tar.gz | tar -xf -
113
+ cd Image-ExifTool-12.82
114
114
  ./exiftool t/images/ExifTool.jpg
115
115
 
116
116
  Note: These commands extract meta information from one of the test images.
@@ -238,6 +238,7 @@ information:
238
238
  html/ExifTool.html - API documentation
239
239
  html/TagNames/index.html - Tag name documentation
240
240
  html/geotag.html - Geotag feature
241
+ html/geolocation.html - Geolocation feature
241
242
  html/faq.html - Frequently asked questions
242
243
  html/filename.html - Renaming/moving files
243
244
  html/metafiles.html - Working with metadata sidecar files
@@ -41,7 +41,8 @@
41
41
  # type tags to ACDSee regions.
42
42
  # MPRegion2ACDSeeRegion : Converts a Microsoft RegionInfoMP
43
43
  # IPTCRegion2ACDSeeRegion : Converts an IPTC ImageRegion
44
- # MWGRegion2ACDSeeRegion : Converts a MWG RegionInfo
44
+ # MWGRegion2ACDSeeRegion : Converts from a MWG RegionInfo
45
+ # ACDSeeRegion2MWGRegion : Converts to a MWG RegionInfo
45
46
  #
46
47
  # Usage: To set individual tags
47
48
  # exiftool -config acdsee.config -ACDSEETAG=VALUE FILE ...
@@ -52,6 +53,8 @@
52
53
  # exiftool -config acdsee.config "-RegionInfoACDSee<IPTCRegion2ACDSeeRegion" File ...
53
54
  # To convert MWG Regions to ACDSee regions
54
55
  # exiftool -config acdsee.config "-RegionInfoACDSee<MWGRegion2ACDSeeRegion" File ...
56
+ # To convert ACDSee Regions to MWG regions
57
+ # exiftool -config acdsee.config "-RegionInfo<ACDSeeRegion2MWGRegion" File ...
55
58
  #
56
59
  # Requires: ExifTool version 10.28 or later
57
60
  #
@@ -64,45 +67,12 @@
64
67
  # "RegionInfoACDSeeAppliedToDimensions*" -> "ACDSeeRegionAppliedToDimensions*"
65
68
  # "RegionInfoACDSeeRegionList* -> "ACDSeeRegion*"
66
69
  # 2022/10/03 - PH Set group name properly to XMP-acdsee-rs
70
+ # 2024/03/19 - PH Moved XMP-acdsee-rs tags into the standard distribution,
71
+ # and added ACDSeeRegion2MWGRegion conversion
67
72
  #------------------------------------------------------------------------------
68
73
  use Data::Dumper;
69
74
 
70
- my %sACDSeeDimensions = (
71
- STRUCT_NAME => 'ACDSee Dimensions',
72
- NAMESPACE => {'acdsee-stDim' => 'http://ns.acdsee.com/sType/Dimensions#'},
73
- 'w' => { Writable => 'real' },
74
- 'h' => { Writable => 'real' },
75
- 'unit' => { },
76
- );
77
-
78
- my %sACDSeeArea = (
79
- STRUCT_NAME => 'ACDSee Area',
80
- NAMESPACE => { 'acdsee-stArea' => 'http://ns.acdsee.com/sType/Area#' },
81
- 'x' => { Writable => 'real' },
82
- 'y' => { Writable => 'real' },
83
- w => { Writable => 'real' },
84
- h => { Writable => 'real' },
85
- );
86
-
87
- my %sACDSeeRegionStruct = (
88
- STRUCT_NAME => 'ACDSee Regions',
89
- NAMESPACE => { 'acdsee-rs' => 'http://ns.acdsee.com/regions/' },
90
- ALGArea => { Struct => \%sACDSeeArea },
91
- DLYArea => { Struct => \%sACDSeeArea },
92
- Name => { },
93
- NameAssignType => { },
94
- Type => { },
95
- );
96
-
97
75
  %Image::ExifTool::UserDefined = (
98
- # new XMP namespaces for ACDSee regions
99
- 'Image::ExifTool::XMP::Main' => {
100
- 'acdsee-rs' => { # <-- must be the same as the NAMESPACE prefix
101
- SubDirectory => {
102
- TagTable => 'Image::ExifTool::UserDefined::ACDSeeRegions'
103
- },
104
- },
105
- },
106
76
  'Image::ExifTool::Composite' => {
107
77
  # create an ACDSee RegionInfo structure from a Microsoft RegionInfoMP structure
108
78
  MPRegion2ACDSeeRegion => {
@@ -176,7 +146,7 @@ my %sACDSeeRegionStruct = (
176
146
  },
177
147
  },
178
148
 
179
- # create an MWG RegionInfo structure from an IPTC ImageRegion list
149
+ # create an ACDSee RegionInfo structure from an MWG RegionInfo structure
180
150
  MWGRegion2ACDSeeRegion => {
181
151
  Require => {
182
152
  0 => 'RegionInfo',
@@ -207,29 +177,39 @@ my %sACDSeeRegionStruct = (
207
177
  }
208
178
  },
209
179
  },
210
- ####
211
- },
212
- );
213
180
 
214
- %Image::ExifTool::UserDefined::ACDSeeRegions = (
215
- GROUPS => { 0 => 'XMP', 1 => 'XMP-acdsee-rs', 2 => 'Image' },
216
- NAMESPACE => { 'acdsee-rs' => 'http://ns.acdsee.com/regions/' },
217
- WRITABLE => 'string', # (default to string-type tags)
218
- Regions => {
219
- Name => 'RegionInfoACDSee',
220
- FlatName => 'ACDSee',
221
- # the "Struct" entry defines the structure fields
222
- Struct => {
223
- # optional structure name (used for warning messages only)
224
- STRUCT_NAME => 'ACDSee RegionInfo',
225
- RegionList => {
226
- FlatName => 'Region',
227
- Struct => \%sACDSeeRegionStruct,
228
- List => 'Bag',
181
+ # create an MWG RegionInfo structure from an ACDSee RegionInfo
182
+ ACDSeeRegion2MWGRegion => {
183
+ Require => {
184
+ 0 => 'RegionInfoACDSee',
185
+ 1 => 'ImageWidth',
186
+ 2 => 'ImageHeight',
187
+ },
188
+ ValueConv => q{
189
+ my ($rgn, @newRgns);
190
+ my %newRgn;
191
+ foreach $rgn (@{$val[0]{RegionList}}) {
192
+ next unless $$rgn{Area} or defined $$rgn{Name};
193
+ my %newRgn;
194
+ if ($$rgn{DLYArea}) {
195
+ $newRgn{Area} = {
196
+ 'X' => $$rgn{DLYArea}{'X'},
197
+ 'Y' => $$rgn{DLYArea}{'Y'},
198
+ 'W' => $$rgn{DLYArea}{'W'},
199
+ 'H' => $$rgn{DLYArea}{'H'},
200
+ };
201
+ };
202
+ $newRgn{Name} = $$rgn{Name} if defined $$rgn{Name};
203
+ $newRgn{'Type'} = $$rgn{'Type'} if defined $$rgn{'Type'};
204
+ push @newRgns, \%newRgn;
205
+ }
206
+ return {
207
+ 'AppliedToDimensions' => $val[0]{'AppliedToDimensions'},
208
+ RegionList => \@newRgns,
209
+ }
229
210
  },
230
- AppliedToDimensions => {
231
- FlatName => 'RegionAppliedToDimensions',Struct => \%sACDSeeDimensions },
232
211
  },
212
+ ####
233
213
  },
234
214
  );
235
215
 
@@ -362,5 +362,11 @@ $Image::ExifTool::QuickTime::Keys{PREFERRED} = 3;
362
362
  '-i', 'HIDDEN', # ignore hidden files by default (names beginning with ".")
363
363
  );
364
364
 
365
+ # Add user-defined cities to the Geolocation lookup
366
+ @Image::ExifTool::UserDefined::Geolocation = (
367
+ # (city,region,country code,country,timezone,population,lat,lon)
368
+ ['Sinemorets','Burgas','BG','Bulgaria','Europe/Sofia',400,42.06115,27.97833],
369
+ );
370
+
365
371
  #------------------------------------------------------------------------------
366
372
  1; #end
package/bin/exiftool CHANGED
@@ -11,7 +11,7 @@ use strict;
11
11
  use warnings;
12
12
  require 5.004;
13
13
 
14
- my $version = '12.78';
14
+ my $version = '12.82';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  my $exePath;
@@ -217,7 +217,7 @@ my $tmpFile; # temporary file to delete on exit
217
217
  my $tmpText; # temporary text file
218
218
  my $validFile; # flag indicating we processed a valid file
219
219
  my $verbose; # verbose setting
220
- my $vout; # verbose output file reference (\*STDOUT or \*STDERR)
220
+ my $vout; # verbose output file reference (\*STDOUT or \*STDERR by default)
221
221
  my $windowTitle; # title for console window
222
222
  my %wroteHEAD; # list of output txt files to which we wrote HEAD
223
223
  my $xml; # flag for XML-formatted output
@@ -670,7 +670,7 @@ for (;;) {
670
670
  next;
671
671
  }
672
672
  my $a = lc $_;
673
- if (/^list([wfrdx]|wf|g(\d*))?$/i) {
673
+ if (/^list([wfrdx]|wf|g(\d*)|geo)?$/i) {
674
674
  $pass or push @nextPass, "-$_";
675
675
  my $type = lc($1 || '');
676
676
  if (not $type or $type eq 'w' or $type eq 'x') {
@@ -719,6 +719,29 @@ for (;;) {
719
719
  PrintTagList('Recognized file extensions', GetFileType(undef, 0));
720
720
  } elsif ($type eq 'd') {
721
721
  PrintTagList('Deletable groups', GetDeleteGroups());
722
+ } elsif ($type eq 'geo') {
723
+ require Image::ExifTool::Geolocation;
724
+ my ($i, $entry);
725
+ print "Geolocation database:\n" unless $quiet;
726
+ my $isAlt = $mt->Options('GeolocAltNames') ? ',AltNames' : '';
727
+ $isAlt = '' if $isAlt and not Image::ExifTool::Geolocation::ReadAltNames();
728
+ print "City,Region,Subregion,CountryCode,Country,TimeZone,FeatureCode,Population,Latitude,Longitude$isAlt\n";
729
+ Image::ExifTool::Geolocation::SortDatabase('City') if $sortOpt;
730
+ my $minPop = $mt->Options('GeolocMinPop');
731
+ my $feature = $mt->Options('GeolocFeature') || '';
732
+ my $neg = $feature =~ s/^-//;
733
+ my %fcodes = map { lc($_) => 1 } split /\s*,\s*/, $feature;
734
+ my @isUTF8 = (0,1,2,4); # items that need converting from UTF8
735
+ push @isUTF8, 10 if $isAlt;
736
+ for ($i=0; ; ++$i) {
737
+ my @entry = Image::ExifTool::Geolocation::GetEntry($i,$langOpt,1) or last;
738
+ next if $minPop and $entry[7] < $minPop;
739
+ next if %fcodes and $neg ? $fcodes{lc $entry[6]} : not $fcodes{lc $entry[6]};
740
+ push @entry, Image::ExifTool::Geolocation::GetAltNames($i,1) if $isAlt;
741
+ $_ = defined $_ ? $mt->Decode($_, 'UTF8') : '' foreach @entry[@isUTF8];
742
+ pop @entry if $isAlt and not $entry[10];
743
+ print join(',', @entry), "\n";
744
+ }
722
745
  } else { # 'g(\d*)'
723
746
  # list all groups in specified family
724
747
  my $family = $2 || 0;
@@ -1109,7 +1132,7 @@ for (;;) {
1109
1132
  } else {
1110
1133
  $pass or push(@nextPass, '-lang'), next;
1111
1134
  }
1112
- my $langs = "Available languages:\n";
1135
+ my $langs = $quiet ? '' : "Available languages:\n";
1113
1136
  $langs .= " $_ - $Image::ExifTool::langName{$_}\n" foreach @Image::ExifTool::langs;
1114
1137
  $langs =~ tr/_/-/; # display dashes instead of underlines in language codes
1115
1138
  $langs = Image::ExifTool::HTML::EscapeHTML($langs) if $escapeHTML;
@@ -1348,11 +1371,11 @@ for (;;) {
1348
1371
  $useMWG = 1;
1349
1372
  } elsif (/^([-\w]+:)*(filename|directory|testname)\b/i) {
1350
1373
  $doSetFileName = 1;
1351
- } elsif (/^([-\w]+:)*(geotag|geotime|geosync)\b/i) {
1374
+ } elsif (/^([-\w]+:)*(geotag|geotime|geosync|geolocate)\b/i) {
1352
1375
  if (lc $2 eq 'geotime') {
1353
1376
  $addGeotime = '';
1354
1377
  } else {
1355
- # add geotag/geosync commands first
1378
+ # add geotag/geosync/geolocate commands first
1356
1379
  unshift @newValues, pop @newValues;
1357
1380
  if (lc $2 eq 'geotag' and (not defined $addGeotime or $addGeotime) and length $val) {
1358
1381
  $addGeotime = ($1 || '') . 'Geotime<DateTimeOriginal#';
@@ -1425,11 +1448,11 @@ if ($useMWG and not defined $mt->Options('CharsetEXIF')) {
1425
1448
  if (not @files and not $outOpt and not @newValues) {
1426
1449
  my $loc = $mt->Options('Geolocation');
1427
1450
  # use undocumented feature to input JSON file directly from command line
1428
- $loc and $loc =~ /,/ and push(@files, qq(\@JSON:{})), $geoOnly = 1;
1451
+ $loc and $loc ne '1' and push(@files, qq(\@JSON:{})), $geoOnly = 1;
1429
1452
  }
1430
1453
 
1431
1454
  # print help
1432
- unless ((@tags and not $outOpt) or @files or @newValues) {
1455
+ unless ((@tags and not $outOpt) or @files or @newValues or $geoOnly) {
1433
1456
  if ($doGlob and $doGlob == 2) {
1434
1457
  Warn "No matching files\n";
1435
1458
  $rtnVal = 1;
@@ -2131,7 +2154,7 @@ sub GetImageInfo($$)
2131
2154
  # read JSON file from command line
2132
2155
  my $dat = $2;
2133
2156
  $info = $et->ImageInfo(\$dat, \@foundTags);
2134
- if ($geoOnly) { /^Geolocation/ or delete $$info{$_} foreach keys %$info }
2157
+ if ($geoOnly) { /^Geolocation/ or delete $$info{$_} foreach keys %$info; $file = ' ' }
2135
2158
  }
2136
2159
  if (defined $deleteOrig) {
2137
2160
  Progress($vout, "======== $file") if defined $verbose;
@@ -2158,7 +2181,7 @@ sub GetImageInfo($$)
2158
2181
 
2159
2182
  my $lineCount = 0;
2160
2183
  my ($fp, $outfile, $append);
2161
- if ($textOut and $verbose and not $tagOut) {
2184
+ if ($textOut and ($verbose or $et->Options('PrintCSV')) and not $tagOut) {
2162
2185
  ($fp, $outfile, $append) = OpenOutputFile($orig);
2163
2186
  $fp or EFile($file), ++$countBad, return;
2164
2187
  # delete file if we exit prematurely (unless appending)
@@ -2281,7 +2304,7 @@ sub GetImageInfo($$)
2281
2304
  $lastDoc = 0;
2282
2305
  }
2283
2306
  for ($doc=0; $doc<=$lastDoc; ++$doc) {
2284
- my $skipBody;
2307
+ my ($skipBody, $opt);
2285
2308
  foreach $type (qw(HEAD SECT IF BODY ENDS TAIL)) {
2286
2309
  my $prf = $printFmt{$type} or next;
2287
2310
  if ($type eq 'HEAD' and defined $outfile) {
@@ -2289,6 +2312,12 @@ sub GetImageInfo($$)
2289
2312
  $wroteHEAD{$outfile} = 1;
2290
2313
  }
2291
2314
  next if $type eq 'BODY' and $skipBody;
2315
+ # silence "IF" warnings and warnings for subdocuments > 1
2316
+ if ($type eq 'IF' or ($doc > 1 and not $$et{OPTIONS}{IgnoreMinorErrors})) {
2317
+ $opt = 'Silent';
2318
+ } else {
2319
+ $opt = 'Warn';
2320
+ }
2292
2321
  if ($lastDoc) {
2293
2322
  if ($doc) {
2294
2323
  next if $type eq 'HEAD' or $type eq 'TAIL'; # only repeat SECT/IF/BODY/ENDS
@@ -2298,7 +2327,6 @@ sub GetImageInfo($$)
2298
2327
  }
2299
2328
  }
2300
2329
  my @lines;
2301
- my $opt = $type eq 'IF' ? 'Silent' : 'Warn'; # silence "IF" warnings
2302
2330
  foreach (@$prf) {
2303
2331
  my $line = $et->InsertTagValues($_, \@foundTags, $opt, $grp, $cache);
2304
2332
  if ($type eq 'IF') {
@@ -4648,7 +4676,7 @@ B<exiftool> [I<OPTIONS>] B<-tagsFromFile> I<SRCFILE>
4648
4676
  =head2 Other
4649
4677
 
4650
4678
  B<exiftool> [ B<-ver> |
4651
- B<-list>[B<w>|B<f>|B<r>|B<wf>|B<g>[I<NUM>]|B<d>|B<x>] ]
4679
+ B<-list>[B<w>|B<f>|B<r>|B<wf>|B<g>[I<NUM>]|B<d>|B<x>|B<geo>] ]
4652
4680
 
4653
4681
  For specific examples, see the L<EXAMPLES|/READING EXAMPLES> sections below.
4654
4682
 
@@ -5640,7 +5668,7 @@ with this command:
5640
5668
 
5641
5669
  produces output like this:
5642
5670
 
5643
- -- Generated by ExifTool 12.78 --
5671
+ -- Generated by ExifTool 12.82 --
5644
5672
  File: a.jpg - 2003:10:31 15:44:19
5645
5673
  (f/5.6, 1/60s, ISO 100)
5646
5674
  File: b.jpg - 2006:05:23 11:57:38
@@ -6402,22 +6430,25 @@ prevent the command window from closing when run as a Windows drag and drop
6402
6430
  application.
6403
6431
 
6404
6432
  =item B<-list>, B<-listw>, B<-listf>, B<-listr>, B<-listwf>,
6405
- B<-listg>[I<NUM>], B<-listd>, B<-listx>
6433
+ B<-listg>[I<NUM>], B<-listd>, B<-listx>, B<-listgeo>
6406
6434
 
6407
6435
  Print a list of all valid tag names (B<-list>), all writable tag names
6408
6436
  (B<-listw>), all supported file extensions (B<-listf>), all recognized file
6409
6437
  extensions (B<-listr>), all writable file extensions (B<-listwf>), all tag
6410
6438
  groups [in a specified family] (B<-listg>[I<NUM>]), all deletable tag groups
6411
- (B<-listd>), or an XML database of tag details including language
6412
- translations (B<-listx>). The B<-list>, B<-listw> and B<-listx> options may
6413
- be followed by an additional argument of the form C<-GROUP:All> to list only
6414
- tags in a specific group, where C<GROUP> is one or more family 0-2 group
6415
- names (excepting EXIF IFD groups) separated by colons. With B<-listg>,
6416
- I<NUM> may be given to specify the group family, otherwise family 0 is
6417
- assumed. The B<-l> option may be combined with B<-listf>, B<-listr> or
6418
- B<-listwf> to add file descriptions to the list. The B<-lang> option may be
6419
- combined with B<-listx> to output descriptions in a single language. Here
6420
- are some examples:
6439
+ (B<-listd>), an XML database of tag details including language translations
6440
+ (B<-listx>), or the Geolocation database (B<-listgeo>). The B<-list>,
6441
+ B<-listw> and B<-listx> options may be followed by an additional argument of
6442
+ the form C<-GROUP:All> to list only tags in a specific group, where C<GROUP>
6443
+ is one or more family 0-2 group names (excepting EXIF IFD groups) separated
6444
+ by colons. With B<-listg>, I<NUM> may be given to specify the group family,
6445
+ otherwise family 0 is assumed. The B<-l> option may be combined with
6446
+ B<-listf>, B<-listr> or B<-listwf> to add file descriptions to the list.
6447
+ The B<-lang> option may be combined with B<-listx> to output descriptions in
6448
+ a single language, and the B<-sort> and/or B<-lang> options may be combined
6449
+ with B<-listgeo>. Also, the API GeolocMinPop, GeolocFeature and
6450
+ GeolocAltNames options apply to the B<-listgeo> output. Here are some
6451
+ examples:
6421
6452
 
6422
6453
  -list # list all tag names
6423
6454
  -list -EXIF:All # list all EXIF tags
@@ -6430,6 +6461,7 @@ are some examples:
6430
6461
  -listd # list all deletable groups
6431
6462
  -listx -EXIF:All # list database of EXIF tags in XML format
6432
6463
  -listx -XMP:All -s # list short XML database of XMP tags
6464
+ -listgeo -lang de # list geolocation database in German
6433
6465
 
6434
6466
  When combined with B<-listx>, the B<-s> option shortens the output by
6435
6467
  omitting the descriptions and values (as in the last example above), and
@@ -6518,6 +6550,10 @@ examples. Also see "geotag.html" in the full ExifTool distribution and the
6518
6550
  L<Image::ExifTool Options|Image::ExifTool/Options> for more details and for
6519
6551
  information about geotag configuration options.
6520
6552
 
6553
+ The API Geolocation option may be set to the value "geotag" to also write
6554
+ the name, province/state and country of the nearest city while geotagging.
6555
+ See L<https://exiftool.org/geolocation.html> for details.
6556
+
6521
6557
  =item B<-globalTimeShift> I<SHIFT>
6522
6558
 
6523
6559
  Shift all formatted date/time values by the specified amount when reading.
@@ -7415,6 +7451,12 @@ Geotag an image (C<a.jpg>) from position information in a GPS track log
7415
7451
  DateTimeOriginal is used for geotagging. Local system time is assumed
7416
7452
  unless DateTimeOriginal contains a timezone.
7417
7453
 
7454
+ =item exiftool -geotag track.log -geolocate=geotag a.jpg
7455
+
7456
+ Geotag an image and also write geolocation information of the nearest city
7457
+ (city name, state/province and country). Read here for more details about
7458
+ the Geolocation feature: L<https://exiftool.org/geolocation.html#Write>
7459
+
7418
7460
  =item exiftool -geotag t.log -geotime='2009:04:02 13:41:12-05:00' a.jpg
7419
7461
 
7420
7462
  Geotag an image with the GPS position for a specific time.