exiftool-vendored.pl 12.76.0 → 12.80.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 (42) hide show
  1. package/bin/Changes +79 -4
  2. package/bin/MANIFEST +27 -0
  3. package/bin/META.json +1 -1
  4. package/bin/META.yml +1 -1
  5. package/bin/README +3 -3
  6. package/bin/config_files/acdsee.config +37 -57
  7. package/bin/config_files/example.config +16 -2
  8. package/bin/exiftool +84 -29
  9. package/bin/lib/Image/ExifTool/Canon.pm +12 -9
  10. package/bin/lib/Image/ExifTool/CanonVRD.pm +7 -1
  11. package/bin/lib/Image/ExifTool/Exif.pm +52 -4
  12. package/bin/lib/Image/ExifTool/FujiFilm.pm +3 -0
  13. package/bin/lib/Image/ExifTool/GPS.pm +5 -3
  14. package/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  15. package/bin/lib/Image/ExifTool/Geolocation.pm +775 -0
  16. package/bin/lib/Image/ExifTool/Geotag.pm +8 -1
  17. package/bin/lib/Image/ExifTool/HtmlDump.pm +2 -1
  18. package/bin/lib/Image/ExifTool/Import.pm +5 -2
  19. package/bin/lib/Image/ExifTool/JSON.pm +15 -10
  20. package/bin/lib/Image/ExifTool/MWG.pm +1 -0
  21. package/bin/lib/Image/ExifTool/MacOS.pm +19 -4
  22. package/bin/lib/Image/ExifTool/Nikon.pm +2 -2
  23. package/bin/lib/Image/ExifTool/Ogg.pm +3 -2
  24. package/bin/lib/Image/ExifTool/Olympus.pm +3 -1
  25. package/bin/lib/Image/ExifTool/OpenEXR.pm +17 -17
  26. package/bin/lib/Image/ExifTool/PDF.pm +5 -5
  27. package/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  28. package/bin/lib/Image/ExifTool/QuickTime.pm +183 -11
  29. package/bin/lib/Image/ExifTool/QuickTimeStream.pl +253 -237
  30. package/bin/lib/Image/ExifTool/README +6 -5
  31. package/bin/lib/Image/ExifTool/TagLookup.pm +2624 -2520
  32. package/bin/lib/Image/ExifTool/TagNames.pod +184 -4
  33. package/bin/lib/Image/ExifTool/WriteQuickTime.pl +15 -1
  34. package/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  35. package/bin/lib/Image/ExifTool/Writer.pl +59 -8
  36. package/bin/lib/Image/ExifTool/XMP.pm +17 -2
  37. package/bin/lib/Image/ExifTool/XMP2.pl +64 -0
  38. package/bin/lib/Image/ExifTool.pm +249 -47
  39. package/bin/lib/Image/ExifTool.pod +57 -25
  40. package/bin/perl-Image-ExifTool.spec +2 -2
  41. package/bin/pp_build_exe.args +4 -230
  42. package/package.json +2 -2
package/bin/Changes CHANGED
@@ -7,6 +7,80 @@ 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
+ Mar. 19, 2024 - Version 12.80
11
+
12
+ - Added GeolocationFeatureCode tag
13
+ - Added XMP-acdsee-rs tags and a new XMP-xmpDM tag
14
+ - Added ACDSeeRegion2MWGRegion conversion to config_files/acdsee.config
15
+ - Added GPSAltitudeRef to XMP-iptcExt LocationDetails structure
16
+ - Added a couple of new FujiFilm tags and a new CropMode value
17
+ - Added conversion for XMP-aux:ApproximateFocusDistance "infinity"
18
+ - Improved Geolocation regular expressions to allow negative matches
19
+ - Improved accuracy of Geolocation distance/bearing calculations
20
+ - Changed structure of Geolocation database (now version 1.02)
21
+ - Minor change to key format for user-defined Geolocation name translations
22
+ - Fixed case/spacing of "C2PA" in some CBOR tag descriptions
23
+ - Fixed bug extracting binary data from EXR files
24
+ - API Changes:
25
+ - Added GeolocFeature option
26
+
27
+ Mar. 15, 2024 - Version 12.79
28
+
29
+ - Improvements to new Geolocation feature:
30
+ - Added reverse Geolocation ability (obtain GPS coordinates from city
31
+ name), with support for regular expressions
32
+ - Added -listgeo option to list the Geolocation database
33
+ - Added the ability to include user-defined cities in the Geolocation
34
+ database
35
+ - Added the ability to write XMP-iptcExt LocationShown tags using Geolocate
36
+ feature
37
+ - Added the ability to specify which tags to read from file for the API
38
+ Geolocation option
39
+ - Added language translations for Geolocation names
40
+ - Increased resolution of Geolocation GPS positions and stored populations
41
+ - API Changes:
42
+ - Save necessary data members to allow GetInfo to be accessed by
43
+ user-defined tags
44
+
45
+ Mar. 5, 2024 - Version 12.78 - "Geolocation"
46
+
47
+ - Added new Geolocation feature and write-only Geolocate tag
48
+ - Added new config file entry (@Image::ExifTool::UserDefined::Arguments) to
49
+ allow default command-line arguments to be specified
50
+ - Added print conversion for TIFF-EPStandardID
51
+ - Added ability to delete Nextbase information from MP4 videos
52
+ - Decode timed GPS from MP4 videos written by Nextbase software
53
+ - Decode a number of new tags from Nextbase MP4 videos
54
+ - Decode a few new tags from Garmin MP4 videos
55
+ - Extract PreviewJXL images from DNG 1.7 files
56
+ - Generate Validate, ImageDataHash and UserParam tags earlier to allow them to
57
+ be used in UserDefined Composite tags
58
+ - Enhanced the -c option so a minus sign in the format specification prints a
59
+ signed coordinate without a leading "+" for positive numbers
60
+ - Changed formatting of some Accelerometer tags for consistency
61
+ - Changed behaviour of -ee3 option to do a brute-force scan for freeGPS in the
62
+ media data even when referenced by 'gps ' atom
63
+ - Other internal changes to decoding of timed GPS from videos
64
+ - Fixed problem were ExifTool would give up on extracting some types of timed
65
+ GPS from videos after 100 void fixes
66
+ - Fixed bug that could cause runtime error when reading Ogg files
67
+ - Fixed issue where some tags from alternate files using the -fileNUM option
68
+ weren't generated as requested
69
+ - API Changes:
70
+ - Added Geolocation, GeolocMaxDist and GeolocMinPop API options
71
+
72
+ Feb. 16, 2024 - Version 12.77
73
+
74
+ - Added new Olympus CameraType and LensType value (thanks herb)
75
+ - Added a new Canon Irix LensType
76
+ - Added the ability to delete MacOS XAttrMDItemWhereFroms
77
+ - Decode a few new Canon DPP tags (thanks John Moyer)
78
+ - Decode timed GPS from Adzome GS65H MOV videos
79
+ - Improved handling of XML-unfriendly characters in JSON field names (fixes
80
+ issue where -X option could produce invalid XML when reading JSON with the
81
+ -struct option)
82
+ - Fixed decoding of ShutterCount for Canon G5X-ii CR3 files
83
+
10
84
  Jan. 31, 2024 - Version 12.76 (production release)
11
85
 
12
86
  - Properly implement patch of 12.45 to avoid duplicating raw data when writing
@@ -19,6 +93,7 @@ Jan. 30, 2024 - Version 12.75 (production release)
19
93
  - CORRUPTION WARNING: Fixed bug introduced in 12.45 which could result in
20
94
  corrupted Sony ARW images from some newer models when rewriting lossless
21
95
  compressed ARW images which were previously edited by 12.44 or earlier
96
+ (the corruption is repairable, but requires a special version of ExifTool)
22
97
  - Added ability to read C2PA JUMBF metadata from PDF and SVG files
23
98
  - Added ability to extract JUMBF metadata as a block
24
99
  - Added read support for C2PA (JUMBF-format) files
@@ -547,7 +622,7 @@ Oct. 13, 2022 - Version 12.48
547
622
  "Z" are actually in Zulu time -- a bit of a mess really)
548
623
  - Prevent dynamically-generated Unknown tags from being extracted when the
549
624
  -validate option is used without -u
550
- - Patched to better handle irregular timestamps in streaming GPS of NextBase
625
+ - Patched to better handle irregular timestamps in streaming GPS of Nextbase
551
626
  dashcam videos
552
627
  - Fixed incompatibility with Sigma Photo Pro which could result in Sigma Photo
553
628
  Pro corrupting an ExifTool-edited X3F image (the section length in the
@@ -1419,7 +1494,7 @@ Mar. 19, 2020 - Version 11.92
1419
1494
  - Added a new Nikon LensID (thanks Wolfgang Exler)
1420
1495
  - Decode a few new Leica tags (thanks Tim Gray)
1421
1496
  - Decode AccelerometerData from Samsung Gear 360 videos
1422
- - Fixed a couple of problems decoding timed GPS metadata from NextBase dashcam
1497
+ - Fixed a couple of problems decoding timed GPS metadata from Nextbase dashcam
1423
1498
  videos
1424
1499
  - Fixed problem where -X option could produce invalid XML when reading
1425
1500
  corrupted XMP
@@ -2308,7 +2383,7 @@ Oct. 16, 2018 - Version 11.14
2308
2383
 
2309
2384
  Oct. 9, 2018 - Version 11.13
2310
2385
 
2311
- - Decode GPS from NextBase 512G dashcam MOV videos (different than 512GW)
2386
+ - Decode GPS from Nextbase 512G dashcam MOV videos (different than 512GW)
2312
2387
  - Added a new Canon LensType (thanks LibRaw)
2313
2388
  - Minor improvements to verbose dump of streaming GPS metadata
2314
2389
  - Reverted change of version 10.71 which resulted in Windows not recognizing
@@ -2327,7 +2402,7 @@ Oct. 2, 2018 - Version 11.12
2327
2402
  - Added a new Sony/Minolta LensType (thanks LibRaw and Jos Roost)
2328
2403
  - Added a new Nikon LensID
2329
2404
  - Decode a few new Sony SRF2 tags (thanks LibRaw)
2330
- - Decode GPS from NextBase 512GW dashcam MOV videos
2405
+ - Decode GPS from Nextbase 512GW dashcam MOV videos
2331
2406
  - Validate MS-DOC FIB before extracting contained tags
2332
2407
  - Fixed bug extracting GPSSpeed for some dashcam models
2333
2408
 
package/bin/MANIFEST CHANGED
@@ -195,6 +195,7 @@ html/data_members.html
195
195
  html/exiftool_pod.html
196
196
  html/faq.html
197
197
  html/filename.html
198
+ html/geolocation.html
198
199
  html/geotag.html
199
200
  html/history.html
200
201
  html/htmldump.html
@@ -293,7 +294,27 @@ lib/Image/ExifTool/GE.pm
293
294
  lib/Image/ExifTool/GIF.pm
294
295
  lib/Image/ExifTool/GIMP.pm
295
296
  lib/Image/ExifTool/GPS.pm
297
+ lib/Image/ExifTool/GeoLang/cs.pm
298
+ lib/Image/ExifTool/GeoLang/de.pm
299
+ lib/Image/ExifTool/GeoLang/en_ca.pm
300
+ lib/Image/ExifTool/GeoLang/en_gb.pm
301
+ lib/Image/ExifTool/GeoLang/es.pm
302
+ lib/Image/ExifTool/GeoLang/fi.pm
303
+ lib/Image/ExifTool/GeoLang/fr.pm
304
+ lib/Image/ExifTool/GeoLang/it.pm
305
+ lib/Image/ExifTool/GeoLang/ja.pm
306
+ lib/Image/ExifTool/GeoLang/ko.pm
307
+ lib/Image/ExifTool/GeoLang/nl.pm
308
+ lib/Image/ExifTool/GeoLang/pl.pm
309
+ lib/Image/ExifTool/GeoLang/ru.pm
310
+ lib/Image/ExifTool/GeoLang/sk.pm
311
+ lib/Image/ExifTool/GeoLang/sv.pm
312
+ lib/Image/ExifTool/GeoLang/tr.pm
313
+ lib/Image/ExifTool/GeoLang/zh_cn.pm
314
+ lib/Image/ExifTool/GeoLang/zh_tw.pm
296
315
  lib/Image/ExifTool/GeoTiff.pm
316
+ lib/Image/ExifTool/Geolocation.dat
317
+ lib/Image/ExifTool/Geolocation.pm
297
318
  lib/Image/ExifTool/Geotag.pm
298
319
  lib/Image/ExifTool/GoPro.pm
299
320
  lib/Image/ExifTool/H264.pm
@@ -599,6 +620,12 @@ t/GeoTiff.t
599
620
  t/GeoTiff_2.out
600
621
  t/GeoTiff_3.out
601
622
  t/GeoTiff_4.out
623
+ t/Geolocation.t
624
+ t/Geolocation_2.out
625
+ t/Geolocation_3.out
626
+ t/Geolocation_4.out
627
+ t/Geolocation_5.out
628
+ t/Geolocation_6.out
602
629
  t/Geotag.t
603
630
  t/Geotag_10.out
604
631
  t/Geotag_11.out
package/bin/META.json CHANGED
@@ -50,5 +50,5 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "12.76"
53
+ "version" : "12.80"
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.76
34
+ version: 12.80
package/bin/README CHANGED
@@ -20,7 +20,7 @@ supported by ExifTool (r = read, w = write, c = create):
20
20
  3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
21
21
  7Z r | DV r | JPEG r/w | OFR r | RWZ r
22
22
  A r | DVB r/w | JSON r | OGG r | RM r
23
- AA r | DVR-MS r | JXL r | OGV r | SEQ r
23
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
24
24
  AAC r | DYLIB r | K25 r | ONP r | SKETCH r
25
25
  AAE r | EIP r | KDC r | OPUS r | SO r
26
26
  AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
@@ -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.76.tar.gz | tar -xf -
113
- cd Image-ExifTool-12.76
112
+ gzip -dc Image-ExifTool-12.80.tar.gz | tar -xf -
113
+ cd Image-ExifTool-12.80
114
114
  ./exiftool t/images/ExifTool.jpg
115
115
 
116
116
  Note: These commands extract meta information from one of the test images.
@@ -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
 
@@ -6,7 +6,8 @@
6
6
  # Notes: This example file shows how to define your own shortcuts and
7
7
  # add new EXIF, IPTC, XMP, PNG, MIE and Composite tags, as well
8
8
  # as how to specify preferred lenses for the LensID tag, and
9
- # define new file types and default ExifTool option values.
9
+ # define new file types and default ExifTool API options and
10
+ # command-line arguments.
10
11
  #
11
12
  # Note that unknown tags may be extracted even if they aren't
12
13
  # defined, but tags must be defined to be written. Also note
@@ -345,7 +346,7 @@ use Image::ExifTool::MIE;
345
346
  use Image::ExifTool::QuickTime;
346
347
  $Image::ExifTool::QuickTime::Keys{PREFERRED} = 3;
347
348
 
348
- # Specify default ExifTool option values
349
+ # Specify default ExifTool API options
349
350
  # (see the Options function documentation for available options)
350
351
  %Image::ExifTool::UserDefined::Options = (
351
352
  CoordFormat => '%.6f', # change default GPS coordinate format
@@ -354,5 +355,18 @@ $Image::ExifTool::QuickTime::Keys{PREFERRED} = 3;
354
355
  RequestAll => 3, # request additional tags not normally generated
355
356
  );
356
357
 
358
+ # Specify default exiftool command-line arguments
359
+ # - inserted before all other options except -config
360
+ # - applies to all -execute'd commands
361
+ @Image::ExifTool::UserDefined::Arguments = (
362
+ '-i', 'HIDDEN', # ignore hidden files by default (names beginning with ".")
363
+ );
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
+
357
371
  #------------------------------------------------------------------------------
358
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.76';
14
+ my $version = '12.80';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  my $exePath;
@@ -166,6 +166,7 @@ my $filtered; # flag indicating file was filtered by name
166
166
  my $filterFlag; # file filter flag (0x01=deny extensions, 0x02=allow extensions, 0x04=add ext)
167
167
  my $fixLen; # flag to fix description lengths when writing alternate languages
168
168
  my $forcePrint; # string to use for missing tag values (undef to not print them)
169
+ my $geoOnly; # flag to extract Geolocation tags only
169
170
  my $helped; # flag to avoid printing help if no tags specified
170
171
  my $html; # flag for html-formatted output (2=html dump)
171
172
  my $interrupted; # flag set if CTRL-C is pressed during a critical process
@@ -490,6 +491,7 @@ undef $fileHeader;
490
491
  undef $filtered;
491
492
  undef $fixLen;
492
493
  undef $forcePrint;
494
+ undef $geoOnly;
493
495
  undef $ignoreHidden;
494
496
  undef $joinLists;
495
497
  undef $langOpt;
@@ -587,6 +589,11 @@ if (not $preserveTime and $^O eq 'MSWin32') {
587
589
  $preserveTime = 2 if eval { require Win32::API } and eval { require Win32API::File };
588
590
  }
589
591
 
592
+ # add user-defined command-line arguments
593
+ if (@Image::ExifTool::UserDefined::Arguments) {
594
+ unshift @ARGV, @Image::ExifTool::UserDefined::Arguments;
595
+ }
596
+
590
597
  # parse command-line options in 2 passes...
591
598
  # pass 1: set all of our ExifTool options
592
599
  # pass 2: print all of our help and informational output (-list, -ver, etc)
@@ -663,7 +670,7 @@ for (;;) {
663
670
  next;
664
671
  }
665
672
  my $a = lc $_;
666
- if (/^list([wfrdx]|wf|g(\d*))?$/i) {
673
+ if (/^list([wfrdx]|wf|g(\d*)|geo)?$/i) {
667
674
  $pass or push @nextPass, "-$_";
668
675
  my $type = lc($1 || '');
669
676
  if (not $type or $type eq 'w' or $type eq 'x') {
@@ -712,6 +719,23 @@ for (;;) {
712
719
  PrintTagList('Recognized file extensions', GetFileType(undef, 0));
713
720
  } elsif ($type eq 'd') {
714
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
+ print "City,Region,Subregion,CountryCode,Country,TimeZone,FeatureCode,Population,Latitude,Longitude\n";
727
+ Image::ExifTool::Geolocation::SortDatabase('City') if $sortOpt;
728
+ my $minPop = $mt->Options('GeolocMinPop');
729
+ my $feature = $mt->Options('GeolocFeature') || '';
730
+ my $neg = $feature =~ s/^-//;
731
+ my %fcodes = map { lc($_) => 1 } split /\s*,\s*/, $feature;
732
+ for ($i=0; ; ++$i) {
733
+ my @entry = Image::ExifTool::Geolocation::GetEntry($i,$langOpt) or last;
734
+ next if $minPop and $entry[7] < $minPop;
735
+ next if %fcodes and $neg ? $fcodes{lc $entry[6]} : not $fcodes{lc $entry[6]};
736
+ $_ = defined $_ ? $mt->Decode($_, 'UTF8') : '' foreach @entry[0,1,2,4];
737
+ print join(',', @entry), "\n";
738
+ }
715
739
  } else { # 'g(\d*)'
716
740
  # list all groups in specified family
717
741
  my $family = $2 || 0;
@@ -1102,7 +1126,7 @@ for (;;) {
1102
1126
  } else {
1103
1127
  $pass or push(@nextPass, '-lang'), next;
1104
1128
  }
1105
- my $langs = "Available languages:\n";
1129
+ my $langs = $quiet ? '' : "Available languages:\n";
1106
1130
  $langs .= " $_ - $Image::ExifTool::langName{$_}\n" foreach @Image::ExifTool::langs;
1107
1131
  $langs =~ tr/_/-/; # display dashes instead of underlines in language codes
1108
1132
  $langs = Image::ExifTool::HTML::EscapeHTML($langs) if $escapeHTML;
@@ -1414,8 +1438,15 @@ if ($useMWG and not defined $mt->Options('CharsetEXIF')) {
1414
1438
  $mt->Options(CharsetEXIF => 'UTF8');
1415
1439
  }
1416
1440
 
1441
+ # allow geolocation without input file if set to a position
1442
+ if (not @files and not $outOpt and not @newValues) {
1443
+ my $loc = $mt->Options('Geolocation');
1444
+ # use undocumented feature to input JSON file directly from command line
1445
+ $loc and $loc ne '1' and push(@files, qq(\@JSON:{})), $geoOnly = 1;
1446
+ }
1447
+
1417
1448
  # print help
1418
- unless ((@tags and not $outOpt) or @files or @newValues) {
1449
+ unless ((@tags and not $outOpt) or @files or @newValues or $geoOnly) {
1419
1450
  if ($doGlob and $doGlob == 2) {
1420
1451
  Warn "No matching files\n";
1421
1452
  $rtnVal = 1;
@@ -2113,6 +2144,11 @@ sub GetImageInfo($$)
2113
2144
  # can't make use of $info if verbose because we must reprocess
2114
2145
  # the file anyway to generate the verbose output
2115
2146
  undef $info if $verbose or defined $fastCondition;
2147
+ } elsif ($file =~ s/^(\@JSON:)(.*)/$1/) {
2148
+ # read JSON file from command line
2149
+ my $dat = $2;
2150
+ $info = $et->ImageInfo(\$dat, \@foundTags);
2151
+ if ($geoOnly) { /^Geolocation/ or delete $$info{$_} foreach keys %$info; $file = ' ' }
2116
2152
  }
2117
2153
  if (defined $deleteOrig) {
2118
2154
  Progress($vout, "======== $file") if defined $verbose;
@@ -2169,7 +2205,7 @@ sub GetImageInfo($$)
2169
2205
  }
2170
2206
 
2171
2207
  # extract information from this file
2172
- unless ($file eq '-' or $et->Exists($file)) {
2208
+ unless ($file eq '-' or $et->Exists($file) or $info) {
2173
2209
  Warn "Error: File not found - $file\n";
2174
2210
  FileNotFound($file);
2175
2211
  defined $outfile and close($fp), undef($tmpText), $et->Unlink($outfile);
@@ -2354,7 +2390,7 @@ sub GetImageInfo($$)
2354
2390
  # set delimiters for JSON or PHP output
2355
2391
  ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
2356
2392
  print $fp ",\n" if $comma;
2357
- print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file));
2393
+ print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file),1);
2358
2394
  $comma = 1;
2359
2395
  $ind = (defined $showGroup and not $allGroup) ? ' ' : ' ';
2360
2396
  } elsif ($csv) {
@@ -3372,7 +3408,22 @@ sub FormatXML($$$)
3372
3408
  my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3373
3409
  foreach (@keys) {
3374
3410
  # (some variable-namespace XML structure fields may have a different group)
3375
- my $tok = /:/ ? $_ : ($grp . ':' . $_);
3411
+ my ($ns, $tg) = ($grp, $_);
3412
+ if (/^(.*?):(.*)/) {
3413
+ if ($grp eq 'JSON') {
3414
+ $tg =~ tr/:/_/; # colons in JSON structure elements are not namespaces
3415
+ } else {
3416
+ ($ns, $tg) = ($1, $2);
3417
+ }
3418
+ }
3419
+ # validate XML attribute name
3420
+ my $name;
3421
+ foreach $name ($ns, $tg) {
3422
+ # make sure name is valid for XML
3423
+ $name =~ tr/-_A-Za-z0-9.//dc;
3424
+ $name = '_' . $name if $name !~ /^[_A-Za-z]/;
3425
+ }
3426
+ my $tok = $ns . ':' . $tg;
3376
3427
  $val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
3377
3428
  }
3378
3429
  $val = "$val2\n$ind";
@@ -3515,7 +3566,7 @@ sub PrintCSV()
3515
3566
  }
3516
3567
 
3517
3568
  #------------------------------------------------------------------------------
3518
- # Add tag groups from structure fields to a list
3569
+ # Add tag groups from structure fields to a list for xmlns
3519
3570
  # Inputs: 0) tag value, 1) parent group, 2) group hash ref, 3) group list ref
3520
3571
  sub AddGroups($$$$)
3521
3572
  {
@@ -3523,7 +3574,7 @@ sub AddGroups($$$$)
3523
3574
  my ($key, $val2);
3524
3575
  if (ref $val eq 'HASH') {
3525
3576
  foreach $key (sort keys %$val) {
3526
- if ($key =~ /(.*?):/ and not $$groupHash{$1}) {
3577
+ if ($key =~ /^(.*?):/ and not $$groupHash{$1} and $grp ne 'JSON') {
3527
3578
  $$groupHash{$1} = $grp;
3528
3579
  push @$groupList, $1;
3529
3580
  }
@@ -4614,7 +4665,7 @@ B<exiftool> [I<OPTIONS>] B<-tagsFromFile> I<SRCFILE>
4614
4665
  =head2 Other
4615
4666
 
4616
4667
  B<exiftool> [ B<-ver> |
4617
- B<-list>[B<w>|B<f>|B<r>|B<wf>|B<g>[I<NUM>]|B<d>|B<x>] ]
4668
+ B<-list>[B<w>|B<f>|B<r>|B<wf>|B<g>[I<NUM>]|B<d>|B<x>|B<geo>] ]
4618
4669
 
4619
4670
  For specific examples, see the L<EXAMPLES|/READING EXAMPLES> sections below.
4620
4671
 
@@ -4655,7 +4706,7 @@ supported by ExifTool (r = read, w = write, c = create):
4655
4706
  3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
4656
4707
  7Z r | DV r | JPEG r/w | OFR r | RWZ r
4657
4708
  A r | DVB r/w | JSON r | OGG r | RM r
4658
- AA r | DVR-MS r | JXL r | OGV r | SEQ r
4709
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
4659
4710
  AAC r | DYLIB r | K25 r | ONP r | SKETCH r
4660
4711
  AAE r | EIP r | KDC r | OPUS r | SO r
4661
4712
  AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
@@ -4824,7 +4875,7 @@ L<Advanced options|/Advanced options>
4824
4875
  -common_args Define common arguments
4825
4876
  -config CFGFILE Specify configuration file name
4826
4877
  -echo[NUM] TEXT Echo text to stdout or stderr
4827
- -efile[NUM][!] ERRFILE Save names of files with errors
4878
+ -efile[NUM][!] TXTFILE Save names of files with errors
4828
4879
  -execute[NUM] Execute multiple commands on one line
4829
4880
  -fileNUM ALTFILE Load tags from alternate file
4830
4881
  -list_dir List directories, not their contents
@@ -5216,8 +5267,9 @@ Notes:
5216
5267
  when copying tags using the B<-tagsFromFile> option.
5217
5268
 
5218
5269
  2) If the hemisphere is known, a reference direction (N, S, E or W) is
5219
- appended to each printed coordinate, but adding a C<+> to the format
5220
- specifier (eg. C<%+.6f>) prints a signed coordinate instead.
5270
+ appended to each printed coordinate, but adding a C<+> or C<-> to the format
5271
+ specifier (eg. C<%+.6f> or C<%-.6f>) prints a signed coordinate instead.
5272
+ (C<+> adds a leading "+" for positive coordinates, but C<-> does not.)
5221
5273
 
5222
5274
  3) This print formatting may be disabled with the B<-n> option to extract
5223
5275
  coordinates as signed decimal degrees.
@@ -5605,7 +5657,7 @@ with this command:
5605
5657
 
5606
5658
  produces output like this:
5607
5659
 
5608
- -- Generated by ExifTool 12.76 --
5660
+ -- Generated by ExifTool 12.80 --
5609
5661
  File: a.jpg - 2003:10:31 15:44:19
5610
5662
  (f/5.6, 1/60s, ISO 100)
5611
5663
  File: b.jpg - 2006:05:23 11:57:38
@@ -6367,22 +6419,24 @@ prevent the command window from closing when run as a Windows drag and drop
6367
6419
  application.
6368
6420
 
6369
6421
  =item B<-list>, B<-listw>, B<-listf>, B<-listr>, B<-listwf>,
6370
- B<-listg>[I<NUM>], B<-listd>, B<-listx>
6422
+ B<-listg>[I<NUM>], B<-listd>, B<-listx>, B<-listgeo>
6371
6423
 
6372
6424
  Print a list of all valid tag names (B<-list>), all writable tag names
6373
6425
  (B<-listw>), all supported file extensions (B<-listf>), all recognized file
6374
6426
  extensions (B<-listr>), all writable file extensions (B<-listwf>), all tag
6375
6427
  groups [in a specified family] (B<-listg>[I<NUM>]), all deletable tag groups
6376
- (B<-listd>), or an XML database of tag details including language
6377
- translations (B<-listx>). The B<-list>, B<-listw> and B<-listx> options may
6378
- be followed by an additional argument of the form C<-GROUP:All> to list only
6379
- tags in a specific group, where C<GROUP> is one or more family 0-2 group
6380
- names (excepting EXIF IFD groups) separated by colons. With B<-listg>,
6381
- I<NUM> may be given to specify the group family, otherwise family 0 is
6382
- assumed. The B<-l> option may be combined with B<-listf>, B<-listr> or
6383
- B<-listwf> to add file descriptions to the list. The B<-lang> option may be
6384
- combined with B<-listx> to output descriptions in a single language. Here
6385
- are some examples:
6428
+ (B<-listd>), an XML database of tag details including language translations
6429
+ (B<-listx>), or the Geolocation database (B<-listgeo>). The B<-list>,
6430
+ B<-listw> and B<-listx> options may be followed by an additional argument of
6431
+ the form C<-GROUP:All> to list only tags in a specific group, where C<GROUP>
6432
+ is one or more family 0-2 group names (excepting EXIF IFD groups) separated
6433
+ by colons. With B<-listg>, I<NUM> may be given to specify the group family,
6434
+ otherwise family 0 is assumed. The B<-l> option may be combined with
6435
+ B<-listf>, B<-listr> or B<-listwf> to add file descriptions to the list.
6436
+ The B<-lang> option may be combined with B<-listx> to output descriptions in
6437
+ a single language, and the B<-sort> and/or B<-lang> options may be combined
6438
+ with B<-listgeo>. Also, the API GeolocMinPop and GeolocFeature options
6439
+ apply to the B<-listgeo> output. Here are some examples:
6386
6440
 
6387
6441
  -list # list all tag names
6388
6442
  -list -EXIF:All # list all EXIF tags
@@ -6395,6 +6449,7 @@ are some examples:
6395
6449
  -listd # list all deletable groups
6396
6450
  -listx -EXIF:All # list database of EXIF tags in XML format
6397
6451
  -listx -XMP:All -s # list short XML database of XMP tags
6452
+ -listgeo -lang de # list geolocation database in German
6398
6453
 
6399
6454
  When combined with B<-listx>, the B<-s> option shortens the output by
6400
6455
  omitting the descriptions and values (as in the last example above), and
@@ -6596,15 +6651,15 @@ respectively) after processing is complete. For B<-echo3> and B<-echo4>,
6596
6651
  "${status}" may be used in the I<TEXT> string to represent the numerical
6597
6652
  exit status of the command (see L</EXIT STATUS>).
6598
6653
 
6599
- =item B<-efile>[I<NUM>][!] I<ERRFILE>
6654
+ =item B<-efile>[I<NUM>][!] I<TXTFILE>
6600
6655
 
6601
6656
  Save the names of files giving errors (I<NUM> missing or 1), files that were
6602
6657
  unchanged (I<NUM> is 2), files that fail the B<-if> condition (I<NUM> is 4),
6603
6658
  files that were updated (I<NUM> is 8), files that were created (I<NUM> is
6604
6659
  16), or any combination thereof by summing I<NUM> (eg. B<-efile3> is the
6605
6660
  same has having both B<-efile> and B<-efile2> options with the same
6606
- I<ERRFILE>). By default, file names are appended to any existing I<ERRFILE>,
6607
- but I<ERRFILE> is overwritten if an exclamation point is added to the option
6661
+ I<TXTFILE>). By default, file names are appended to any existing I<TXTFILE>,
6662
+ but I<TXTFILE> is overwritten if an exclamation point is added to the option
6608
6663
  (eg. B<-efile!>). Saves the name of the file specified by the B<-srcfile>
6609
6664
  option if applicable.
6610
6665