exiftool-vendored.exe 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 (55) hide show
  1. package/bin/exiftool_files/Changes +79 -4
  2. package/bin/exiftool_files/README +3 -3
  3. package/bin/exiftool_files/config_files/acdsee.config +37 -57
  4. package/bin/exiftool_files/config_files/example.config +16 -2
  5. package/bin/exiftool_files/exiftool.pl +87 -29
  6. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +12 -9
  7. package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +7 -1
  8. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +52 -4
  9. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +3 -0
  10. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +5 -3
  11. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/cs.pm +978 -0
  12. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/de.pm +1975 -0
  13. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_ca.pm +44 -0
  14. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/en_gb.pm +124 -0
  15. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/es.pm +2921 -0
  16. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fi.pm +1116 -0
  17. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/fr.pm +3171 -0
  18. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/it.pm +2750 -0
  19. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ja.pm +10256 -0
  20. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ko.pm +4499 -0
  21. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/nl.pm +1270 -0
  22. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/pl.pm +3019 -0
  23. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/ru.pm +18220 -0
  24. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sk.pm +441 -0
  25. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/sv.pm +714 -0
  26. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/tr.pm +452 -0
  27. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_cn.pm +2225 -0
  28. package/bin/exiftool_files/lib/Image/ExifTool/GeoLang/zh_tw.pm +72 -0
  29. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.dat +0 -0
  30. package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +775 -0
  31. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +8 -1
  32. package/bin/exiftool_files/lib/Image/ExifTool/HtmlDump.pm +2 -1
  33. package/bin/exiftool_files/lib/Image/ExifTool/Import.pm +5 -2
  34. package/bin/exiftool_files/lib/Image/ExifTool/JSON.pm +15 -10
  35. package/bin/exiftool_files/lib/Image/ExifTool/MWG.pm +1 -0
  36. package/bin/exiftool_files/lib/Image/ExifTool/MacOS.pm +19 -4
  37. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +2 -2
  38. package/bin/exiftool_files/lib/Image/ExifTool/Ogg.pm +3 -2
  39. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +3 -1
  40. package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +17 -17
  41. package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +5 -5
  42. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +1 -1
  43. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +183 -11
  44. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +253 -237
  45. package/bin/exiftool_files/lib/Image/ExifTool/README +6 -5
  46. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +2624 -2520
  47. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +184 -4
  48. package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +15 -1
  49. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +1 -1
  50. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +59 -8
  51. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +17 -2
  52. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +64 -0
  53. package/bin/exiftool_files/lib/Image/ExifTool.pm +249 -47
  54. package/bin/exiftool_files/lib/Image/ExifTool.pod +57 -25
  55. package/package.json +3 -3
@@ -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
 
@@ -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
@@ -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;
@@ -158,6 +158,7 @@ my $filtered; # flag indicating file was filtered by name
158
158
  my $filterFlag; # file filter flag (0x01=deny extensions, 0x02=allow extensions, 0x04=add ext)
159
159
  my $fixLen; # flag to fix description lengths when writing alternate languages
160
160
  my $forcePrint; # string to use for missing tag values (undef to not print them)
161
+ my $geoOnly; # flag to extract Geolocation tags only
161
162
  my $helped; # flag to avoid printing help if no tags specified
162
163
  my $html; # flag for html-formatted output (2=html dump)
163
164
  my $interrupted; # flag set if CTRL-C is pressed during a critical process
@@ -503,6 +504,7 @@ undef $fileHeader;
503
504
  undef $filtered;
504
505
  undef $fixLen;
505
506
  undef $forcePrint;
507
+ undef $geoOnly;
506
508
  undef $ignoreHidden;
507
509
  undef $joinLists;
508
510
  undef $langOpt;
@@ -600,6 +602,11 @@ if (not $preserveTime and $^O eq 'MSWin32') {
600
602
  $preserveTime = 2 if eval { require Win32::API } and eval { require Win32API::File };
601
603
  }
602
604
 
605
+ # add user-defined command-line arguments
606
+ if (@Image::ExifTool::UserDefined::Arguments) {
607
+ unshift @ARGV, @Image::ExifTool::UserDefined::Arguments;
608
+ }
609
+
603
610
  # parse command-line options in 2 passes...
604
611
  # pass 1: set all of our ExifTool options
605
612
  # pass 2: print all of our help and informational output (-list, -ver, etc)
@@ -676,7 +683,7 @@ for (;;) {
676
683
  next;
677
684
  }
678
685
  my $a = lc $_;
679
- if (/^list([wfrdx]|wf|g(\d*))?$/i) {
686
+ if (/^list([wfrdx]|wf|g(\d*)|geo)?$/i) {
680
687
  $pass or push @nextPass, "-$_";
681
688
  my $type = lc($1 || '');
682
689
  if (not $type or $type eq 'w' or $type eq 'x') {
@@ -725,6 +732,23 @@ for (;;) {
725
732
  PrintTagList('Recognized file extensions', GetFileType(undef, 0));
726
733
  } elsif ($type eq 'd') {
727
734
  PrintTagList('Deletable groups', GetDeleteGroups());
735
+ } elsif ($type eq 'geo') {
736
+ require Image::ExifTool::Geolocation;
737
+ my ($i, $entry);
738
+ print "Geolocation database:\n" unless $quiet;
739
+ print "City,Region,Subregion,CountryCode,Country,TimeZone,FeatureCode,Population,Latitude,Longitude\n";
740
+ Image::ExifTool::Geolocation::SortDatabase('City') if $sortOpt;
741
+ my $minPop = $mt->Options('GeolocMinPop');
742
+ my $feature = $mt->Options('GeolocFeature') || '';
743
+ my $neg = $feature =~ s/^-//;
744
+ my %fcodes = map { lc($_) => 1 } split /\s*,\s*/, $feature;
745
+ for ($i=0; ; ++$i) {
746
+ my @entry = Image::ExifTool::Geolocation::GetEntry($i,$langOpt) or last;
747
+ next if $minPop and $entry[7] < $minPop;
748
+ next if %fcodes and $neg ? $fcodes{lc $entry[6]} : not $fcodes{lc $entry[6]};
749
+ $_ = defined $_ ? $mt->Decode($_, 'UTF8') : '' foreach @entry[0,1,2,4];
750
+ print join(',', @entry), "\n";
751
+ }
728
752
  } else { # 'g(\d*)'
729
753
  # list all groups in specified family
730
754
  my $family = $2 || 0;
@@ -1115,7 +1139,7 @@ for (;;) {
1115
1139
  } else {
1116
1140
  $pass or push(@nextPass, '-lang'), next;
1117
1141
  }
1118
- my $langs = "Available languages:\n";
1142
+ my $langs = $quiet ? '' : "Available languages:\n";
1119
1143
  $langs .= " $_ - $Image::ExifTool::langName{$_}\n" foreach @Image::ExifTool::langs;
1120
1144
  $langs =~ tr/_/-/; # display dashes instead of underlines in language codes
1121
1145
  $langs = Image::ExifTool::HTML::EscapeHTML($langs) if $escapeHTML;
@@ -1427,8 +1451,15 @@ if ($useMWG and not defined $mt->Options('CharsetEXIF')) {
1427
1451
  $mt->Options(CharsetEXIF => 'UTF8');
1428
1452
  }
1429
1453
 
1454
+ # allow geolocation without input file if set to a position
1455
+ if (not @files and not $outOpt and not @newValues) {
1456
+ my $loc = $mt->Options('Geolocation');
1457
+ # use undocumented feature to input JSON file directly from command line
1458
+ $loc and $loc ne '1' and push(@files, qq(\@JSON:{})), $geoOnly = 1;
1459
+ }
1460
+
1430
1461
  # print help
1431
- unless ((@tags and not $outOpt) or @files or @newValues) {
1462
+ unless ((@tags and not $outOpt) or @files or @newValues or $geoOnly) {
1432
1463
  if ($doGlob and $doGlob == 2) {
1433
1464
  Warn "No matching files\n";
1434
1465
  $rtnVal = 1;
@@ -2110,6 +2141,11 @@ sub GetImageInfo($$)
2110
2141
  # can't make use of $info if verbose because we must reprocess
2111
2142
  # the file anyway to generate the verbose output
2112
2143
  undef $info if $verbose or defined $fastCondition;
2144
+ } elsif ($file =~ s/^(\@JSON:)(.*)/$1/) {
2145
+ # read JSON file from command line
2146
+ my $dat = $2;
2147
+ $info = $et->ImageInfo(\$dat, \@foundTags);
2148
+ if ($geoOnly) { /^Geolocation/ or delete $$info{$_} foreach keys %$info; $file = ' ' }
2113
2149
  }
2114
2150
  if (defined $deleteOrig) {
2115
2151
  Progress($vout, "======== $file") if defined $verbose;
@@ -2166,7 +2202,7 @@ sub GetImageInfo($$)
2166
2202
  }
2167
2203
 
2168
2204
  # extract information from this file
2169
- unless ($file eq '-' or $et->Exists($file)) {
2205
+ unless ($file eq '-' or $et->Exists($file) or $info) {
2170
2206
  Warn "Error: File not found - $file\n";
2171
2207
  FileNotFound($file);
2172
2208
  defined $outfile and close($fp), undef($tmpText), $et->Unlink($outfile);
@@ -2351,7 +2387,7 @@ sub GetImageInfo($$)
2351
2387
  # set delimiters for JSON or PHP output
2352
2388
  ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
2353
2389
  print $fp ",\n" if $comma;
2354
- print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file));
2390
+ print $fp qq($bra\n "SourceFile"$sep ), EscapeJSON(MyConvertFileName($et,$file),1);
2355
2391
  $comma = 1;
2356
2392
  $ind = (defined $showGroup and not $allGroup) ? ' ' : ' ';
2357
2393
  } elsif ($csv) {
@@ -3369,7 +3405,22 @@ sub FormatXML($$$)
3369
3405
  my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
3370
3406
  foreach (@keys) {
3371
3407
  # (some variable-namespace XML structure fields may have a different group)
3372
- my $tok = /:/ ? $_ : ($grp . ':' . $_);
3408
+ my ($ns, $tg) = ($grp, $_);
3409
+ if (/^(.*?):(.*)/) {
3410
+ if ($grp eq 'JSON') {
3411
+ $tg =~ tr/:/_/; # colons in JSON structure elements are not namespaces
3412
+ } else {
3413
+ ($ns, $tg) = ($1, $2);
3414
+ }
3415
+ }
3416
+ # validate XML attribute name
3417
+ my $name;
3418
+ foreach $name ($ns, $tg) {
3419
+ # make sure name is valid for XML
3420
+ $name =~ tr/-_A-Za-z0-9.//dc;
3421
+ $name = '_' . $name if $name !~ /^[_A-Za-z]/;
3422
+ }
3423
+ my $tok = $ns . ':' . $tg;
3373
3424
  $val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
3374
3425
  }
3375
3426
  $val = "$val2\n$ind";
@@ -3512,7 +3563,7 @@ sub PrintCSV()
3512
3563
  }
3513
3564
 
3514
3565
  #------------------------------------------------------------------------------
3515
- # Add tag groups from structure fields to a list
3566
+ # Add tag groups from structure fields to a list for xmlns
3516
3567
  # Inputs: 0) tag value, 1) parent group, 2) group hash ref, 3) group list ref
3517
3568
  sub AddGroups($$$$)
3518
3569
  {
@@ -3520,7 +3571,7 @@ sub AddGroups($$$$)
3520
3571
  my ($key, $val2);
3521
3572
  if (ref $val eq 'HASH') {
3522
3573
  foreach $key (sort keys %$val) {
3523
- if ($key =~ /(.*?):/ and not $$groupHash{$1}) {
3574
+ if ($key =~ /^(.*?):/ and not $$groupHash{$1} and $grp ne 'JSON') {
3524
3575
  $$groupHash{$1} = $grp;
3525
3576
  push @$groupList, $1;
3526
3577
  }
@@ -4622,7 +4673,7 @@ SYNOPSIS
4622
4673
  *FILE*...
4623
4674
 
4624
4675
  Other
4625
- exiftool [ -ver | -list[w|f|r|wf|g[*NUM*]|d|x] ]
4676
+ exiftool [ -ver | -list[w|f|r|wf|g[*NUM*]|d|x|geo] ]
4626
4677
 
4627
4678
  For specific examples, see the EXAMPLES sections below.
4628
4679
 
@@ -4663,7 +4714,7 @@ DESCRIPTION
4663
4714
  3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
4664
4715
  7Z r | DV r | JPEG r/w | OFR r | RWZ r
4665
4716
  A r | DVB r/w | JSON r | OGG r | RM r
4666
- AA r | DVR-MS r | JXL r | OGV r | SEQ r
4717
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
4667
4718
  AAC r | DYLIB r | K25 r | ONP r | SKETCH r
4668
4719
  AAE r | EIP r | KDC r | OPUS r | SO r
4669
4720
  AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
@@ -4831,7 +4882,7 @@ OPTIONS
4831
4882
  -common_args Define common arguments
4832
4883
  -config CFGFILE Specify configuration file name
4833
4884
  -echo[NUM] TEXT Echo text to stdout or stderr
4834
- -efile[NUM][!] ERRFILE Save names of files with errors
4885
+ -efile[NUM][!] TXTFILE Save names of files with errors
4835
4886
  -execute[NUM] Execute multiple commands on one line
4836
4887
  -fileNUM ALTFILE Load tags from alternate file
4837
4888
  -list_dir List directories, not their contents
@@ -5229,8 +5280,10 @@ OPTIONS
5229
5280
  different when copying tags using the -tagsFromFile option.
5230
5281
 
5231
5282
  2) If the hemisphere is known, a reference direction (N, S, E or W)
5232
- is appended to each printed coordinate, but adding a "+" to the
5233
- format specifier (eg. "%+.6f") prints a signed coordinate instead.
5283
+ is appended to each printed coordinate, but adding a "+" or "-" to
5284
+ the format specifier (eg. "%+.6f" or "%-.6f") prints a signed
5285
+ coordinate instead. ("+" adds a leading "+" for positive
5286
+ coordinates, but "-" does not.)
5234
5287
 
5235
5288
  3) This print formatting may be disabled with the -n option to
5236
5289
  extract coordinates as signed decimal degrees.
@@ -5627,7 +5680,7 @@ OPTIONS
5627
5680
 
5628
5681
  produces output like this:
5629
5682
 
5630
- -- Generated by ExifTool 12.76 --
5683
+ -- Generated by ExifTool 12.80 --
5631
5684
  File: a.jpg - 2003:10:31 15:44:19
5632
5685
  (f/5.6, 1/60s, ISO 100)
5633
5686
  File: b.jpg - 2006:05:23 11:57:38
@@ -6392,21 +6445,25 @@ OPTIONS
6392
6445
  This option is used to prevent the command window from closing when
6393
6446
  run as a Windows drag and drop application.
6394
6447
 
6395
- -list, -listw, -listf, -listr, -listwf, -listg[*NUM*], -listd, -listx
6448
+ -list, -listw, -listf, -listr, -listwf, -listg[*NUM*], -listd, -listx,
6449
+ -listgeo
6396
6450
  Print a list of all valid tag names (-list), all writable tag names
6397
6451
  (-listw), all supported file extensions (-listf), all recognized
6398
6452
  file extensions (-listr), all writable file extensions (-listwf),
6399
6453
  all tag groups [in a specified family] (-listg[*NUM*]), all
6400
- deletable tag groups (-listd), or an XML database of tag details
6401
- including language translations (-listx). The -list, -listw and
6402
- -listx options may be followed by an additional argument of the
6403
- form "-GROUP:All" to list only tags in a specific group, where
6404
- "GROUP" is one or more family 0-2 group names (excepting EXIF IFD
6405
- groups) separated by colons. With -listg, *NUM* may be given to
6406
- specify the group family, otherwise family 0 is assumed. The -l
6407
- option may be combined with -listf, -listr or -listwf to add file
6408
- descriptions to the list. The -lang option may be combined with
6409
- -listx to output descriptions in a single language. Here are some
6454
+ deletable tag groups (-listd), an XML database of tag details
6455
+ including language translations (-listx), or the Geolocation
6456
+ database (-listgeo). The -list, -listw and -listx options may be
6457
+ followed by an additional argument of the form "-GROUP:All" to list
6458
+ only tags in a specific group, where "GROUP" is one or more family
6459
+ 0-2 group names (excepting EXIF IFD groups) separated by colons.
6460
+ With -listg, *NUM* may be given to specify the group family,
6461
+ otherwise family 0 is assumed. The -l option may be combined with
6462
+ -listf, -listr or -listwf to add file descriptions to the list. The
6463
+ -lang option may be combined with -listx to output descriptions in
6464
+ a single language, and the -sort and/or -lang options may be
6465
+ combined with -listgeo. Also, the API GeolocMinPop and
6466
+ GeolocFeature options apply to the -listgeo output. Here are some
6410
6467
  examples:
6411
6468
 
6412
6469
  -list # list all tag names
@@ -6420,6 +6477,7 @@ OPTIONS
6420
6477
  -listd # list all deletable groups
6421
6478
  -listx -EXIF:All # list database of EXIF tags in XML format
6422
6479
  -listx -XMP:All -s # list short XML database of XMP tags
6480
+ -listgeo -lang de # list geolocation database in German
6423
6481
 
6424
6482
  When combined with -listx, the -s option shortens the output by
6425
6483
  omitting the descriptions and values (as in the last example
@@ -6601,14 +6659,14 @@ OPTIONS
6601
6659
  -echo4, "${status}" may be used in the *TEXT* string to represent
6602
6660
  the numerical exit status of the command (see "EXIT STATUS").
6603
6661
 
6604
- -efile[*NUM*][!] *ERRFILE*
6662
+ -efile[*NUM*][!] *TXTFILE*
6605
6663
  Save the names of files giving errors (*NUM* missing or 1), files
6606
6664
  that were unchanged (*NUM* is 2), files that fail the -if condition
6607
6665
  (*NUM* is 4), files that were updated (*NUM* is 8), files that were
6608
6666
  created (*NUM* is 16), or any combination thereof by summing *NUM*
6609
6667
  (eg. -efile3 is the same has having both -efile and -efile2 options
6610
- with the same *ERRFILE*). By default, file names are appended to
6611
- any existing *ERRFILE*, but *ERRFILE* is overwritten if an
6668
+ with the same *TXTFILE*). By default, file names are appended to
6669
+ any existing *TXTFILE*, but *TXTFILE* is overwritten if an
6612
6670
  exclamation point is added to the option (eg. -efile!). Saves the
6613
6671
  name of the file specified by the -srcfile option if applicable.
6614
6672
 
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.73';
91
+ $VERSION = '4.74';
92
92
 
93
93
  # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
94
94
  # (or is it? Ref 32 shows 5 non-USM L-type lenses)
@@ -203,7 +203,8 @@ $VERSION = '4.73';
203
203
  52 => 'Canon EF-S 18-55mm f/3.5-5.6 IS II', #PH
204
204
  53 => 'Canon EF-S 18-55mm f/3.5-5.6 III', #Jon Charnas
205
205
  54 => 'Canon EF-S 55-250mm f/4-5.6 IS II', #47
206
- 60 => 'Irix 11mm f/4', #50
206
+ 60 => 'Irix 11mm f/4 or 15mm f/2.4', #50
207
+ 60.1 => 'Irix 15mm f/2.4', #forum15655
207
208
  63 => 'Irix 30mm F1.4 Dragonfly', #IB
208
209
  80 => 'Canon TS-E 50mm f/2.8L Macro', #42
209
210
  81 => 'Canon TS-E 90mm f/2.8L Macro', #42
@@ -4731,6 +4732,7 @@ my %ciMaxFocal = (
4731
4732
  NOTES => 'CameraInfo tags for the PowerShot G5 X Mark II.',
4732
4733
  0x0293 => {
4733
4734
  Name => 'ShutterCount',
4735
+ Condition => '$$self{FileType} eq "JPEG"',
4734
4736
  Format => 'int32u',
4735
4737
  Notes => 'includes electronic + mechanical shutter',
4736
4738
  # - advances by 1 for each photo file, regardless of mechanical or electronic shutter
@@ -4738,26 +4740,27 @@ my %ciMaxFocal = (
4738
4740
  # - advances for time lapse video files
4739
4741
  # - creating a new directory or resetting the counter from the menu doesn't affect this shutter count
4740
4742
  },
4743
+ 0x0a95 => {
4744
+ Name => 'ShutterCount',
4745
+ Condition => '$$self{FileType} eq "CR3"',
4746
+ Format => 'int32u',
4747
+ Notes => 'includes electronic + mechanical shutter',
4748
+ },
4741
4749
  0x0b21 => {
4742
4750
  Name => 'DirectoryIndex',
4751
+ Condition => '$$self{FileType} eq "JPEG"',
4743
4752
  Groups => { 2 => 'Image' },
4744
4753
  Format => 'int32u',
4745
4754
  },
4746
4755
  0x0b2d => {
4747
4756
  Name => 'FileIndex',
4757
+ Condition => '$$self{FileType} eq "JPEG"',
4748
4758
  Format => 'int32u',
4749
4759
  Groups => { 2 => 'Image' },
4750
4760
  Format => 'int32u',
4751
4761
  ValueConv => '$val + 1',
4752
4762
  ValueConvInv => '$val - 1',
4753
4763
  },
4754
- #0x0b39 => {
4755
- # Name => 'DirectoryIndex',
4756
- # Groups => { 2 => 'Image' },
4757
- # Format => 'int32u',
4758
- # ValueConv => '$val - 1',
4759
- # ValueConvInv => '$val + 1',
4760
- #},
4761
4764
  );
4762
4765
 
4763
4766
  # Canon camera information for 70D (MakerNotes tag 0x0d) (ref PH)