Skip to content

Commit

Permalink
12.80
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Mar 24, 2024
1 parent 2edb7c5 commit e9593c3
Show file tree
Hide file tree
Showing 35 changed files with 57,268 additions and 2,758 deletions.
21 changes: 19 additions & 2 deletions bin/exiftool_files/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,28 @@ RSS feed: https://exiftool.org/rss.xml
Note: The most recent production release is Version 12.76. (Other versions are
considered development releases, and are not uploaded to MetaCPAN.)

Mar. 19, 2024 - Version 12.80

- Added GeolocationFeatureCode tag
- Added XMP-acdsee-rs tags and a new XMP-xmpDM tag
- Added ACDSeeRegion2MWGRegion conversion to config_files/acdsee.config
- Added GPSAltitudeRef to XMP-iptcExt LocationDetails structure
- Added a couple of new FujiFilm tags and a new CropMode value
- Added conversion for XMP-aux:ApproximateFocusDistance "infinity"
- Improved Geolocation regular expressions to allow negative matches
- Improved accuracy of Geolocation distance/bearing calculations
- Changed structure of Geolocation database (now version 1.02)
- Minor change to key format for user-defined Geolocation name translations
- Fixed case/spacing of "C2PA" in some CBOR tag descriptions
- Fixed bug extracting binary data from EXR files
- API Changes:
- Added GeolocFeature option

Mar. 15, 2024 - Version 12.79

- Improvements to new Geolocation feature:
- Added ability to obtain GPS coordinates from city name
- Added reverse Geolocation ability (obtain GPS coordinates from city
name), with support for regular expressions
- Added -listgeo option to list the Geolocation database
- Added the ability to include user-defined cities in the Geolocation
database
Expand All @@ -20,7 +38,6 @@ Mar. 15, 2024 - Version 12.79
Geolocation option
- Added language translations for Geolocation names
- Increased resolution of Geolocation GPS positions and stored populations

- API Changes:
- Save necessary data members to allow GetInfo to be accessed by
user-defined tags
Expand Down
4 changes: 2 additions & 2 deletions bin/exiftool_files/README
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ your home directory, then you would type the following commands in a
terminal window to extract and run ExifTool:

cd ~/Desktop
gzip -dc Image-ExifTool-12.79.tar.gz | tar -xf -
cd Image-ExifTool-12.79
gzip -dc Image-ExifTool-12.80.tar.gz | tar -xf -
cd Image-ExifTool-12.80
./exiftool t/images/ExifTool.jpg

Note: These commands extract meta information from one of the test images.
Expand Down
94 changes: 37 additions & 57 deletions bin/exiftool_files/config_files/acdsee.config
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
# type tags to ACDSee regions.
# MPRegion2ACDSeeRegion : Converts a Microsoft RegionInfoMP
# IPTCRegion2ACDSeeRegion : Converts an IPTC ImageRegion
# MWGRegion2ACDSeeRegion : Converts a MWG RegionInfo
# MWGRegion2ACDSeeRegion : Converts from a MWG RegionInfo
# ACDSeeRegion2MWGRegion : Converts to a MWG RegionInfo
#
# Usage: To set individual tags
# exiftool -config acdsee.config -ACDSEETAG=VALUE FILE ...
Expand All @@ -52,6 +53,8 @@
# exiftool -config acdsee.config "-RegionInfoACDSee<IPTCRegion2ACDSeeRegion" File ...
# To convert MWG Regions to ACDSee regions
# exiftool -config acdsee.config "-RegionInfoACDSee<MWGRegion2ACDSeeRegion" File ...
# To convert ACDSee Regions to MWG regions
# exiftool -config acdsee.config "-RegionInfo<ACDSeeRegion2MWGRegion" File ...
#
# Requires: ExifTool version 10.28 or later
#
Expand All @@ -64,45 +67,12 @@
# "RegionInfoACDSeeAppliedToDimensions*" -> "ACDSeeRegionAppliedToDimensions*"
# "RegionInfoACDSeeRegionList* -> "ACDSeeRegion*"
# 2022/10/03 - PH Set group name properly to XMP-acdsee-rs
# 2024/03/19 - PH Moved XMP-acdsee-rs tags into the standard distribution,
# and added ACDSeeRegion2MWGRegion conversion
#------------------------------------------------------------------------------
use Data::Dumper;

my %sACDSeeDimensions = (
STRUCT_NAME => 'ACDSee Dimensions',
NAMESPACE => {'acdsee-stDim' => 'http://ns.acdsee.com/sType/Dimensions#'},
'w' => { Writable => 'real' },
'h' => { Writable => 'real' },
'unit' => { },
);

my %sACDSeeArea = (
STRUCT_NAME => 'ACDSee Area',
NAMESPACE => { 'acdsee-stArea' => 'http://ns.acdsee.com/sType/Area#' },
'x' => { Writable => 'real' },
'y' => { Writable => 'real' },
w => { Writable => 'real' },
h => { Writable => 'real' },
);

my %sACDSeeRegionStruct = (
STRUCT_NAME => 'ACDSee Regions',
NAMESPACE => { 'acdsee-rs' => 'http://ns.acdsee.com/regions/' },
ALGArea => { Struct => \%sACDSeeArea },
DLYArea => { Struct => \%sACDSeeArea },
Name => { },
NameAssignType => { },
Type => { },
);

%Image::ExifTool::UserDefined = (
# new XMP namespaces for ACDSee regions
'Image::ExifTool::XMP::Main' => {
'acdsee-rs' => { # <-- must be the same as the NAMESPACE prefix
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::ACDSeeRegions'
},
},
},
'Image::ExifTool::Composite' => {
# create an ACDSee RegionInfo structure from a Microsoft RegionInfoMP structure
MPRegion2ACDSeeRegion => {
Expand Down Expand Up @@ -176,7 +146,7 @@ my %sACDSeeRegionStruct = (
},
},

# create an MWG RegionInfo structure from an IPTC ImageRegion list
# create an ACDSee RegionInfo structure from an MWG RegionInfo structure
MWGRegion2ACDSeeRegion => {
Require => {
0 => 'RegionInfo',
Expand Down Expand Up @@ -207,29 +177,39 @@ my %sACDSeeRegionStruct = (
}
},
},
####
},
);

%Image::ExifTool::UserDefined::ACDSeeRegions = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-acdsee-rs', 2 => 'Image' },
NAMESPACE => { 'acdsee-rs' => 'http://ns.acdsee.com/regions/' },
WRITABLE => 'string', # (default to string-type tags)
Regions => {
Name => 'RegionInfoACDSee',
FlatName => 'ACDSee',
# the "Struct" entry defines the structure fields
Struct => {
# optional structure name (used for warning messages only)
STRUCT_NAME => 'ACDSee RegionInfo',
RegionList => {
FlatName => 'Region',
Struct => \%sACDSeeRegionStruct,
List => 'Bag',
# create an MWG RegionInfo structure from an ACDSee RegionInfo
ACDSeeRegion2MWGRegion => {
Require => {
0 => 'RegionInfoACDSee',
1 => 'ImageWidth',
2 => 'ImageHeight',
},
ValueConv => q{
my ($rgn, @newRgns);
my %newRgn;
foreach $rgn (@{$val[0]{RegionList}}) {
next unless $$rgn{Area} or defined $$rgn{Name};
my %newRgn;
if ($$rgn{DLYArea}) {
$newRgn{Area} = {
'X' => $$rgn{DLYArea}{'X'},
'Y' => $$rgn{DLYArea}{'Y'},
'W' => $$rgn{DLYArea}{'W'},
'H' => $$rgn{DLYArea}{'H'},
};
};
$newRgn{Name} = $$rgn{Name} if defined $$rgn{Name};
$newRgn{'Type'} = $$rgn{'Type'} if defined $$rgn{'Type'};
push @newRgns, \%newRgn;
}
return {
'AppliedToDimensions' => $val[0]{'AppliedToDimensions'},
RegionList => \@newRgns,
}
},
AppliedToDimensions => {
FlatName => 'RegionAppliedToDimensions',Struct => \%sACDSeeDimensions },
},
####
},
);

Expand Down
18 changes: 12 additions & 6 deletions bin/exiftool_files/exiftool.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use warnings;
require 5.004;

my $version = '12.79';
my $version = '12.80';

# add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
my $exePath;
Expand Down Expand Up @@ -736,12 +736,16 @@ ()
require Image::ExifTool::Geolocation;
my ($i, $entry);
print "Geolocation database:\n" unless $quiet;
print "City,Region,CountryCode,Country,TimeZone,Population,Latitude,Longitude\n";
print "City,Region,Subregion,CountryCode,Country,TimeZone,FeatureCode,Population,Latitude,Longitude\n";
Image::ExifTool::Geolocation::SortDatabase('City') if $sortOpt;
my $minPop = $mt->Options('GeoMinPop');
my $minPop = $mt->Options('GeolocMinPop');
my $feature = $mt->Options('GeolocFeature') || '';
my $neg = $feature =~ s/^-//;
my %fcodes = map { lc($_) => 1 } split /\s*,\s*/, $feature;
for ($i=0; ; ++$i) {
my @entry = Image::ExifTool::Geolocation::GetEntry($i,$langOpt) or last;
next if $minPop and $entry[5] < $minPop;
next if $minPop and $entry[7] < $minPop;
next if %fcodes and $neg ? $fcodes{lc $entry[6]} : not $fcodes{lc $entry[6]};
$_ = defined $_ ? $mt->Decode($_, 'UTF8') : '' foreach @entry[0,1,2,4];
print join(',', @entry), "\n";
}
Expand Down Expand Up @@ -5676,7 +5680,7 @@ ()
produces output like this:
-- Generated by ExifTool 12.79 --
-- Generated by ExifTool 12.80 --
File: a.jpg - 2003:10:31 15:44:19
(f/5.6, 1/60s, ISO 100)
File: b.jpg - 2006:05:23 11:57:38
Expand Down Expand Up @@ -6458,7 +6462,9 @@ ()
-listf, -listr or -listwf to add file descriptions to the list. The
-lang option may be combined with -listx to output descriptions in
a single language, and the -sort and/or -lang options may be
combined with -listgeo. Here are some examples:
combined with -listgeo. Also, the API GeolocMinPop and
GeolocFeature options apply to the -listgeo output. Here are some
examples:
-list # list all tag names
-list -EXIF:All # list all EXIF tags
Expand Down
43 changes: 26 additions & 17 deletions bin/exiftool_files/lib/Image/ExifTool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
%jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
%static_vars);

$VERSION = '12.79';
$VERSION = '12.80';
$RELEASE = '';
@ISA = qw(Exporter);
%EXPORT_TAGS = (
Expand Down Expand Up @@ -1103,6 +1103,7 @@ my @availableOptions = (
[ 'FilterW', undef, 'input filter when writing tag values' ],
[ 'FixBase', undef, 'fix maker notes base offsets' ],
[ 'Geolocation', undef, 'generate geolocation tags' ],
[ 'GeolocFeature', undef, 'regular expression of geolocation features to match' ],
[ 'GeolocMinPop', undef, 'minimum geolocation population' ],
[ 'GeolocMaxDist', undef, 'maximum geolocation distance' ],
[ 'GeoMaxIntSecs', 1800, 'geotag maximum interpolation time (secs)' ],
Expand Down Expand Up @@ -1976,7 +1977,7 @@ my %systemTagsNotes = (
this write-only tag may be used to write geolocation city, region, country
code and country based in input GPS coordinates, or to write GPS
coordinates based on geolocation name. See the
L<Geolocation section of the Geotag page|../geolocation.html> for
L<Writing section of the Geolocation page|../geolocation.html#Write> for
details. This tag is writable regardless of the API L<Geolocation|../ExifTool.html#Geolocation>
option setting
},
Expand All @@ -1990,19 +1991,19 @@ my %systemTagsNotes = (
return $val if lc($val) eq 'geotag';
my $opts = $$self{OPTIONS};
my $geo = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'),
$$opts{GeolocMinPop}, $$opts{GeolocMaxDist}, $$opts{Lang});
$$opts{GeolocMinPop}, $$opts{GeolocMaxDist}, $$opts{Lang}, undef, $$opts{GeolocFeature});
return '' unless $geo;
if ($$geo[11] and $self->Warn('Multiple matching cities found',2)) {
if ($$geo[12] and $self->Warn('Multiple matching cities found',2)) {
warn "$$self{VALUE}{Warning}\n";
return '';
}
my @tags = $self->GetGeolocateTags($wantGroup, defined $$geo[9] ? 0 : 1);
my @tags = $self->GetGeolocateTags($wantGroup, defined $$geo[10] ? 0 : 1);
my %geoNum = ( City => 0, Province => 1, State => 1, Code => 3, Country => 4,
Coordinates => 78, Latitude => 7, Longitude => 8 );
Coordinates => 89, Latitude => 8, Longitude => 9 );
my ($tag, $value);
foreach $tag (@tags) {
if ($tag =~ /GPS(Coordinates|Latitude|Longitude)?/) {
$value = $geoNum{$1} == 78 ? "$$geo[7],$$geo[8]" : $$geo[$geoNum{$1}];
$value = $geoNum{$1} == 89 ? "$$geo[8],$$geo[9]" : $$geo[$geoNum{$1}];
} elsif ($tag =~ /(Code)/ or $tag =~ /(City|Province|State|Country)/) {
$value = $$geo[$geoNum{$1}];
next unless defined $value;
Expand Down Expand Up @@ -2037,6 +2038,7 @@ my %systemTagsNotes = (
GeolocationCountry => { %geoInfo, Notes => 'geolocation country name', ValueConv => '$self->Decode($val,"UTF8")' },
GeolocationCountryCode=>{%geoInfo, Notes => 'geolocation country code' },
GeolocationTimeZone => { %geoInfo, Notes => 'geolocation time zone name' },
GeolocationFeatureCode=>{%geoInfo, Notes => 'feature code, see L<http://www.geonames.org/export/codes.html#P>' },
GeolocationPopulation=>{ %geoInfo, Notes => 'city population rounded to 2 significant digits' },
GeolocationDistance => { %geoInfo, Notes => 'distance in km from current GPS to city', PrintConv => '"$val km"' },
GeolocationPosition => { %geoInfo, Notes => 'approximate GPS coordinates of city',
Expand Down Expand Up @@ -4264,10 +4266,11 @@ sub DoneExtract($)
}
# generate geolocation tags if requested
if ($$opts{Geolocation}) {
my ($arg, @defaults, @tags, $tag, @coord, @ref, @city, $doneCity);
my ($arg, @defaults, @tags, $tag, @coord, @ref, @city, $doneCity, $both);
my $geoOpt = $$opts{Geolocation};
my @args = split /\s*,\s*/, $$opts{Geolocation};
foreach $arg (@args) {
lc $arg eq 'both' and $both = 1, next;
$arg !~ s/^\$// and push(@defaults, $arg), next;
push @tags, $arg; # argument is a tag name
}
Expand All @@ -4285,6 +4288,7 @@ sub DoneExtract($)
foreach $tag (@tags) {
my $val = $$info{$tag};
next unless defined $val;
$self->VPrint(0, "Found $tag ($val)\n");
if ($tag =~ /Coordinates/) {
next if defined $coord[0] and defined $coord[1];
@coord = split ' ', $val;
Expand Down Expand Up @@ -4316,10 +4320,13 @@ sub DoneExtract($)
$arg = join ',', @city;
}
if (not defined $arg) {
$arg = join ',', @defaults; # use specified default values if no tags found
# use specified default values if no tags found
$arg = join ',', @defaults;
undef $arg if $arg eq '1';
$both = 1; # use 'both' GPS and place names if provided
}
if ($arg) {
$arg .= ',both' if $both;
$arg = $self->Encode($arg, 'UTF8');
require Image::ExifTool::Geolocation;
if ($$opts{Verbose}) {
Expand All @@ -4332,9 +4339,10 @@ sub DoneExtract($)
local $SIG{'__WARN__'} = \&SetWarning;
undef $evalWarning;
my $geo = Image::ExifTool::Geolocation::Geolocate($arg, $$opts{GeolocMinPop},
$$opts{GeolocMaxDist}, $$opts{Lang}, $$opts{Duplicates});
$$opts{GeolocMaxDist}, $$opts{Lang}, $$opts{Duplicates},
$$opts{GeolocFeature});
# ($$geo[0] will be an ARRAY ref if multiple matches were found and the Duplicates option is set)
if ($geo and (ref $$geo[0] or not $$geo[11] or not $self->Warn('Multiple Geolocation cities are possible',2))) {
if ($geo and (ref $$geo[0] or not $$geo[12] or not $self->Warn('Multiple Geolocation cities are possible',2))) {
my $geoList = ref $$geo[0] ? $geo : [ $geo ]; # make a list if not done alreaday
foreach $geo (@$geoList) {
$self->FoundTag(GeolocationCity => $$geo[0]);
Expand All @@ -4343,11 +4351,12 @@ sub DoneExtract($)
$self->FoundTag(GeolocationCountryCode => $$geo[3]);
$self->FoundTag(GeolocationCountry => $$geo[4]) if $$geo[4];
$self->FoundTag(GeolocationTimeZone => $$geo[5]) if $$geo[5];
$self->FoundTag(GeolocationPopulation => $$geo[6]);
$self->FoundTag(GeolocationPosition => "$$geo[7] $$geo[8]");
$self->FoundTag(GeolocationDistance => $$geo[9]) if defined $$geo[9];
$self->FoundTag(GeolocationBearing => $$geo[10]) if defined $$geo[10];
$self->FoundTag(GeolocationWarning => "Search matched $$geo[11] cities") if $$geo[11] and $geo eq $$geoList[0];
$self->FoundTag(GeolocationFeatureCode => $$geo[6]);
$self->FoundTag(GeolocationPopulation => $$geo[7]);
$self->FoundTag(GeolocationPosition => "$$geo[8] $$geo[9]");
$self->FoundTag(GeolocationDistance => $$geo[10]) if defined $$geo[10];
$self->FoundTag(GeolocationBearing => $$geo[11]) if defined $$geo[11];
$self->FoundTag(GeolocationWarning => "Search matched $$geo[12] cities") if $$geo[12] and $geo eq $$geoList[0];
}
} elsif ($evalWarning) {
$self->Warn(CleanWarning());
Expand Down Expand Up @@ -6085,8 +6094,8 @@ sub MakeTagName($)
my $name = shift;
$name =~ tr/-_a-zA-Z0-9//dc; # remove illegal characters
$name = ucfirst $name; # capitalize first letter
$name = "Tag$name" if length($name) < 2 or $name =~ /^[-0-9]/;
# must at least 2 characters long and not start with - or 0-9-
$name = "Tag$name" if length($name) < 2 or $name =~ /^[-0-9]/;
return $name;
}

Expand Down
8 changes: 8 additions & 0 deletions bin/exiftool_files/lib/Image/ExifTool.pod
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,14 @@ to use for the geolocation input. May also include regular expressions for
more flexible matching. See L<https://exiftool.org/geolocation.html> for
more details. Default is undef.

=item GeolocFeature

Comma-separated list of feature codes to include in city search, or exclude
if the list begins with a dash (-). Valid feature codes are PPL, PPLA,
PPLA2, PPLA3, PPLA4, PPLA5, PPLC, PPLCH, PPLF, PPLG, PPLL, PPLR, PPLS, STLMT
and Other. See L<http://www.geonames.org/export/codes.html#P> for a
description of these codes. Default is undef.

=item GeolocMaxDist

Maximum distance in km to the geolocation city. The Geolocation tags are
Expand Down
Loading

0 comments on commit e9593c3

Please sign in to comment.