exiftool_vendored 12.83.0 → 12.85.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ meta information extracted from or written to a file.
12
12
  =head1 TAG TABLES
13
13
 
14
14
  The tables listed below give the names of all tags recognized by ExifTool.
15
- They contain a total of 27849 tags, with 17438 unique tag names.
15
+ They contain a total of 27859 tags, with 17442 unique tag names.
16
16
 
17
17
  B<Tag ID>, B<Index#> or B<Sequence> is given in the first column of each
18
18
  table. A B<Tag ID> is the computer-readable equivalent of a tag name, and
@@ -7746,7 +7746,8 @@ These tags are used in Pentax/Asahi cameras.
7746
7746
  0x0229 SerialNumber string
7747
7747
  0x022a FilterInfo Pentax FilterInfo
7748
7748
  Pentax FilterInfo
7749
- 0x022b LevelInfo Pentax LevelInfo
7749
+ 0x022b LevelInfoK3III Pentax LevelInfoK3III
7750
+ LevelInfo Pentax LevelInfo
7750
7751
  0x022d WBLevels Pentax WBLevels
7751
7752
  0x022e Artist string
7752
7753
  0x022f Copyright string
@@ -7919,7 +7920,8 @@ Auto-exposure information for the K-01.
7919
7920
 
7920
7921
  =head3 Pentax AEInfo3 Tags
7921
7922
 
7922
- Auto-exposure information for the K-3, K-30, K-50 and K-500.
7923
+ Auto-exposure information for the K-1mkII, K-3, K-30, K-50, K-70, K-500 and
7924
+ KP.
7923
7925
 
7924
7926
  Index1 Tag Name Writable
7925
7927
  ------ -------- --------
@@ -8050,7 +8052,9 @@ Flash information tags for the K10D, K20D and K200D.
8050
8052
  Index1 Tag Name Writable
8051
8053
  ------ -------- --------
8052
8054
  0.1 PowerSource int8u & 0x0f
8055
+ Tag01 int8u & 0x0f
8053
8056
  1.1 BodyBatteryState int8u & 0xf0
8057
+ BodyBatteryState? int8u & 0xf0
8054
8058
  1.2 GripBatteryState int8u & 0x0f
8055
8059
  GripBatteryState? int8u & 0x0f
8056
8060
  2 BodyBatteryADNoLoad int8u
@@ -8072,6 +8076,7 @@ Flash information tags for the K10D, K20D and K200D.
8072
8076
  6 AFDefocus int8u
8073
8077
  7 AFIntegrationTime int8u
8074
8078
  11 AFPointsInFocus int8u
8079
+ 506 LiveView int8u
8075
8080
  509 AFHold int8u
8076
8081
 
8077
8082
  =head3 Pentax KelvinWB Tags
@@ -8111,6 +8116,7 @@ White balance Blue/Red gains as a function of color temperature.
8111
8116
  ------ -------- --------
8112
8117
  0 EVSteps int8u
8113
8118
  1 SensitivitySteps int8u
8119
+ 3 LiveView int8u
8114
8120
 
8115
8121
  =head3 Pentax ShotInfo Tags
8116
8122
 
@@ -8224,6 +8230,15 @@ used.
8224
8230
  311 DigitalFilter19 undef[17]
8225
8231
  328 DigitalFilter20 undef[17]
8226
8232
 
8233
+ =head3 Pentax LevelInfoK3III Tags
8234
+
8235
+ Tags decoded from the electronic level information for the K-3 III.
8236
+
8237
+ Index1 Tag Name Writable
8238
+ ------ -------- --------
8239
+ 3 RollAngle int16s
8240
+ 5 PitchAngle int16s
8241
+
8227
8242
  =head3 Pentax LevelInfo Tags
8228
8243
 
8229
8244
  Tags decoded from the electronic level information for the K-5. May not be
@@ -8903,12 +8918,16 @@ Tags extracted from the maker notes of iPhone images.
8903
8918
  0x0019 ImageProcessingFlags? int32s
8904
8919
  0x001a QualityHint? string
8905
8920
  0x001d LuminanceNoiseAmplitude rational64s
8921
+ 0x001f PhotosAppFeatureFlags int32s
8906
8922
  0x0020 ImageCaptureRequestID? string
8907
8923
  0x0021 HDRHeadroom rational64s
8924
+ 0x0023 AFPerformance int32s[2]
8908
8925
  0x0025 SceneFlags? int32s
8909
8926
  0x0026 SignalToNoiseRatioType? int32s
8910
8927
  0x0027 SignalToNoiseRatio rational64s
8911
8928
  0x002b PhotoIdentifier string
8929
+ 0x002d ColorTemperature int32s
8930
+ 0x002e CameraType int32s
8912
8931
  0x002f FocusPosition int32s
8913
8932
  0x0030 HDRGain rational64s
8914
8933
  0x0038 AFMeasuredDepth int32s
@@ -8918,7 +8937,8 @@ Tags extracted from the maker notes of iPhone images.
8918
8937
  0x0040 SemanticStyle no
8919
8938
  0x0041 SemanticStyleRenderingVer no
8920
8939
  0x0042 SemanticStylePreset no
8921
- 0x0045 FrontFacingCamera int32s
8940
+ 0x004e Apple_0x004e? no
8941
+ 0x004f Apple_0x004f? no
8922
8942
 
8923
8943
  =head3 Apple RunTime Tags
8924
8944
 
@@ -9333,6 +9353,7 @@ Unknown only to reduce the volume of the normal output.
9333
9353
  41 ManualFlashOutput int16s
9334
9354
  42 ColorTone int16s
9335
9355
  46 SRAWQuality int16s
9356
+ 51 Clarity int16s
9336
9357
 
9337
9358
  =head3 Canon FocalLength Tags
9338
9359
 
@@ -10455,6 +10476,8 @@ WB tags for the Canon G9.
10455
10476
  11 DigitalGain int16s
10456
10477
  12 WBShiftAB int16s
10457
10478
  13 WBShiftGM int16s
10479
+ 14 UnsharpMaskFineness int16s
10480
+ 15 UnsharpMaskThreshold int16s
10458
10481
 
10459
10482
  =head3 Canon ColorBalance Tags
10460
10483
 
@@ -12287,6 +12310,7 @@ below by a decimal appended to the tag ID (.0, .1 or .2).
12287
12310
  0x10002 Rotation yes
12288
12311
  0x10003 AngleAdj yes
12289
12312
  0x10021 CustomPictureStyle yes
12313
+ 0x10100 Rating yes
12290
12314
  0x10101 CheckMark yes
12291
12315
  0x10200 WorkColorSpace yes
12292
12316
  0x20001 RawBrightnessAdj yes
@@ -29122,7 +29146,7 @@ ID3 version 2.2 tags. (These are the tags written by iTunes 5.0.)
29122
29146
  'TT2' Title no
29123
29147
  'TT3' Subtitle no
29124
29148
  'TXT' Lyricist no
29125
- 'TXX' UserDefinedText no
29149
+ 'TXX' TXX ID3 UserDefined
29126
29150
  'TYE' Year no
29127
29151
  'ULT' Lyrics no
29128
29152
  'WAF' FileURL no
@@ -29131,7 +29155,7 @@ ID3 version 2.2 tags. (These are the tags written by iTunes 5.0.)
29131
29155
  'WCM' CommercialURL no
29132
29156
  'WCP' CopyrightURL no
29133
29157
  'WPB' PublisherURL no
29134
- 'WXX' UserDefinedURL no
29158
+ 'WXX' WXX ID3 UserDefined
29135
29159
 
29136
29160
  =head3 ID3 SynLyrics Tags
29137
29161
 
@@ -29143,6 +29167,15 @@ The following tags are extracted from synchronized lyrics/text frames.
29143
29167
  SynchronizedLyricsText no+
29144
29168
  SynchronizedLyricsType no
29145
29169
 
29170
+ =head3 ID3 UserDefined Tags
29171
+
29172
+ ID3 user-defined text and URL tags will be dynamically added to this table
29173
+ by name when found.
29174
+
29175
+ Tag ID Tag Name Writable
29176
+ ------ -------- --------
29177
+ [no tags known]
29178
+
29146
29179
  =head3 ID3 v2_3 Tags
29147
29180
 
29148
29181
  ID3 version 2.3 tags. Includes some non-standard tags written by other
@@ -29212,7 +29245,7 @@ software.
29212
29245
  'TSOC' ComposerSortOrder no
29213
29246
  'TSRC' ISRC no
29214
29247
  'TSSE' EncoderSettings no
29215
- 'TXXX' UserDefinedText no
29248
+ 'TXXX' TXXX ID3 UserDefined
29216
29249
  'TYER' Year no
29217
29250
  'USER' TermsOfUse no
29218
29251
  'USLT' Lyrics no
@@ -29225,7 +29258,7 @@ software.
29225
29258
  'WORS' InternetRadioStationURL no
29226
29259
  'WPAY' PaymentURL no
29227
29260
  'WPUB' PublisherURL no
29228
- 'WXXX' UserDefinedURL no
29261
+ 'WXXX' WXXX ID3 UserDefined
29229
29262
  'XDOR' OriginalReleaseTime no
29230
29263
  'XOLY' OlympusDSS Olympus DSS
29231
29264
  'XSOA' AlbumSortOrder no
@@ -29336,7 +29369,7 @@ software.
29336
29369
  'TSRC' ISRC no
29337
29370
  'TSSE' EncoderSettings no
29338
29371
  'TSST' SetSubtitle no
29339
- 'TXXX' UserDefinedText no
29372
+ 'TXXX' TXXX ID3 UserDefined
29340
29373
  'USER' TermsOfUse no
29341
29374
  'USLT' Lyrics no
29342
29375
  'WCOM' CommercialURL no
@@ -29348,7 +29381,7 @@ software.
29348
29381
  'WORS' InternetRadioStationURL no
29349
29382
  'WPAY' PaymentURL no
29350
29383
  'WPUB' PublisherURL no
29351
- 'WXXX' UserDefinedURL no
29384
+ 'WXXX' WXXX ID3 UserDefined
29352
29385
  'XDOR' OriginalReleaseTime no
29353
29386
  'XOLY' OlympusDSS Olympus DSS
29354
29387
  'XSOA' AlbumSortOrder no
@@ -30732,6 +30765,7 @@ the config file.
30732
30765
  'RDTC' RicohRDTC Ricoh RDTC
30733
30766
  'RDTG' RicohRDTG Ricoh RDTG
30734
30767
  'RDTL' RicohRDTL Ricoh RDTL
30768
+ 'RICO' RicohInfo EXIF
30735
30769
  'RMKN' RicohRMKN EXIF
30736
30770
  'RTHU' PreviewImage no
30737
30771
  'SDLN' PlayMode string
@@ -40057,6 +40091,7 @@ FileName.
40057
40091
  GeolocationCountryCode ExifTool no
40058
40092
  GeolocationDistance ExifTool no
40059
40093
  GeolocationFeatureCode ExifTool no
40094
+ GeolocationFeatureType ExifTool no
40060
40095
  GeolocationPopulation ExifTool no
40061
40096
  GeolocationPosition ExifTool no
40062
40097
  GeolocationRegion ExifTool no
@@ -876,7 +876,8 @@ sub WriteQuickTime($$$)
876
876
  # --> hold this terminator to the end
877
877
  $term = $hdr;
878
878
  } elsif ($n != 0) {
879
- $et->Error("Unknown $n bytes at end of file", 1);
879
+ # warn unless this is 1-3 pad bytes
880
+ $et->Error("Unknown $n bytes at end of file", 1) if $n > 3 or $hdr ne "\0" x $n;
880
881
  }
881
882
  last;
882
883
  }
@@ -29,7 +29,6 @@ sub ConvInv($$$$$;$$);
29
29
  sub PushValue($$$;$);
30
30
 
31
31
  my $loadedAllTables; # flag indicating we loaded all tables
32
- my $advFmtSelf; # ExifTool object during evaluation of advanced formatting expr
33
32
 
34
33
  # the following is a road map of where we write each directory
35
34
  # in the different types of files.
@@ -1271,16 +1270,16 @@ sub SetNewValuesFromFile($$;@)
1271
1270
  $opts{SrcType} = $opts{Type};
1272
1271
  # override PrintConv option with initial Type if given
1273
1272
  $printConv = ($opts{Type} eq 'PrintConv' ? 1 : 0);
1274
- $srcExifTool->Options(PrintConv => $printConv);
1275
1273
  }
1276
1274
  my $srcType = $printConv ? 'PrintConv' : 'ValueConv';
1277
1275
  my $structOpt = defined $$options{Struct} ? $$options{Struct} : 2;
1278
1276
 
1279
1277
  if (ref $srcFile and UNIVERSAL::isa($srcFile,'Image::ExifTool')) {
1280
1278
  $srcExifTool = $srcFile;
1281
- $info = $srcExifTool->GetInfo();
1279
+ $info = $srcExifTool->GetInfo({ PrintConv => $printConv });
1282
1280
  } else {
1283
1281
  $srcExifTool = Image::ExifTool->new;
1282
+ $srcExifTool->Options(PrintConv => $printConv);
1284
1283
  # set flag to indicate we are being called from inside SetNewValuesFromFile()
1285
1284
  $$srcExifTool{TAGS_FROM_FILE} = 1;
1286
1285
  # synchronize and increment the file sequence number
@@ -3380,7 +3379,7 @@ sub InsertTagValues($$;$$$$)
3380
3379
  if (defined $expr and defined $val) {
3381
3380
  local $SIG{'__WARN__'} = \&SetWarning;
3382
3381
  undef $evalWarning;
3383
- $advFmtSelf = $self;
3382
+ $advFmtSelf = $self; # set variable for access to $self in helper functions
3384
3383
  if ($asList) {
3385
3384
  foreach (@val) {
3386
3385
  #### eval advanced formatting expression ($_, $self, @val, $tag, $advFmtSelf)
@@ -3477,13 +3476,14 @@ sub NoDups
3477
3476
  #------------------------------------------------------------------------------
3478
3477
  # Utility routine to set in $_ image from current object
3479
3478
  # Inputs: 0-N) list of tags to copy
3479
+ # Returns: Return value from WriteInfo
3480
3480
  # Notes: - for use only in advanced formatting expressions
3481
3481
  sub SetTags(@)
3482
3482
  {
3483
3483
  my $self = $advFmtSelf;
3484
3484
  my $et = Image::ExifTool->new;
3485
3485
  $et->SetNewValuesFromFile($self, @_);
3486
- $et->WriteInfo(\$_);
3486
+ return $et->WriteInfo(\$_);
3487
3487
  }
3488
3488
 
3489
3489
  #------------------------------------------------------------------------------
@@ -3794,6 +3794,8 @@ sub ParseXMPElement($$$;$$$$)
3794
3794
  if ($stdNS) {
3795
3795
  $val = $try;
3796
3796
  $et->WarnOnce("Fixed incorrect URI for xmlns:$ns", 1);
3797
+ } elsif ($val =~ m(^http://ns.nikon.com/BASIC_PARAM)) {
3798
+ $et->OverrideFileType('NXD','application/x-nikon-nxd');
3797
3799
  } else {
3798
3800
  # look for same namespace with different version number
3799
3801
  $try = quotemeta $val; # (note: escapes slashes too)
@@ -27,9 +27,9 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
27
27
  %noWriteFile %magicNumber @langs $defaultLang %langName %charsetName
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
- %static_vars);
30
+ %static_vars $advFmtSelf);
31
31
 
32
- $VERSION = '12.83';
32
+ $VERSION = '12.85';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -198,7 +198,7 @@ $defaultLang = 'en'; # default language
198
198
  RAR 7Z BZ2 CZI TAR EXE EXR HDR CHM LNK WMF AVC DEX DPX RAW Font
199
199
  JUMBF RSRC M2TS MacOS PHP PCX DCX DWF DWG DXF WTV Torrent VCard
200
200
  LRI R3D AA PDB PFM2 MRC LIF JXL MOI ISO ALIAS JSON MP3 DICOM PCD
201
- ICO TXT AAC);
201
+ NKA ICO TXT AAC);
202
202
 
203
203
  # file types that we can write (edit)
204
204
  my @writeTypes = qw(JPEG TIFF GIF CRW MRW ORF RAF RAW PNG MIE PSD XMP PPM EPS
@@ -210,7 +210,7 @@ my %writeTypes; # lookup for writable file types (hash filled if required)
210
210
  # (See here for 3FR reason: https://exiftool.org/forum/index.php?msg=17570)
211
211
  %noWriteFile = (
212
212
  TIFF => [ qw(3FR DCR K25 KDC SRF) ],
213
- XMP => [ qw(SVG INX) ],
213
+ XMP => [ qw(SVG INX NXD) ],
214
214
  JP2 => [ qw(J2C JPC) ],
215
215
  MOV => [ qw(INSV) ],
216
216
  );
@@ -426,10 +426,12 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
426
426
  # NDPI => ['TIFF', 'Hamamatsu NanoZoomer Digital Pathology Image'],
427
427
  NEF => ['TIFF', 'Nikon (RAW) Electronic Format'],
428
428
  NEWER => 'COS',
429
+ NKA => ['NKA', 'Nikon NX Studio Settings'],
429
430
  NKSC => ['XMP', 'Nikon Sidecar'],
430
431
  NMBTEMPLATE => ['ZIP','Apple Numbers Template'],
431
432
  NRW => ['TIFF', 'Nikon RAW (2)'],
432
433
  NUMBERS => ['ZIP','Apple Numbers spreadsheet'],
434
+ NXD => ['XMP', 'Nikon NX-D Settings'],
433
435
  O => ['EXE', 'Relocatable Object'],
434
436
  ODB => ['ZIP', 'Open Document Database'],
435
437
  ODC => ['ZIP', 'Open Document Chart'],
@@ -869,6 +871,7 @@ my %moduleName = (
869
871
  MKV => 'Matroska',
870
872
  MP3 => 'ID3',
871
873
  MRW => 'MinoltaRaw',
874
+ NKA => 'Nikon',
872
875
  OGG => 'Ogg',
873
876
  ORF => 'Olympus',
874
877
  PDB => 'Palm',
@@ -972,6 +975,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
972
975
  MRC => '.{64}[\x01\x02\x03]\0\0\0[\x01\x02\x03]\0\0\0[\x01\x02\x03]\0\0\0.{132}MAP[\0 ](\x44\x44|\x44\x41|\x11\x11)\0\0',
973
976
  MRW => '\0MR[MI]',
974
977
  MXF => '\x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02', # (not tested if extension recognized)
978
+ NKA => 'NIKONADJ',
975
979
  OGG => '(OggS|ID3)',
976
980
  ORF => '(II|MM)',
977
981
  # PCD => signature is at byte 2048
@@ -1176,7 +1180,7 @@ my @defaultWriteGroups = qw(
1176
1180
 
1177
1181
  # group hash for ExifTool-generated tags
1178
1182
  my %allGroupsExifTool = ( 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'ExifTool' );
1179
- my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' }, Priority => 0 );
1183
+ my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' } );
1180
1184
 
1181
1185
  # special tag names (not used for tag info)
1182
1186
  %specialTags = map { $_ => 1 } qw(
@@ -1269,6 +1273,7 @@ my %systemTagsNotes = (
1269
1273
  },
1270
1274
  Writable => 1,
1271
1275
  WritePseudo => 1,
1276
+ Priority => 2,
1272
1277
  DelCheck => q{"Can't delete"},
1273
1278
  Protected => 1,
1274
1279
  RawConv => '$self->ConvertFileName($val)',
@@ -1281,6 +1286,7 @@ my %systemTagsNotes = (
1281
1286
  WritePseudo => 1,
1282
1287
  DelCheck => q{"Can't delete"},
1283
1288
  Protected => 1,
1289
+ Priority => 2,
1284
1290
  Notes => q{
1285
1291
  may be written with a full path name to set FileName and Directory in one
1286
1292
  operation. This is such a powerful feature that a TestName tag is provided
@@ -1293,6 +1299,7 @@ my %systemTagsNotes = (
1293
1299
  },
1294
1300
  BaseName => {
1295
1301
  Groups => { 1 => 'System', 2 => 'Other' },
1302
+ Priority => 2,
1296
1303
  Notes => q{
1297
1304
  file name without extension. Not generated unless specifically requested or
1298
1305
  the API L<RequestAll|../ExifTool.html#RequestAll> option is set
@@ -1362,6 +1369,7 @@ my %systemTagsNotes = (
1362
1369
  },
1363
1370
  FileType => {
1364
1371
  Groups => { 2 => 'Other' },
1372
+ Priority => 2,
1365
1373
  Notes => q{
1366
1374
  a short description of the file type. For many file types this is the just
1367
1375
  the uppercase file extension
@@ -1995,14 +2003,14 @@ my %systemTagsNotes = (
1995
2003
  return $val if $val =~ /\bgeotag\b/i;
1996
2004
  $val .= ',both';
1997
2005
  my $opts = $$self{OPTIONS};
1998
- my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'), $opts);
1999
- return '' unless $n;
2000
- if ($n > 1 and $self->Warn('Multiple matching cities found',2)) {
2006
+ my ($cities, $dist) = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'), $opts);
2007
+ return '' unless $cities;
2008
+ if (@$cities > 1 and $self->Warn('Multiple matching cities found',2)) {
2001
2009
  warn "$$self{VALUE}{Warning}\n";
2002
2010
  return '';
2003
2011
  }
2004
- my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
2005
- my @tags = $self->GetGeolocateTags($wantGroup, $km ? 0 : 1);
2012
+ my @geo = Image::ExifTool::Geolocation::GetEntry($$cities[0], $$opts{Lang});
2013
+ my @tags = $self->GetGeolocateTags($wantGroup, $dist ? 0 : 1);
2006
2014
  my %geoNum = ( City => 0, Province => 1, State => 1, Code => 3, Country => 4,
2007
2015
  Coordinates => 89, Latitude => 8, Longitude => 9 );
2008
2016
  my ($tag, $value);
@@ -2049,8 +2057,9 @@ my %systemTagsNotes = (
2049
2057
  GeolocationSubregion=> { %geoInfo, Notes => 'geolocation county or subregion', ValueConv => '$self->Decode($val,"UTF8")' },
2050
2058
  GeolocationCountry => { %geoInfo, Notes => 'geolocation country name', ValueConv => '$self->Decode($val,"UTF8")' },
2051
2059
  GeolocationCountryCode=>{%geoInfo, Notes => 'geolocation country code' },
2052
- GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone name' },
2053
- GeolocationFeatureCode=>{%geoInfo, Notes => 'feature code, see L<http://www.geonames.org/export/codes.html#P>' },
2060
+ GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone ID' },
2061
+ GeolocationFeatureCode=>{%geoInfo, Notes => 'geolocation feature code, see L<http://www.geonames.org/export/codes.html#P>' },
2062
+ GeolocationFeatureType=>{%geoInfo, Notes => 'geolocation feature type' },
2054
2063
  GeolocationPopulation=>{ %geoInfo, Notes => 'city population rounded to 2 significant digits' },
2055
2064
  GeolocationDistance => { %geoInfo, Notes => 'distance in km from current GPS to city', PrintConv => '"$val km"' },
2056
2065
  GeolocationPosition => { %geoInfo, Notes => 'approximate GPS coordinates of city',
@@ -2556,6 +2565,8 @@ sub Options($$;@)
2556
2565
  } else {
2557
2566
  warn("Can't set $param to undef\n");
2558
2567
  }
2568
+ } elsif (lc $param eq 'geodir') {
2569
+ $Image::ExifTool::Geolocation::geoDir = $newVal; # (undocumented)
2559
2570
  } else {
2560
2571
  if ($param eq 'Escape') {
2561
2572
  # set ESCAPE_PROC
@@ -2574,7 +2585,15 @@ sub Options($$;@)
2574
2585
  delete $$self{GLOBAL_TIME_OFFSET}; # reset our calculated offset
2575
2586
  } elsif ($param eq 'TimeZone' and defined $newVal and length $newVal) {
2576
2587
  $ENV{TZ} = $newVal;
2577
- eval { require POSIX; POSIX::tzset() };
2588
+ if ($^O eq 'MSWin32') {
2589
+ if (eval { require Time::Piece }) {
2590
+ eval { Time::Piece::_tzset() };
2591
+ } else {
2592
+ warn("Install Time::Piece to set time zone in Windows\n");
2593
+ }
2594
+ } else {
2595
+ eval { require POSIX; POSIX::tzset() };
2596
+ }
2578
2597
  } elsif ($param eq 'Validate') {
2579
2598
  # load Validate module if Validate option enabled
2580
2599
  $newVal and require Image::ExifTool::Validate;
@@ -4362,13 +4381,14 @@ sub DoneExtract($)
4362
4381
  local $SIG{'__WARN__'} = \&SetWarning;
4363
4382
  undef $evalWarning;
4364
4383
  $$opts{GeolocMulti} = $$opts{Duplicates};
4365
- my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($arg, $opts);
4384
+ my ($cities, $dist) = Image::ExifTool::Geolocation::Geolocate($arg, $opts);
4366
4385
  delete $$opts{GeolocMulti};
4367
- # ($i will be an ARRAY ref if multiple matches were found and the Duplicates option is set)
4368
- if ($n and (ref $i or $n < 2 or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4369
- my $list = ref $i ? $i : [ $i ]; # make a list if not done alreaday
4370
- foreach $i (@$list) {
4371
- my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
4386
+ if ($cities and (@$cities < 2 or $dist or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4387
+ $self->FoundTag(GeolocationWarning => 'Search matched '.scalar(@$cities).' cities') if @$cities > 1;
4388
+ my $city;
4389
+ foreach $city (@$cities) {
4390
+ $$self{DOC_NUM} = ++$$self{DOC_COUNT} unless $city eq $$cities[0];
4391
+ my @geo = Image::ExifTool::Geolocation::GetEntry($city, $$opts{Lang});
4372
4392
  $self->FoundTag(GeolocationCity => $geo[0]);
4373
4393
  $self->FoundTag(GeolocationRegion => $geo[1]) if $geo[1];
4374
4394
  $self->FoundTag(GeolocationSubregion => $geo[2]) if $geo[2];
@@ -4376,13 +4396,17 @@ sub DoneExtract($)
4376
4396
  $self->FoundTag(GeolocationCountry => $geo[4]) if $geo[4];
4377
4397
  $self->FoundTag(GeolocationTimeZone => $geo[5]) if $geo[5];
4378
4398
  $self->FoundTag(GeolocationFeatureCode => $geo[6]);
4399
+ $self->FoundTag(GeolocationFeatureType => $geo[10]) if $geo[10];
4379
4400
  $self->FoundTag(GeolocationPopulation => $geo[7]);
4380
4401
  $self->FoundTag(GeolocationPosition => "$geo[8] $geo[9]");
4381
- next if $i != $$list[0];
4382
- $self->FoundTag(GeolocationDistance => $km) if defined $km;
4383
- $self->FoundTag(GeolocationBearing => $be) if defined $be;
4384
- $self->FoundTag(GeolocationWarning => "Search matched $n cities") if $n > 1;
4402
+ if ($dist) {
4403
+ $self->FoundTag(GeolocationDistance => $$dist[0][0]);
4404
+ $self->FoundTag(GeolocationBearing => $$dist[0][1]);
4405
+ shift @$dist;
4406
+ }
4407
+ last unless $$opts{Duplicates};
4385
4408
  }
4409
+ delete $$self{DOC_NUM};
4386
4410
  } elsif ($evalWarning) {
4387
4411
  $self->Warn(CleanWarning());
4388
4412
  }
@@ -6363,6 +6387,7 @@ sub TimeLocal(@)
6363
6387
  if ($^O eq 'MSWin32') {
6364
6388
  # patch for ActivePerl timezone bug
6365
6389
  my @t2 = localtime($tm);
6390
+ $t2[5] += 1900;
6366
6391
  my $t2 = Time::Local::timelocal(@t2);
6367
6392
  # adjust timelocal() return value to be consistent with localtime()
6368
6393
  $tm += $tm - $t2;