exiftool-vendored.pl 12.78.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.
@@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
30
  %static_vars);
31
31
 
32
- $VERSION = '12.78';
32
+ $VERSION = '12.80';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -103,6 +103,7 @@ sub VerboseValue($$$;$);
103
103
  sub VPrint($$@);
104
104
  sub Rationalize($;$);
105
105
  sub Write($@);
106
+ sub GetGeolocateTags($$;$);
106
107
  sub WriteTrailerBuffer($$$);
107
108
  sub AddNewTrailers($;@);
108
109
  sub Tell($);
@@ -1102,6 +1103,7 @@ my @availableOptions = (
1102
1103
  [ 'FilterW', undef, 'input filter when writing tag values' ],
1103
1104
  [ 'FixBase', undef, 'fix maker notes base offsets' ],
1104
1105
  [ 'Geolocation', undef, 'generate geolocation tags' ],
1106
+ [ 'GeolocFeature', undef, 'regular expression of geolocation features to match' ],
1105
1107
  [ 'GeolocMinPop', undef, 'minimum geolocation population' ],
1106
1108
  [ 'GeolocMaxDist', undef, 'maximum geolocation distance' ],
1107
1109
  [ 'GeoMaxIntSecs', 1800, 'geotag maximum interpolation time (secs)' ],
@@ -1171,7 +1173,7 @@ my @defaultWriteGroups = qw(
1171
1173
 
1172
1174
  # group hash for ExifTool-generated tags
1173
1175
  my %allGroupsExifTool = ( 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'ExifTool' );
1174
- my %geoGroups = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' } );
1176
+ my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' }, Priority => 0 );
1175
1177
 
1176
1178
  # special tag names (not used for tag info)
1177
1179
  %specialTags = map { $_ => 1 } qw(
@@ -1201,7 +1203,7 @@ sub DummyWriteProc { return 1; }
1201
1203
 
1202
1204
  my %systemTagsNotes = (
1203
1205
  Notes => q{
1204
- extracted only if specifically requested or the L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll> API
1206
+ extracted only if specifically requested or the API L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll>
1205
1207
  option is set
1206
1208
  },
1207
1209
  );
@@ -1484,7 +1486,7 @@ my %systemTagsNotes = (
1484
1486
  FileAttributes => {
1485
1487
  Groups => { 1 => 'System', 2 => 'Other' },
1486
1488
  Notes => q{
1487
- extracted only if specifically requested or the L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll> API
1489
+ extracted only if specifically requested or the API L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll>
1488
1490
  option is set. 2 or 3 values: 0. File type, 1. Attribute bits, 2. Windows
1489
1491
  attribute bits if Win32API::File is available
1490
1492
  },
@@ -1539,7 +1541,7 @@ my %systemTagsNotes = (
1539
1541
  FileUserID => {
1540
1542
  Groups => { 1 => 'System', 2 => 'Other' },
1541
1543
  Notes => q{
1542
- extracted only if specifically requested or the L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll> API
1544
+ extracted only if specifically requested or the API L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll>
1543
1545
  option is set. Returns user ID number with the -n option, or name
1544
1546
  otherwise. May be written with either user name or number
1545
1547
  },
@@ -1553,7 +1555,7 @@ my %systemTagsNotes = (
1553
1555
  FileGroupID => {
1554
1556
  Groups => { 1 => 'System', 2 => 'Other' },
1555
1557
  Notes => q{
1556
- extracted only if specifically requested or the L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll> API
1558
+ extracted only if specifically requested or the API L<SystemTags|../ExifTool.html#SystemTags> or L<RequestAll|../ExifTool.html#RequestAll>
1557
1559
  option is set. Returns group ID number with the -n option, or name
1558
1560
  otherwise. May be written with either group name or number
1559
1561
  },
@@ -1796,7 +1798,7 @@ my %systemTagsNotes = (
1796
1798
  Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Other' },
1797
1799
  Notes => q{
1798
1800
  the clock time in seconds taken by ExifTool to extract information from this
1799
- file. Not generated unless specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API
1801
+ file. Not generated unless specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll>
1800
1802
  option is set. Requires Time::HiRes
1801
1803
  },
1802
1804
  PrintConv => 'sprintf("%.3g s", $val)',
@@ -1937,7 +1939,7 @@ my %systemTagsNotes = (
1937
1939
  Groups => { 0 => 'Trailer' },
1938
1940
  Notes => q{
1939
1941
  the full JPEG trailer data block. Extracted only if specifically requested
1940
- or the API RequestAll option is set to 3 or higher
1942
+ or the API L<RequestAll|../ExifTool.html#RequestAll> option is set to 3 or higher
1941
1943
  },
1942
1944
  Writable => 1,
1943
1945
  Protected => 1,
@@ -1970,78 +1972,79 @@ my %systemTagsNotes = (
1970
1972
  Writable => 1,
1971
1973
  WriteOnly => 1,
1972
1974
  WriteNothing => 1,
1973
- AllowGroup => '(xmp|iptc)',
1975
+ AllowGroup => '(exif|gps|xmp|xmp-exif|xmp-iptcext|xmp-iptccore|xmp-photoshop|iptc|quicktime|itemlist|keys|userdata)',
1974
1976
  Notes => q{
1975
- this write-only tag accepts GPS coordinates in the same form as GPSPosition
1976
- and by default writes XMP City, State, CountryCode and Country, but the IPTC
1977
- group may be specified to instead write IPTC City, Province-State,
1978
- Country-PrimaryLocationCode and Country-PrimaryLocationName. Writable
1979
- regardless of the API Geolocation option setting
1977
+ this write-only tag may be used to write geolocation city, region, country
1978
+ code and country based in input GPS coordinates, or to write GPS
1979
+ coordinates based on geolocation name. See the
1980
+ L<Writing section of the Geolocation page|../geolocation.html#Write> for
1981
+ details. This tag is writable regardless of the API L<Geolocation|../ExifTool.html#Geolocation>
1982
+ option setting
1980
1983
  },
1981
1984
  DelCheck => q{
1982
- my $grp = lc($wantGroup || 'xmp');
1983
- if ($grp eq 'xmp') {
1984
- $self->SetNewValue('XMP:'.$_) foreach qw(City State CountryCode Country);
1985
- } elsif ($grp eq 'iptc') {
1986
- $self->SetNewValue('IPTC:'.$_) foreach qw(City Province-State Country-PrimaryLocationCode Country-PrimaryLocationName);
1987
- }
1985
+ my @tags = $self->GetGeolocateTags($wantGroup);
1986
+ $self->SetNewValue($_) foreach @tags;
1988
1987
  return '';
1989
1988
  },
1990
1989
  ValueConvInv => q{
1991
- my ($lat, $lon) = split /[, ]+/, $val;
1992
- defined $lat and defined $lon or warn('Invalid GPS position, use "Lat, Lon"'), return undef;
1993
- my $grp = lc($wantGroup || 'xmp');
1994
- if ($grp ne 'xmp' and $grp ne 'iptc') {
1995
- warn "Invalid group name for Geolocate\n";
1996
- } else {
1997
- require Image::ExifTool::Geolocation;
1998
- my @a = Image::ExifTool::Geolocation::Geolocate($lat, $lon,
1999
- $$self{OPTIONS}{GeolocMinPop}, $$self{OPTIONS}{GeolocMaxDist});
2000
- my $i = 0;
2001
- if (not defined $a[0]) {
2002
- warn "No suitable geolocation found\n";
2003
- } elsif ($grp eq 'xmp') {
2004
- foreach (qw(City State CountryCode Country)) {
2005
- next unless defined $a[$i++];
2006
- $self->SetNewValue('XMP:'.$_, $self->Decode($a[$i-1],'UTF8'));
2007
- }
1990
+ require Image::ExifTool::Geolocation;
1991
+ return $val if lc($val) eq 'geotag';
1992
+ my $opts = $$self{OPTIONS};
1993
+ my $geo = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'),
1994
+ $$opts{GeolocMinPop}, $$opts{GeolocMaxDist}, $$opts{Lang}, undef, $$opts{GeolocFeature});
1995
+ return '' unless $geo;
1996
+ if ($$geo[12] and $self->Warn('Multiple matching cities found',2)) {
1997
+ warn "$$self{VALUE}{Warning}\n";
1998
+ return '';
1999
+ }
2000
+ my @tags = $self->GetGeolocateTags($wantGroup, defined $$geo[10] ? 0 : 1);
2001
+ my %geoNum = ( City => 0, Province => 1, State => 1, Code => 3, Country => 4,
2002
+ Coordinates => 89, Latitude => 8, Longitude => 9 );
2003
+ my ($tag, $value);
2004
+ foreach $tag (@tags) {
2005
+ if ($tag =~ /GPS(Coordinates|Latitude|Longitude)?/) {
2006
+ $value = $geoNum{$1} == 89 ? "$$geo[8],$$geo[9]" : $$geo[$geoNum{$1}];
2007
+ } elsif ($tag =~ /(Code)/ or $tag =~ /(City|Province|State|Country)/) {
2008
+ $value = $$geo[$geoNum{$1}];
2009
+ next unless defined $value;
2010
+ $value = $self->Decode($value,'UTF8');
2011
+ $value .= ' ' if $tag eq 'iptc:Country-PrimaryLocationCode'; # (IPTC requires 3-char code)
2008
2012
  } else {
2009
- $a[2] .= ' '; # pad country code with space to meet IPTC length requirements
2010
- foreach (qw(City Province-State Country-PrimaryLocationCode Country-PrimaryLocationName)) {
2011
- next unless defined $a[$i++];
2012
- $self->SetNewValue('IPTC:'.$_, $self->Decode($a[$i-1],'UTF8'));
2013
- }
2013
+ next; # (shouldn't happen)
2014
2014
  }
2015
+ $self->SetNewValue($tag => $value, Type => 'PrintConv');
2015
2016
  }
2016
2017
  return '';
2017
2018
  },
2018
2019
  PrintConvInv => q{
2019
- return undef unless $val =~ /(.*? ?[NS]?), ?(.*? ?[EW]?)$/ or
2020
+ return $val unless $val =~ /^([-+]?\d.*?[NS]?), ?([-+]?\d.*?[EW]?)$/ or
2020
2021
  $val =~ /^\s*(-?\d+(?:\.\d+)?)\s*(-?\d+(?:\.\d+)?)\s*$/;
2021
2022
  my ($lat, $lon) = ($1, $2);
2022
2023
  require Image::ExifTool::GPS;
2023
2024
  $lat = Image::ExifTool::GPS::ToDegrees($lat, 1, "lat");
2024
2025
  $lon = Image::ExifTool::GPS::ToDegrees($lon, 1, "lon");
2025
- return "$lat $lon";
2026
+ return "$lat, $lon";
2026
2027
  },
2027
2028
  },
2028
- GeolocationCity => {
2029
- %geoGroups,
2029
+ GeolocationBearing => { %geoInfo,
2030
2030
  Notes => q{
2031
- name of city nearest to the current GPS coordinates. Geolocation tags are
2032
- generated only if API Geolocation option is set
2031
+ compass bearing to GeolocationCity center. Geolocation tags are
2032
+ generated only if API L<Geolocation|../ExifTool.html#Geolocation> option is set
2033
2033
  },
2034
2034
  },
2035
- GeolocationRegion => { %geoGroups, Notes => 'geolocation state, province or region' },
2036
- GeolocationCountry => { %geoGroups, Notes => 'geolocation country name' },
2037
- GeolocationCountryCode=>{%geoGroups, Notes => 'geolocation country code' },
2038
- GeolocationTimeZone => { %geoGroups, Notes => 'geolocation time zone name' },
2039
- GeolocationPopulation=>{ %geoGroups, Notes => 'city population rounded to 1 significant digit' },
2040
- GeolocationDistance => { %geoGroups, Notes => 'distance in km from current GPS to city', PrintConv => '"$val km"' },
2041
- GeolocationBearing => { %geoGroups, Notes => 'compass bearing to city center' },
2042
- GeolocationPosition => { %geoGroups, Notes => 'approximate GPS coordinates of city',
2035
+ GeolocationCity => { %geoInfo, Notes => 'name of city nearest to the current GPS coordinates', ValueConv => '$self->Decode($val,"UTF8")' },
2036
+ GeolocationRegion => { %geoInfo, Notes => 'geolocation state, province or region', ValueConv => '$self->Decode($val,"UTF8")' },
2037
+ GeolocationSubregion=> { %geoInfo, Notes => 'geolocation county or subregion', ValueConv => '$self->Decode($val,"UTF8")' },
2038
+ GeolocationCountry => { %geoInfo, Notes => 'geolocation country name', ValueConv => '$self->Decode($val,"UTF8")' },
2039
+ GeolocationCountryCode=>{%geoInfo, Notes => 'geolocation country code' },
2040
+ GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone name' },
2041
+ GeolocationFeatureCode=>{%geoInfo, Notes => 'feature code, see L<http://www.geonames.org/export/codes.html#P>' },
2042
+ GeolocationPopulation=>{ %geoInfo, Notes => 'city population rounded to 2 significant digits' },
2043
+ GeolocationDistance => { %geoInfo, Notes => 'distance in km from current GPS to city', PrintConv => '"$val km"' },
2044
+ GeolocationPosition => { %geoInfo, Notes => 'approximate GPS coordinates of city',
2043
2045
  PrintConv => '$val =~ s/ /, /; $val',
2044
2046
  },
2047
+ GeolocationWarning => { %geoInfo },
2045
2048
  );
2046
2049
 
2047
2050
  # tags defined by UserParam option (added at runtime)
@@ -2648,6 +2651,7 @@ sub ExtractInfo($;@)
2648
2651
  }
2649
2652
  # initialize ExifTool object members
2650
2653
  $self->Init();
2654
+ $$self{InExtract} = 1; # set flag indicating we are inside ExtractInfo
2651
2655
 
2652
2656
  delete $$self{MAKER_NOTE_FIXUP}; # fixup information for extracted maker notes
2653
2657
  delete $$self{MAKER_NOTE_BYTE_ORDER};
@@ -2825,6 +2829,7 @@ sub ExtractInfo($;@)
2825
2829
  $self->FoundTag('FileTypeExtension', '');
2826
2830
  $self->DoneExtract();
2827
2831
  $raf->Close() if $raf;
2832
+ delete $$self{InExtract} unless $reEntry;
2828
2833
  return 1;
2829
2834
  }
2830
2835
  # get list of file types to check
@@ -3056,6 +3061,7 @@ sub ExtractInfo($;@)
3056
3061
  $$self{$_} = $$reEntry{$_} foreach keys %$reEntry;
3057
3062
  SetByteOrder($saveOrder);
3058
3063
  }
3064
+ delete $$self{InExtract} unless $reEntry;
3059
3065
 
3060
3066
  # ($type may be undef without an Error when processing sub-documents)
3061
3067
  return 0 if not defined $type or exists $$self{VALUE}{Error};
@@ -3075,8 +3081,13 @@ sub GetInfo($;@)
3075
3081
  {
3076
3082
  local $_;
3077
3083
  my $self = shift;
3078
- my %saveOptions;
3084
+ my (%saveOptions, @saveMembers, @savedMembers);
3079
3085
 
3086
+ # save necessary members to allow GetInfo to be called from within ExtractInfo
3087
+ if ($$self{InExtract}) {
3088
+ @saveMembers = qw(REQUESTED_TAGS REQ_TAG_LOOKUP IO_TAG_LIST);
3089
+ @savedMembers = @$self{@saveMembers};
3090
+ }
3080
3091
  unless (@_ and not defined $_[0]) {
3081
3092
  %saveOptions = %{$$self{OPTIONS}}; # save original options
3082
3093
  # must set FILENAME so it isn't parsed from the arguments
@@ -3159,8 +3170,9 @@ sub GetInfo($;@)
3159
3170
  @{$$self{IO_TAG_LIST}} = $self->GetTagList($rtnTags, $sort, $$self{OPTIONS}{Sort2});
3160
3171
  }
3161
3172
 
3162
- # restore original options
3173
+ # restore original options and member variables
3163
3174
  %saveOptions and $$self{OPTIONS} = \%saveOptions;
3175
+ @$self{@saveMembers} = @savedMembers if @saveMembers;
3164
3176
 
3165
3177
  return \%info;
3166
3178
  }
@@ -4253,36 +4265,101 @@ sub DoneExtract($)
4253
4265
  Image::ExifTool::Validate::FinishValidate($self, $$self{REQ_TAG_LOOKUP}{validate});
4254
4266
  }
4255
4267
  # generate geolocation tags if requested
4256
- if ($$opts{Geolocation} and ((defined $$self{VALUE}{GPSLatitude} and
4257
- defined $$self{VALUE}{GPSLongitude}) or $$self{VALUE}{GPSCoordinates} or
4258
- $$opts{Geolocation} =~ /,/))
4259
- {
4260
- my $lat = $self->GetValue('GPSLatitude', 'ValueConv');
4261
- my $lon = $self->GetValue('GPSLongitude', 'ValueConv');
4262
- if (defined $lat and defined $lon) {
4263
- my $latRef = $$self{VALUE}{GPSLatitudeRef};
4264
- my $lonRef = $$self{VALUE}{GPSLongitudeRef};
4265
- $lat = -$lat if $lat and $lat > 0 and $latRef and $latRef eq 'S';
4266
- $lon = -$lon if $lon and $lon > 0 and $lonRef and $lonRef eq 'W';
4267
- } elsif ($$self{VALUE}{GPSCoordinates}) {
4268
- my $pos = $self->GetValue('GPSCoordinates', 'ValueConv');
4269
- ($lat, $lon) = split /[, ]+/, $pos;
4270
- } else {
4271
- ($lat, $lon) = split /[, ]+/, $$opts{Geolocation};
4272
- }
4273
- if (defined $lat and defined $lon) {
4268
+ if ($$opts{Geolocation}) {
4269
+ my ($arg, @defaults, @tags, $tag, @coord, @ref, @city, $doneCity, $both);
4270
+ my $geoOpt = $$opts{Geolocation};
4271
+ my @args = split /\s*,\s*/, $$opts{Geolocation};
4272
+ foreach $arg (@args) {
4273
+ lc $arg eq 'both' and $both = 1, next;
4274
+ $arg !~ s/^\$// and push(@defaults, $arg), next;
4275
+ push @tags, $arg; # argument is a tag name
4276
+ }
4277
+ unless (@tags) {
4278
+ # default tags to read if not specified
4279
+ @tags = qw(GPSLatitude GPSLongitude GPSLatitudeRef GPSLongitudeRef
4280
+ GPSCoordinates LocationShownGPSLatitude LocationShownGPSLongitude
4281
+ XMP:City State CountryCode Country
4282
+ IPTC:City Province-State Country-PrimaryLocationCode Country-PrimaryLocationName
4283
+ LocationShownCity LocationShownProvinceState LocationShownCountryCode LocationShownCountryName);
4284
+ }
4285
+ # get information for specified tags
4286
+ my $info = $self->GetInfo(\@tags, { PrintConv => 0, Duplicates => 0 }); # (returns tags in proper case)
4287
+ $opts = $$self{OPTIONS}; # (necessary because GetInfo changes the OPTIONS hash)
4288
+ foreach $tag (@tags) {
4289
+ my $val = $$info{$tag};
4290
+ next unless defined $val;
4291
+ $self->VPrint(0, "Found $tag ($val)\n");
4292
+ if ($tag =~ /Coordinates/) {
4293
+ next if defined $coord[0] and defined $coord[1];
4294
+ @coord = split ' ', $val;
4295
+ next;
4296
+ }
4297
+ my $n = $tag =~ /Latitude/ ? 0 : ($tag =~ /Longitude/ ? 1 : undef);
4298
+ if (defined $n) {
4299
+ if ($tag =~ /Ref$/) {
4300
+ $ref[$n] = $val unless $ref[$n];
4301
+ } else {
4302
+ $coord[$n] = $val unless defined $coord[$n];
4303
+ }
4304
+ next;
4305
+ }
4306
+ # handle city tags (save info for first city found)
4307
+ if ($tag =~ /City/) {
4308
+ @city and $doneCity = 1, next;
4309
+ push @city, $val;
4310
+ } elsif (@city) {
4311
+ push @city, $val unless $doneCity;
4312
+ next if $doneCity;
4313
+ }
4314
+ }
4315
+ if (defined $coord[0] and defined $coord[1]) {
4316
+ $coord[0] = -$coord[0] if $ref[0] and $coord[0] > 0 and $ref[0] eq 'S';
4317
+ $coord[1] = -$coord[1] if $ref[1] and $coord[1] > 0 and $ref[1] eq 'W';
4318
+ $arg = join ',', @coord;
4319
+ } elsif (@city) {
4320
+ $arg = join ',', @city;
4321
+ }
4322
+ if (not defined $arg) {
4323
+ # use specified default values if no tags found
4324
+ $arg = join ',', @defaults;
4325
+ undef $arg if $arg eq '1';
4326
+ $both = 1; # use 'both' GPS and place names if provided
4327
+ }
4328
+ if ($arg) {
4329
+ $arg .= ',both' if $both;
4330
+ $arg = $self->Encode($arg, 'UTF8');
4274
4331
  require Image::ExifTool::Geolocation;
4275
- my @geo = Image::ExifTool::Geolocation::Geolocate($lat, $lon, $$opts{GeolocMinPop}, $$opts{GeolocMaxDist});
4276
- if ($geo[0]) {
4277
- $self->FoundTag(GeolocationCity => $self->Decode($geo[0],'UTF8'));
4278
- $self->FoundTag(GeolocationRegion => $self->Decode($geo[1],'UTF8')) if $geo[1];
4279
- $self->FoundTag(GeolocationCountryCode => $geo[2]);
4280
- $self->FoundTag(GeolocationCountry => $geo[3]) if $geo[3];
4281
- $self->FoundTag(GeolocationTimeZone => $geo[4]) if $geo[4];
4282
- $self->FoundTag(GeolocationPopulation => $geo[5]);
4283
- $self->FoundTag(GeolocationDistance => $geo[6]);
4284
- $self->FoundTag(GeolocationBearing => $geo[7]) if defined $geo[7];
4285
- $self->FoundTag(GeolocationPosition => "$geo[8] $geo[9]");
4332
+ if ($$opts{Verbose}) {
4333
+ if ($Image::ExifTool::Geolocation::dbInfo) {
4334
+ print "Loaded $Image::ExifTool::Geolocation::dbInfo\n";
4335
+ } else {
4336
+ print "Error loading Geolocation.dat\n";
4337
+ }
4338
+ }
4339
+ local $SIG{'__WARN__'} = \&SetWarning;
4340
+ undef $evalWarning;
4341
+ my $geo = Image::ExifTool::Geolocation::Geolocate($arg, $$opts{GeolocMinPop},
4342
+ $$opts{GeolocMaxDist}, $$opts{Lang}, $$opts{Duplicates},
4343
+ $$opts{GeolocFeature});
4344
+ # ($$geo[0] will be an ARRAY ref if multiple matches were found and the Duplicates option is set)
4345
+ if ($geo and (ref $$geo[0] or not $$geo[12] or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4346
+ my $geoList = ref $$geo[0] ? $geo : [ $geo ]; # make a list if not done alreaday
4347
+ foreach $geo (@$geoList) {
4348
+ $self->FoundTag(GeolocationCity => $$geo[0]);
4349
+ $self->FoundTag(GeolocationRegion => $$geo[1]) if $$geo[1];
4350
+ $self->FoundTag(GeolocationSubregion => $$geo[2]) if $$geo[2];
4351
+ $self->FoundTag(GeolocationCountryCode => $$geo[3]);
4352
+ $self->FoundTag(GeolocationCountry => $$geo[4]) if $$geo[4];
4353
+ $self->FoundTag(GeolocationTimeZone => $$geo[5]) if $$geo[5];
4354
+ $self->FoundTag(GeolocationFeatureCode => $$geo[6]);
4355
+ $self->FoundTag(GeolocationPopulation => $$geo[7]);
4356
+ $self->FoundTag(GeolocationPosition => "$$geo[8] $$geo[9]");
4357
+ $self->FoundTag(GeolocationDistance => $$geo[10]) if defined $$geo[10];
4358
+ $self->FoundTag(GeolocationBearing => $$geo[11]) if defined $$geo[11];
4359
+ $self->FoundTag(GeolocationWarning => "Search matched $$geo[12] cities") if $$geo[12] and $geo eq $$geoList[0];
4360
+ }
4361
+ } elsif ($evalWarning) {
4362
+ $self->Warn(CleanWarning());
4286
4363
  }
4287
4364
  }
4288
4365
  }
@@ -6017,8 +6094,8 @@ sub MakeTagName($)
6017
6094
  my $name = shift;
6018
6095
  $name =~ tr/-_a-zA-Z0-9//dc; # remove illegal characters
6019
6096
  $name = ucfirst $name; # capitalize first letter
6020
- $name = "Tag$name" if length($name) < 2 or $name =~ /^[-0-9]/;
6021
6097
  # must at least 2 characters long and not start with - or 0-9-
6098
+ $name = "Tag$name" if length($name) < 2 or $name =~ /^[-0-9]/;
6022
6099
  return $name;
6023
6100
  }
6024
6101
 
@@ -717,12 +717,24 @@ or undef (the default) for no base adjustment.
717
717
 
718
718
  =item Geolocation
719
719
 
720
- Flag to generate geolocation tags based on current GPSLatitude/GPSLongitude.
721
- This feature uses a database with cities over a population of 1000 from
722
- geonames.org. May be set to a string of the form "Lat,Lon" (eg.
723
- "44.56,-72.33") to act as default GPS coordinates for files not containing
724
- this information. See the comments in Geolocation.pm for more details.
725
- Default is undef.
720
+ Flag to generate geolocation tags based on the GPSLatitude/GPSLongitude or
721
+ City/State/Province/Country read from a file. This feature uses an included
722
+ database with cities over a population of 2000 from geonames.org. May be set
723
+ to a string of the form "Lat,Lon" (eg. "44.56,-72.33") or city with optional
724
+ state/province, country and/or country code (eg. "Paris,France") to act as a
725
+ default for files not containing GPS or geolocation information, or include
726
+ tag names with leading dollar signs separated by commas to specify the tags
727
+ to use for the geolocation input. May also include regular expressions for
728
+ more flexible matching. See L<https://exiftool.org/geolocation.html> for
729
+ more details. Default is undef.
730
+
731
+ =item GeolocFeature
732
+
733
+ Comma-separated list of feature codes to include in city search, or exclude
734
+ if the list begins with a dash (-). Valid feature codes are PPL, PPLA,
735
+ PPLA2, PPLA3, PPLA4, PPLA5, PPLC, PPLCH, PPLF, PPLG, PPLL, PPLR, PPLS, STLMT
736
+ and Other. See L<http://www.geonames.org/export/codes.html#P> for a
737
+ description of these codes. Default is undef.
726
738
 
727
739
  =item GeolocMaxDist
728
740
 
@@ -731,7 +743,8 @@ not generated if the distance is greater than this. Default is undef.
731
743
 
732
744
  =item GeolocMinPop
733
745
 
734
- Minimum population for the Geolocation city.
746
+ Minimum population for the Geolocation city. Cities smaller than this are
747
+ ignored. Default is undef.
735
748
 
736
749
  =item GeoMaxIntSecs
737
750
 
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 12.78
3
+ Version: 12.80
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -21,10 +21,10 @@
21
21
  # 10) Copy zip archive to web servers.
22
22
  # 11) Update zip file version in link and text of html/index.html.
23
23
  #------------------------------------------------------------------------------
24
- -T exiftool-12.78
25
- #--info=FileVersion=12.7.8.0
26
- #--info=ProductVersion=12.7.8.0
27
- ##"--info=Build Date=2024:03:05 14:56:34-05:00"
24
+ -T exiftool-12.80
25
+ #--info=FileVersion=12.8.0.0
26
+ #--info=ProductVersion=12.8.0.0
27
+ ##"--info=Build Date=2024:03:19 14:33:58-04:00"
28
28
  ##"--info=Bundled Perl Version=ActivePerl 5.24.0"
29
29
  ##"--info=LegalCopyright=Copyright (c) 2003-2024, Phil Harvey"
30
30
  ##"--info=ProductName=ExifTool"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exiftool-vendored.pl",
3
- "version": "12.78.0",
3
+ "version": "12.80.0",
4
4
  "description": "Vendored perl ExifTool for Node.js",
5
5
  "main": "./index.js",
6
6
  "homepage": "https://github.com/mceachen/exiftool-vendored.pl#readme",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "mocha": "^10.3.0",
45
- "npm-check-updates": "^16.14.15",
45
+ "npm-check-updates": "^16.14.17",
46
46
  "prettier": "^3.2.5"
47
47
  }
48
48
  }