exiftool_vendored 12.76.1 → 12.80.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +79 -4
  3. data/bin/MANIFEST +27 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +3 -3
  7. data/bin/config_files/acdsee.config +37 -57
  8. data/bin/config_files/example.config +16 -2
  9. data/bin/exiftool +84 -29
  10. data/bin/lib/Image/ExifTool/Canon.pm +12 -9
  11. data/bin/lib/Image/ExifTool/CanonVRD.pm +7 -1
  12. data/bin/lib/Image/ExifTool/Exif.pm +52 -4
  13. data/bin/lib/Image/ExifTool/FujiFilm.pm +3 -0
  14. data/bin/lib/Image/ExifTool/GPS.pm +5 -3
  15. data/bin/lib/Image/ExifTool/GeoLang/cs.pm +978 -0
  16. data/bin/lib/Image/ExifTool/GeoLang/de.pm +1975 -0
  17. data/bin/lib/Image/ExifTool/GeoLang/en_ca.pm +44 -0
  18. data/bin/lib/Image/ExifTool/GeoLang/en_gb.pm +124 -0
  19. data/bin/lib/Image/ExifTool/GeoLang/es.pm +2921 -0
  20. data/bin/lib/Image/ExifTool/GeoLang/fi.pm +1116 -0
  21. data/bin/lib/Image/ExifTool/GeoLang/fr.pm +3171 -0
  22. data/bin/lib/Image/ExifTool/GeoLang/it.pm +2750 -0
  23. data/bin/lib/Image/ExifTool/GeoLang/ja.pm +10256 -0
  24. data/bin/lib/Image/ExifTool/GeoLang/ko.pm +4499 -0
  25. data/bin/lib/Image/ExifTool/GeoLang/nl.pm +1270 -0
  26. data/bin/lib/Image/ExifTool/GeoLang/pl.pm +3019 -0
  27. data/bin/lib/Image/ExifTool/GeoLang/ru.pm +18220 -0
  28. data/bin/lib/Image/ExifTool/GeoLang/sk.pm +441 -0
  29. data/bin/lib/Image/ExifTool/GeoLang/sv.pm +714 -0
  30. data/bin/lib/Image/ExifTool/GeoLang/tr.pm +452 -0
  31. data/bin/lib/Image/ExifTool/GeoLang/zh_cn.pm +2225 -0
  32. data/bin/lib/Image/ExifTool/GeoLang/zh_tw.pm +72 -0
  33. data/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  34. data/bin/lib/Image/ExifTool/Geolocation.pm +775 -0
  35. data/bin/lib/Image/ExifTool/Geotag.pm +8 -1
  36. data/bin/lib/Image/ExifTool/HtmlDump.pm +2 -1
  37. data/bin/lib/Image/ExifTool/Import.pm +5 -2
  38. data/bin/lib/Image/ExifTool/JSON.pm +15 -10
  39. data/bin/lib/Image/ExifTool/MWG.pm +1 -0
  40. data/bin/lib/Image/ExifTool/MacOS.pm +19 -4
  41. data/bin/lib/Image/ExifTool/Nikon.pm +2 -2
  42. data/bin/lib/Image/ExifTool/Ogg.pm +3 -2
  43. data/bin/lib/Image/ExifTool/Olympus.pm +3 -1
  44. data/bin/lib/Image/ExifTool/OpenEXR.pm +17 -17
  45. data/bin/lib/Image/ExifTool/PDF.pm +5 -5
  46. data/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  47. data/bin/lib/Image/ExifTool/QuickTime.pm +183 -11
  48. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +253 -237
  49. data/bin/lib/Image/ExifTool/README +6 -5
  50. data/bin/lib/Image/ExifTool/TagLookup.pm +2624 -2520
  51. data/bin/lib/Image/ExifTool/TagNames.pod +184 -4
  52. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +15 -1
  53. data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  54. data/bin/lib/Image/ExifTool/Writer.pl +59 -8
  55. data/bin/lib/Image/ExifTool/XMP.pm +17 -2
  56. data/bin/lib/Image/ExifTool/XMP2.pl +64 -0
  57. data/bin/lib/Image/ExifTool.pm +249 -47
  58. data/bin/lib/Image/ExifTool.pod +57 -25
  59. data/bin/perl-Image-ExifTool.spec +2 -2
  60. data/lib/exiftool_vendored/version.rb +1 -1
  61. metadata +22 -2
@@ -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.76';
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($);
@@ -953,7 +954,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
953
954
  JPEG => '\xff\xd8\xff',
954
955
  JSON => '(\xef\xbb\xbf)?\s*(\[\s*)?\{\s*"[^"]*"\s*:',
955
956
  JUMBF=> '.{4}jumb\0.{3}jumd',
956
- JXL => '\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl ',
957
+ JXL => '(\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl )',
957
958
  LFP => '\x89LFP\x0d\x0a\x1a\x0a',
958
959
  LIF => '\x70\0{3}.{4}\x2a.{4}<\0',
959
960
  LNK => '.{4}\x01\x14\x02\0{5}\xc0\0{6}\x46',
@@ -1101,6 +1102,10 @@ my @availableOptions = (
1101
1102
  [ 'Filter', undef, 'output filter for all tag values' ],
1102
1103
  [ 'FilterW', undef, 'input filter when writing tag values' ],
1103
1104
  [ 'FixBase', undef, 'fix maker notes base offsets' ],
1105
+ [ 'Geolocation', undef, 'generate geolocation tags' ],
1106
+ [ 'GeolocFeature', undef, 'regular expression of geolocation features to match' ],
1107
+ [ 'GeolocMinPop', undef, 'minimum geolocation population' ],
1108
+ [ 'GeolocMaxDist', undef, 'maximum geolocation distance' ],
1104
1109
  [ 'GeoMaxIntSecs', 1800, 'geotag maximum interpolation time (secs)' ],
1105
1110
  [ 'GeoMaxExtSecs', 1800, 'geotag maximum extrapolation time (secs)' ],
1106
1111
  [ 'GeoMaxHDOP', undef, 'geotag maximum HDOP' ],
@@ -1168,6 +1173,7 @@ my @defaultWriteGroups = qw(
1168
1173
 
1169
1174
  # group hash for ExifTool-generated tags
1170
1175
  my %allGroupsExifTool = ( 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'ExifTool' );
1176
+ my %geoInfo = ( Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Location' }, Priority => 0 );
1171
1177
 
1172
1178
  # special tag names (not used for tag info)
1173
1179
  %specialTags = map { $_ => 1 } qw(
@@ -1197,7 +1203,7 @@ sub DummyWriteProc { return 1; }
1197
1203
 
1198
1204
  my %systemTagsNotes = (
1199
1205
  Notes => q{
1200
- 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>
1201
1207
  option is set
1202
1208
  },
1203
1209
  );
@@ -1480,7 +1486,7 @@ my %systemTagsNotes = (
1480
1486
  FileAttributes => {
1481
1487
  Groups => { 1 => 'System', 2 => 'Other' },
1482
1488
  Notes => q{
1483
- 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>
1484
1490
  option is set. 2 or 3 values: 0. File type, 1. Attribute bits, 2. Windows
1485
1491
  attribute bits if Win32API::File is available
1486
1492
  },
@@ -1535,7 +1541,7 @@ my %systemTagsNotes = (
1535
1541
  FileUserID => {
1536
1542
  Groups => { 1 => 'System', 2 => 'Other' },
1537
1543
  Notes => q{
1538
- 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>
1539
1545
  option is set. Returns user ID number with the -n option, or name
1540
1546
  otherwise. May be written with either user name or number
1541
1547
  },
@@ -1549,7 +1555,7 @@ my %systemTagsNotes = (
1549
1555
  FileGroupID => {
1550
1556
  Groups => { 1 => 'System', 2 => 'Other' },
1551
1557
  Notes => q{
1552
- 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>
1553
1559
  option is set. Returns group ID number with the -n option, or name
1554
1560
  otherwise. May be written with either group name or number
1555
1561
  },
@@ -1749,6 +1755,11 @@ my %systemTagsNotes = (
1749
1755
  Notes => 'PDF-format embedded preview image',
1750
1756
  Binary => 1,
1751
1757
  },
1758
+ PreviewJXL => {
1759
+ Groups => { 2 => 'Preview' },
1760
+ Notes => 'JXL-format embedded preview image',
1761
+ Binary => 1,
1762
+ },
1752
1763
  ExifByteOrder => {
1753
1764
  Writable => 1,
1754
1765
  DelCheck => q{"Can't delete"},
@@ -1787,7 +1798,7 @@ my %systemTagsNotes = (
1787
1798
  Groups => { 0 => 'ExifTool', 1 => 'ExifTool', 2 => 'Other' },
1788
1799
  Notes => q{
1789
1800
  the clock time in seconds taken by ExifTool to extract information from this
1790
- 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>
1791
1802
  option is set. Requires Time::HiRes
1792
1803
  },
1793
1804
  PrintConv => 'sprintf("%.3g s", $val)',
@@ -1928,7 +1939,7 @@ my %systemTagsNotes = (
1928
1939
  Groups => { 0 => 'Trailer' },
1929
1940
  Notes => q{
1930
1941
  the full JPEG trailer data block. Extracted only if specifically requested
1931
- 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
1932
1943
  },
1933
1944
  Writable => 1,
1934
1945
  Protected => 1,
@@ -1957,6 +1968,83 @@ my %systemTagsNotes = (
1957
1968
  the this hash value and the hash type in the file.
1958
1969
  },
1959
1970
  },
1971
+ Geolocate => {
1972
+ Writable => 1,
1973
+ WriteOnly => 1,
1974
+ WriteNothing => 1,
1975
+ AllowGroup => '(exif|gps|xmp|xmp-exif|xmp-iptcext|xmp-iptccore|xmp-photoshop|iptc|quicktime|itemlist|keys|userdata)',
1976
+ Notes => q{
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
1983
+ },
1984
+ DelCheck => q{
1985
+ my @tags = $self->GetGeolocateTags($wantGroup);
1986
+ $self->SetNewValue($_) foreach @tags;
1987
+ return '';
1988
+ },
1989
+ ValueConvInv => q{
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)
2012
+ } else {
2013
+ next; # (shouldn't happen)
2014
+ }
2015
+ $self->SetNewValue($tag => $value, Type => 'PrintConv');
2016
+ }
2017
+ return '';
2018
+ },
2019
+ PrintConvInv => q{
2020
+ return $val unless $val =~ /^([-+]?\d.*?[NS]?), ?([-+]?\d.*?[EW]?)$/ or
2021
+ $val =~ /^\s*(-?\d+(?:\.\d+)?)\s*(-?\d+(?:\.\d+)?)\s*$/;
2022
+ my ($lat, $lon) = ($1, $2);
2023
+ require Image::ExifTool::GPS;
2024
+ $lat = Image::ExifTool::GPS::ToDegrees($lat, 1, "lat");
2025
+ $lon = Image::ExifTool::GPS::ToDegrees($lon, 1, "lon");
2026
+ return "$lat, $lon";
2027
+ },
2028
+ },
2029
+ GeolocationBearing => { %geoInfo,
2030
+ Notes => q{
2031
+ compass bearing to GeolocationCity center. Geolocation tags are
2032
+ generated only if API L<Geolocation|../ExifTool.html#Geolocation> option is set
2033
+ },
2034
+ },
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',
2045
+ PrintConv => '$val =~ s/ /, /; $val',
2046
+ },
2047
+ GeolocationWarning => { %geoInfo },
1960
2048
  );
1961
2049
 
1962
2050
  # tags defined by UserParam option (added at runtime)
@@ -2563,6 +2651,7 @@ sub ExtractInfo($;@)
2563
2651
  }
2564
2652
  # initialize ExifTool object members
2565
2653
  $self->Init();
2654
+ $$self{InExtract} = 1; # set flag indicating we are inside ExtractInfo
2566
2655
 
2567
2656
  delete $$self{MAKER_NOTE_FIXUP}; # fixup information for extracted maker notes
2568
2657
  delete $$self{MAKER_NOTE_BYTE_ORDER};
@@ -2738,8 +2827,9 @@ sub ExtractInfo($;@)
2738
2827
  if ($isDir or (defined $stat[2] and ($stat[2] & 0170000) == 0040000)) {
2739
2828
  $self->FoundTag('FileType', 'DIR');
2740
2829
  $self->FoundTag('FileTypeExtension', '');
2741
- $self->ExtractAltInfo();
2830
+ $self->DoneExtract();
2742
2831
  $raf->Close() if $raf;
2832
+ delete $$self{InExtract} unless $reEntry;
2743
2833
  return 1;
2744
2834
  }
2745
2835
  # get list of file types to check
@@ -2756,7 +2846,7 @@ sub ExtractInfo($;@)
2756
2846
  } else {
2757
2847
  $self->Error('Unknown file type');
2758
2848
  }
2759
- $self->ExtractAltInfo();
2849
+ $self->DoneExtract();
2760
2850
  last; # don't read the file
2761
2851
  }
2762
2852
  if (@fileTypeList) {
@@ -2924,7 +3014,7 @@ sub ExtractInfo($;@)
2924
3014
  }
2925
3015
  unless ($reEntry) {
2926
3016
  $$self{PATH} = [ ]; # reset PATH
2927
- $self->ExtractAltInfo();
3017
+ $self->DoneExtract();
2928
3018
  # do our HTML dump if requested
2929
3019
  if ($$self{HTML_DUMP}) {
2930
3020
  $raf->Seek(0, 2); # seek to end of file
@@ -2959,27 +3049,10 @@ sub ExtractInfo($;@)
2959
3049
  last; # (loop was a cheap "goto")
2960
3050
  }
2961
3051
 
2962
- # generate Validate tag if requested
2963
- if ($$options{Validate} and not $reEntry) {
2964
- Image::ExifTool::Validate::FinishValidate($self, $$req{validate});
2965
- }
2966
-
3052
+ # Note: This should be the only tag generated after BuildCompositeTags,
3053
+ # and as such it can't be used in user-defined Composite tags
2967
3054
  @startTime and $self->FoundTag('ProcessingTime', Time::HiRes::tv_interval(\@startTime));
2968
3055
 
2969
- # add user-defined parameters that ended with '!'
2970
- if (%{$$options{UserParam}}) {
2971
- my $doMsg = $$options{Verbose};
2972
- my $table = GetTagTable('Image::ExifTool::UserParam');
2973
- foreach (sort keys %{$$options{UserParam}}) {
2974
- next unless /#$/;
2975
- if ($doMsg) {
2976
- $self->VPrint(0, "UserParam tags:\n");
2977
- undef $doMsg;
2978
- }
2979
- $self->HandleTag($table, $_, $$options{UserParam}{$_});
2980
- }
2981
- }
2982
-
2983
3056
  # restore original options
2984
3057
  %saveOptions and $$self{OPTIONS} = \%saveOptions;
2985
3058
 
@@ -2987,14 +3060,8 @@ sub ExtractInfo($;@)
2987
3060
  # restore necessary members when exiting re-entrant code
2988
3061
  $$self{$_} = $$reEntry{$_} foreach keys %$reEntry;
2989
3062
  SetByteOrder($saveOrder);
2990
- } elsif ($$self{ImageDataHash}) {
2991
- my $digest = $$self{ImageDataHash}->hexdigest;
2992
- # (don't store empty digest)
2993
- $self->FoundTag(ImageDataHash => $digest) unless
2994
- $digest eq 'd41d8cd98f00b204e9800998ecf8427e' or
2995
- $digest eq 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' or
2996
- $digest eq 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e';
2997
3063
  }
3064
+ delete $$self{InExtract} unless $reEntry;
2998
3065
 
2999
3066
  # ($type may be undef without an Error when processing sub-documents)
3000
3067
  return 0 if not defined $type or exists $$self{VALUE}{Error};
@@ -3014,8 +3081,13 @@ sub GetInfo($;@)
3014
3081
  {
3015
3082
  local $_;
3016
3083
  my $self = shift;
3017
- my %saveOptions;
3084
+ my (%saveOptions, @saveMembers, @savedMembers);
3018
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
+ }
3019
3091
  unless (@_ and not defined $_[0]) {
3020
3092
  %saveOptions = %{$$self{OPTIONS}}; # save original options
3021
3093
  # must set FILENAME so it isn't parsed from the arguments
@@ -3098,8 +3170,9 @@ sub GetInfo($;@)
3098
3170
  @{$$self{IO_TAG_LIST}} = $self->GetTagList($rtnTags, $sort, $$self{OPTIONS}{Sort2});
3099
3171
  }
3100
3172
 
3101
- # restore original options
3173
+ # restore original options and member variables
3102
3174
  %saveOptions and $$self{OPTIONS} = \%saveOptions;
3175
+ @$self{@saveMembers} = @savedMembers if @saveMembers;
3103
3176
 
3104
3177
  return \%info;
3105
3178
  }
@@ -4164,17 +4237,145 @@ sub CombineInfo($;@)
4164
4237
  }
4165
4238
 
4166
4239
  #------------------------------------------------------------------------------
4167
- # Read metadata from alternate files and build composite tags
4240
+ # Finish generating tags after extracting information from a file
4168
4241
  # Inputs: 0) ExifTool ref
4169
- # Notes: This is called after reading the main file so the tags are available
4170
- # for being used in the file name, but before building Composite tags
4171
- # so tags from the alternate files may be used in the Composite tags
4172
- sub ExtractAltInfo($)
4242
+ # Notes: The sequencing here is a bit tricky because tags from the main file
4243
+ # may be used in the names of alternate files, so we finish generating
4244
+ # all main file tags first (including all Composite tags which don't
4245
+ # rely on alternate files) before extracting tags from alternate files,
4246
+ # then we finish by generating the remaingin Composite tags.
4247
+ sub DoneExtract($)
4173
4248
  {
4174
4249
  my $self = shift;
4175
4250
  # extract information from alternate files if necessary
4176
4251
  my ($g8, $altExifTool);
4177
4252
  my $opts = $$self{OPTIONS};
4253
+
4254
+ # generate ImageDataHash if requested
4255
+ if ($$self{ImageDataHash}) {
4256
+ my $digest = $$self{ImageDataHash}->hexdigest;
4257
+ # (don't store empty digest)
4258
+ $self->FoundTag(ImageDataHash => $digest) unless
4259
+ $digest eq 'd41d8cd98f00b204e9800998ecf8427e' or
4260
+ $digest eq 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' or
4261
+ $digest eq 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e';
4262
+ }
4263
+ # generate Validate tag if requested
4264
+ if ($$opts{Validate}) {
4265
+ Image::ExifTool::Validate::FinishValidate($self, $$self{REQ_TAG_LOOKUP}{validate});
4266
+ }
4267
+ # generate geolocation tags if requested
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');
4331
+ require Image::ExifTool::Geolocation;
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());
4363
+ }
4364
+ }
4365
+ }
4366
+ # generate tags for user-defined parameters that ended with '#'
4367
+ if (%{$$opts{UserParam}}) {
4368
+ my $doMsg = $$opts{Verbose};
4369
+ my $table = GetTagTable('Image::ExifTool::UserParam');
4370
+ foreach (sort keys %{$$opts{UserParam}}) {
4371
+ next unless /#$/;
4372
+ if ($doMsg) {
4373
+ $self->VPrint(0, "UserParam tags:\n");
4374
+ undef $doMsg;
4375
+ }
4376
+ $self->HandleTag($table, $_, $$opts{UserParam}{$_});
4377
+ }
4378
+ }
4178
4379
  if ($$opts{Composite} and (not $$opts{FastScan} or $$opts{FastScan} < 5)) {
4179
4380
  # build all composite tags except those requiring tags from alternate files
4180
4381
  $self->BuildCompositeTags();
@@ -4185,6 +4386,7 @@ sub ExtractAltInfo($)
4185
4386
  $$altExifTool{OPTIONS} = $$self{OPTIONS};
4186
4387
  $$altExifTool{GLOBAL_TIME_OFFSET} = $$self{GLOBAL_TIME_OFFSET};
4187
4388
  $$altExifTool{REQ_TAG_LOOKUP} = $$self{REQ_TAG_LOOKUP};
4389
+ $$altExifTool{ReqTagAlreadySet} = 1;
4188
4390
  my $fileName = $$altExifTool{ALT_FILE};
4189
4391
  # allow tags from the main file to be used in the alternate file names
4190
4392
  # (eg. -file1 '$originalfilename')
@@ -4554,7 +4756,7 @@ sub ParseArguments($;@)
4554
4756
  my (@exclude, $wasExcludeOpt);
4555
4757
 
4556
4758
  $$self{REQUESTED_TAGS} = [ ];
4557
- $$self{REQ_TAG_LOOKUP} = { };
4759
+ $$self{REQ_TAG_LOOKUP} = { } unless $$self{ReqTagAlreadySet};
4558
4760
  $$self{EXCL_TAG_LOOKUP} = { };
4559
4761
  $$self{IO_TAG_LIST} = undef;
4560
4762
  delete $$self{EXCL_XMP_LOOKUP};
@@ -5811,7 +6013,7 @@ sub Decode($$$;$$$)
5811
6013
  # Inputs: 0) ExifTool object ref, 1) string, 2) destination character set name,
5812
6014
  # 3) optional destination byte order (2-byte and 4-byte fixed-width sets only)
5813
6015
  # Returns: string in specified encoding
5814
- sub Encode($$$;$)
6016
+ sub Encode($$;$$)
5815
6017
  {
5816
6018
  my ($self, $val, $to, $toOrder) = @_;
5817
6019
  return $self->Decode($val, undef, undef, $to, $toOrder);
@@ -5892,8 +6094,8 @@ sub MakeTagName($)
5892
6094
  my $name = shift;
5893
6095
  $name =~ tr/-_a-zA-Z0-9//dc; # remove illegal characters
5894
6096
  $name = ucfirst $name; # capitalize first letter
5895
- $name = "Tag$name" if length($name) < 2 or $name =~ /^[-0-9]/;
5896
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]/;
5897
6099
  return $name;
5898
6100
  }
5899
6101
 
@@ -71,7 +71,7 @@ supported by ExifTool (r = read, w = write, c = create):
71
71
  3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
72
72
  7Z r | DV r | JPEG r/w | OFR r | RWZ r
73
73
  A r | DVB r/w | JSON r | OGG r | RM r
74
- AA r | DVR-MS r | JXL r | OGV r | SEQ r
74
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
75
75
  AAC r | DYLIB r | K25 r | ONP r | SKETCH r
76
76
  AAE r | EIP r | KDC r | OPUS r | SO r
77
77
  AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
@@ -592,9 +592,10 @@ Format for printing GPS coordinates. This is a printf format string with
592
592
  specifiers for degrees, minutes and seconds in that order, however minutes
593
593
  and seconds may be omitted. If the hemisphere is known, a reference
594
594
  direction (N, S, E or W) is appended to each printed coordinate, but adding
595
- a C<+> to the first format specifier (eg. C<%+.6f>) prints a signed
596
- coordinate instead. For example, the following table gives the output for
597
- the same coordinate using various formats:
595
+ a C<+> or C<-> to the first format specifier (eg. C<%+.6f> or C<%-.6f>)
596
+ prints a signed coordinate instead (C<+> also adds a leading plus sign to
597
+ positive coordinates, while C<-> does not). For example, the following
598
+ table gives the output for the same coordinate using various formats:
598
599
 
599
600
  CoordFormat Example Output
600
601
  ------------------- ------------------
@@ -714,6 +715,37 @@ value to be added to the maker notes base offset. It may also be set to the
714
715
  empty string ('') for ExifTool will take its best guess at the correct base,
715
716
  or undef (the default) for no base adjustment.
716
717
 
718
+ =item Geolocation
719
+
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.
738
+
739
+ =item GeolocMaxDist
740
+
741
+ Maximum distance in km to the geolocation city. The Geolocation tags are
742
+ not generated if the distance is greater than this. Default is undef.
743
+
744
+ =item GeolocMinPop
745
+
746
+ Minimum population for the Geolocation city. Cities smaller than this are
747
+ ignored. Default is undef.
748
+
717
749
  =item GeoMaxIntSecs
718
750
 
719
751
  Maximum interpolation time in seconds for geotagging. Geotagging is treated
@@ -2470,27 +2502,27 @@ MIE-Lens, MIE-Main, MIE-MakerNotes, MIE-Meta, MIE-Orient, MIE-Preview,
2470
2502
  MIE-Thumbnail, MIE-UTM, MIE-Unknown, MIE-Video, MIFF, MISB, MNG, MOBI, MOI,
2471
2503
  MPC, MPEG, MPF0, MPImage, MS-DOC, MXF, MacOS, MakerNotes, MakerUnknown,
2472
2504
  Matroska, MediaJukebox, Meta, MetaIFD, Microsoft, Minolta, MinoltaRaw,
2473
- Motorola, NITF, Nikon, NikonCapture, NikonCustom, NikonScan, NikonSettings,
2474
- NineEdits, Nintendo, Ocad, Ogg, Olympus, OpenEXR, Opus, PDF, PICT, PNG,
2475
- PNG-cICP, PNG-pHYs, PSP, Palm, Panasonic, PanasonicRaw, Parrot, Pentax,
2476
- PhaseOne, PhotoCD, PhotoMechanic, Photoshop, PictureInfo, PostScript,
2477
- PreviewIFD, PrintIM, ProfileIFD, Qualcomm, QuickTime, RAF, RAF2, RIFF,
2478
- RMETA, RSRC, RTF, Radiance, Rawzor, Real, Real-CONT, Real-MDPR, Real-PROP,
2479
- Real-RA3, Real-RA4, Real-RA5, Real-RJMD, Reconyx, Red, Ricoh, SPIFF, SR2,
2480
- SR2DataIFD, SR2SubIFD, SRF#, SVG, Samsung, Sanyo, Scalado, Sigma, SigmaRaw,
2481
- Sony, SonyIDC, Stim, SubIFD, System, Theora, Torrent, Track#, UserData,
2482
- VCalendar, VCard, VNote, Version0, Vorbis, WTV, XML, XMP, XMP-DICOM,
2483
- XMP-Device, XMP-GAudio, XMP-GCamera, XMP-GCreations, XMP-GDepth, XMP-GFocus,
2484
- XMP-GImage, XMP-GPano, XMP-GSpherical, XMP-LImage, XMP-MP, XMP-MP1,
2485
- XMP-PixelLive, XMP-aas, XMP-acdsee, XMP-album, XMP-apple-fi, XMP-ast,
2486
- XMP-aux, XMP-cc, XMP-cell, XMP-crd, XMP-creatorAtom, XMP-crs, XMP-dc,
2487
- XMP-dex, XMP-digiKam, XMP-drone-dji, XMP-dwc, XMP-et, XMP-exif, XMP-exifEX,
2488
- XMP-expressionmedia, XMP-extensis, XMP-fpv, XMP-getty, XMP-hdr, XMP-hdrgm,
2489
- XMP-ics, XMP-iptcCore, XMP-iptcExt, XMP-lr, XMP-mediapro, XMP-microsoft,
2490
- XMP-mwg-coll, XMP-mwg-kw, XMP-mwg-rs, XMP-nine, XMP-panorama, XMP-pdf,
2491
- XMP-pdfx, XMP-photomech, XMP-photoshop, XMP-plus, XMP-pmi, XMP-prism,
2492
- XMP-prl, XMP-prm, XMP-pur, XMP-rdf, XMP-sdc, XMP-swf, XMP-tiff, XMP-x,
2493
- XMP-xmp, XMP-xmpBJ, XMP-xmpDM, XMP-xmpDSA, XMP-xmpMM, XMP-xmpNote,
2505
+ Motorola, NITF, Nextbase, Nikon, NikonCapture, NikonCustom, NikonScan,
2506
+ NikonSettings, NineEdits, Nintendo, Ocad, Ogg, Olympus, OpenEXR, Opus, PDF,
2507
+ PICT, PNG, PNG-cICP, PNG-pHYs, PSP, Palm, Panasonic, PanasonicRaw, Parrot,
2508
+ Pentax, PhaseOne, PhotoCD, PhotoMechanic, Photoshop, PictureInfo,
2509
+ PostScript, PreviewIFD, PrintIM, ProfileIFD, Qualcomm, QuickTime, RAF, RAF2,
2510
+ RIFF, RMETA, RSRC, RTF, Radiance, Rawzor, Real, Real-CONT, Real-MDPR,
2511
+ Real-PROP, Real-RA3, Real-RA4, Real-RA5, Real-RJMD, Reconyx, Red, Ricoh,
2512
+ SPIFF, SR2, SR2DataIFD, SR2SubIFD, SRF#, SVG, Samsung, Sanyo, Scalado,
2513
+ Sigma, SigmaRaw, Sony, SonyIDC, Stim, SubIFD, System, Theora, Torrent,
2514
+ Track#, UserData, VCalendar, VCard, VNote, Version0, Vorbis, WTV, XML, XMP,
2515
+ XMP-DICOM, XMP-Device, XMP-GAudio, XMP-GCamera, XMP-GCreations, XMP-GDepth,
2516
+ XMP-GFocus, XMP-GImage, XMP-GPano, XMP-GSpherical, XMP-LImage, XMP-MP,
2517
+ XMP-MP1, XMP-PixelLive, XMP-aas, XMP-acdsee, XMP-album, XMP-apple-fi,
2518
+ XMP-ast, XMP-aux, XMP-cc, XMP-cell, XMP-crd, XMP-creatorAtom, XMP-crs,
2519
+ XMP-dc, XMP-dex, XMP-digiKam, XMP-drone-dji, XMP-dwc, XMP-et, XMP-exif,
2520
+ XMP-exifEX, XMP-expressionmedia, XMP-extensis, XMP-fpv, XMP-getty, XMP-hdr,
2521
+ XMP-hdrgm, XMP-ics, XMP-iptcCore, XMP-iptcExt, XMP-lr, XMP-mediapro,
2522
+ XMP-microsoft, XMP-mwg-coll, XMP-mwg-kw, XMP-mwg-rs, XMP-nine, XMP-panorama,
2523
+ XMP-pdf, XMP-pdfx, XMP-photomech, XMP-photoshop, XMP-plus, XMP-pmi,
2524
+ XMP-prism, XMP-prl, XMP-prm, XMP-pur, XMP-rdf, XMP-sdc, XMP-swf, XMP-tiff,
2525
+ XMP-x, XMP-xmp, XMP-xmpBJ, XMP-xmpDM, XMP-xmpDSA, XMP-xmpMM, XMP-xmpNote,
2494
2526
  XMP-xmpPLUS, XMP-xmpRights, XMP-xmpTPg, ZIP, iTunes
2495
2527
 
2496
2528
  =item Family 2 (Category):
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 12.76
3
+ Version: 12.80
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -28,7 +28,7 @@ supported by ExifTool (r = read, w = write, c = create):
28
28
  3GP r/w | DSS r | JP2 r/w | ODT r | RWL r/w
29
29
  7Z r | DV r | JPEG r/w | OFR r | RWZ r
30
30
  A r | DVB r/w | JSON r | OGG r | RM r
31
- AA r | DVR-MS r | JXL r | OGV r | SEQ r
31
+ AA r | DVR-MS r | JXL r/w | OGV r | SEQ r
32
32
  AAC r | DYLIB r | K25 r | ONP r | SKETCH r
33
33
  AAE r | EIP r | KDC r | OPUS r | SO r
34
34
  AAX r/w | EPS r/w | KEY r | ORF r/w | SR2 r/w
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExiftoolVendored
4
- VERSION = Gem::Version.new('12.76.1')
4
+ VERSION = Gem::Version.new('12.80.0')
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exiftool_vendored
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.76.1
4
+ version: 12.80.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McEachen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-02-07 00:00:00.000000000 Z
12
+ date: 2024-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: exiftool
@@ -156,7 +156,27 @@ files:
156
156
  - bin/lib/Image/ExifTool/GIF.pm
157
157
  - bin/lib/Image/ExifTool/GIMP.pm
158
158
  - bin/lib/Image/ExifTool/GPS.pm
159
+ - bin/lib/Image/ExifTool/GeoLang/cs.pm
160
+ - bin/lib/Image/ExifTool/GeoLang/de.pm
161
+ - bin/lib/Image/ExifTool/GeoLang/en_ca.pm
162
+ - bin/lib/Image/ExifTool/GeoLang/en_gb.pm
163
+ - bin/lib/Image/ExifTool/GeoLang/es.pm
164
+ - bin/lib/Image/ExifTool/GeoLang/fi.pm
165
+ - bin/lib/Image/ExifTool/GeoLang/fr.pm
166
+ - bin/lib/Image/ExifTool/GeoLang/it.pm
167
+ - bin/lib/Image/ExifTool/GeoLang/ja.pm
168
+ - bin/lib/Image/ExifTool/GeoLang/ko.pm
169
+ - bin/lib/Image/ExifTool/GeoLang/nl.pm
170
+ - bin/lib/Image/ExifTool/GeoLang/pl.pm
171
+ - bin/lib/Image/ExifTool/GeoLang/ru.pm
172
+ - bin/lib/Image/ExifTool/GeoLang/sk.pm
173
+ - bin/lib/Image/ExifTool/GeoLang/sv.pm
174
+ - bin/lib/Image/ExifTool/GeoLang/tr.pm
175
+ - bin/lib/Image/ExifTool/GeoLang/zh_cn.pm
176
+ - bin/lib/Image/ExifTool/GeoLang/zh_tw.pm
159
177
  - bin/lib/Image/ExifTool/GeoTiff.pm
178
+ - bin/lib/Image/ExifTool/Geolocation.dat
179
+ - bin/lib/Image/ExifTool/Geolocation.pm
160
180
  - bin/lib/Image/ExifTool/Geotag.pm
161
181
  - bin/lib/Image/ExifTool/GoPro.pm
162
182
  - bin/lib/Image/ExifTool/H264.pm