exiftool_vendored 12.80.0 → 12.82.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -785,6 +785,7 @@ sub WriteQuickTime($$$)
785
785
  $et or return 1; # allow dummy access to autoload this package
786
786
  my ($mdat, @mdat, @mdatEdit, $edit, $track, $outBuff, $co, $term, $delCount);
787
787
  my (%langTags, $canCreate, $delGrp, %boxPos, %didDir, $writeLast, $err, $atomCount);
788
+ my ($tag, $lastTag, $errStr);
788
789
  my $outfile = $$dirInfo{OutFile} || return 0;
789
790
  my $raf = $$dirInfo{RAF}; # (will be null for lower-level atoms)
790
791
  my $dataPt = $$dirInfo{DataPt}; # (will be null for top-level atoms)
@@ -857,7 +858,10 @@ sub WriteQuickTime($$$)
857
858
  }
858
859
  $atomCount = $$tagTablePtr{VARS}{ATOM_COUNT} if $$tagTablePtr{VARS};
859
860
 
861
+ $tag = $lastTag = '';
862
+
860
863
  for (;;) { # loop through all atoms at this level
864
+ $lastTag = $tag if $$tagTablePtr{$tag}; # keep track of last known tag
861
865
  if (defined $atomCount and --$atomCount < 0 and $dataPt) {
862
866
  # stop processing now and just copy the rest of the atom
863
867
  Write($outfile, substr($$dataPt, $raf->Tell())) or $rtnVal=$rtnErr, $err=1;
@@ -876,15 +880,15 @@ sub WriteQuickTime($$$)
876
880
  last;
877
881
  }
878
882
  my $size = Get32u(\$hdr, 0) - 8; # (atom size without 8-byte header)
879
- my $tag = substr($hdr, 4, 4);
883
+ $tag = substr($hdr, 4, 4);
880
884
  if ($size == -7) {
881
885
  # read the extended size
882
- $raf->Read($buff, 8) == 8 or $et->Error('Truncated extended atom'), last;
886
+ $raf->Read($buff, 8) == 8 or $errStr = 'Truncated extended atom', last;
883
887
  $hdr .= $buff;
884
888
  my ($hi, $lo) = unpack('NN', $buff);
885
889
  if ($hi or $lo > 0x7fffffff) {
886
890
  if ($hi > 0x7fffffff) {
887
- $et->Error('Invalid atom size');
891
+ $errStr = 'Invalid atom size';
888
892
  last;
889
893
  } elsif (not $et->Options('LargeFileSupport')) {
890
894
  $et->Error('End of processing at large atom (LargeFileSupport not enabled)');
@@ -892,7 +896,7 @@ sub WriteQuickTime($$$)
892
896
  }
893
897
  }
894
898
  $size = $hi * 4294967296 + $lo - 16;
895
- $size < 0 and $et->Error('Invalid extended atom size'), last;
899
+ $size < 0 and $errStr = 'Invalid extended atom size', last;
896
900
  } elsif ($size == -8) {
897
901
  if ($dataPt) {
898
902
  last if $$dirInfo{DirName} eq 'CanonCNTH'; # (this is normal for Canon CNTH atom)
@@ -908,7 +912,7 @@ sub WriteQuickTime($$$)
908
912
  }
909
913
  last;
910
914
  } elsif ($size < 0) {
911
- $et->Error('Invalid atom size');
915
+ $errStr = 'Invalid atom size';
912
916
  last;
913
917
  }
914
918
 
@@ -952,11 +956,11 @@ sub WriteQuickTime($$$)
952
956
  $tag = PrintableTagID($tag,3);
953
957
  if ($size > $maxReadLen and $got == 0x10000) {
954
958
  my $mb = int($size / 0x100000 + 0.5);
955
- $et->Error("'${tag}' atom is too large for rewriting ($mb MB)");
959
+ $errStr = "'${tag}' atom is too large for rewriting ($mb MB)";
956
960
  } else {
957
- $et->Error("Truncated '${tag}' atom");
961
+ $errStr = "Truncated '${tag}' atom";
958
962
  }
959
- return $rtnVal;
963
+ last;
960
964
  }
961
965
  }
962
966
  # save the handler type for this track
@@ -1446,6 +1450,24 @@ sub WriteQuickTime($$$)
1446
1450
  Write($outfile, $hdr, $buff) or $rtnVal=$rtnErr, $err=1, last;
1447
1451
  }
1448
1452
  }
1453
+ # ($errStr is set if there was an error that could possibly be due to an unknown trailer)
1454
+ if ($errStr) {
1455
+ if (($lastTag eq 'mdat' or $lastTag eq 'moov') and not $dataPt and (not $$tagTablePtr{$tag} or
1456
+ ref $$tagTablePtr{$tag} eq 'HASH' and $$tagTablePtr{$tag}{Unknown}))
1457
+ {
1458
+ my $nvTrail = $et->GetNewValueHash($Image::ExifTool::Extra{Trailer});
1459
+ if ($$et{DEL_GROUP}{Trailer} or ($nvTrail and not ($$nvTrail{Value} and $$nvTrail{Value}[0]))) {
1460
+ $errStr =~ s/ is too large.*//;
1461
+ $et->Warn('Deleted unknown trailer with ' . lcfirst($errStr));
1462
+ } else {
1463
+ $et->Warn('Unknown trailer with ' . lcfirst($errStr));
1464
+ $et->Error('Use "-trailer=" to delete unknown trailer');
1465
+ }
1466
+ } else {
1467
+ $et->Error($errStr);
1468
+ return $dataPt ? undef : 1;
1469
+ }
1470
+ }
1449
1471
  $et->VPrint(0, " [deleting $delCount $dirName tag".($delCount==1 ? '' : 's')."]\n") if $delCount;
1450
1472
 
1451
1473
  $createKeys &= ~0x01 unless $$addDirs{Keys}; # (Keys may have been written)
@@ -1297,6 +1297,7 @@ sub SetNewValuesFromFile($$;@)
1297
1297
  Filter => $$options{Filter},
1298
1298
  FixBase => $$options{FixBase},
1299
1299
  Geolocation => $$options{Geolocation},
1300
+ GeolocAltNames => $$options{GeolocAltNames},
1300
1301
  GeolocFeature => $$options{GeolocFeature},
1301
1302
  GeolocMinPop => $$options{GeolocMinPop},
1302
1303
  GeolocMaxDist => $$options{GeolocMaxDist},
@@ -1336,6 +1337,11 @@ sub SetNewValuesFromFile($$;@)
1336
1337
  XAttrTags => $$options{XAttrTags},
1337
1338
  XMPAutoConv => $$options{XMPAutoConv},
1338
1339
  );
1340
+ # reset Geolocation option if we aren't copying any geolocation tags
1341
+ if ($$options{Geolocation} and not grep /\bGeolocation/i, @setTags) {
1342
+ $self->VPrint(0, '(resetting unnecessary Geolocation option)');
1343
+ $$srcExifTool{OPTIONS}{Geolocation} = undef;
1344
+ }
1339
1345
  $$srcExifTool{GLOBAL_TIME_OFFSET} = $$self{GLOBAL_TIME_OFFSET};
1340
1346
  $$srcExifTool{ALT_EXIFTOOL} = $$self{ALT_EXIFTOOL};
1341
1347
  foreach $tag (@setTags) {
@@ -3161,8 +3167,8 @@ sub PushValue($$$;$)
3161
3167
  # Inputs: 0) ExifTool object ref, 1) string with embedded tag names,
3162
3168
  # 2) reference to list of found tags or undef to use FOUND_TAGS, 3) Options:
3163
3169
  # undef - set missing tags to ''
3164
- # 'Error' - issue minor error on missing tag (and return undef)
3165
- # 'Warn' - issue minor warning on missing tag (and return undef)
3170
+ # 'Error' - issue minor error on missing tag (and return undef if error sent)
3171
+ # 'Warn' - issue minor warning on missing tag (and return undef if warning sent)
3166
3172
  # 'Silent' - just return undef on missing tag (no errors/warnings)
3167
3173
  # Hash ref - defined to interpolate as variables in string instead of values
3168
3174
  # --> receives tag/value pairs for interpolation of the variables
@@ -3806,7 +3812,7 @@ sub GetGeolocateTags($$;$)
3806
3812
  'iptc' => [ qw(City Province-State Country-PrimaryLocationCode Country-PrimaryLocationName) ],
3807
3813
  'gps' => [ qw(GPSLatitude GPSLongitude GPSLatitudeRef GPSLongitudeRef) ],
3808
3814
  'xmp-exif' => [ qw(GPSLatitude GPSLongitude) ],
3809
- 'keys' => [ 'GPSCoordinates' ],
3815
+ 'keys' => [ 'GPSCoordinates', 'LocationName' ],
3810
3816
  'itemlist' => [ 'GPSCoordinates' ],
3811
3817
  'userdata' => [ 'GPSCoordinates' ],
3812
3818
  # more general groups not in this lookup: XMP and QuickTime
@@ -3818,7 +3824,7 @@ sub GetGeolocateTags($$;$)
3818
3824
  }
3819
3825
  # set default XMP City tags if necessary
3820
3826
  if (not $writeGPS and ($grps{xmp} or (not @tags and not $grps{quicktime}))) {
3821
- push @tags, qw(XMP:City XMP:State XMP:CountryCode XMP:Country);
3827
+ push @tags, qw(XMP:City XMP:State XMP:CountryCode XMP:Country Keys:LocationName);
3822
3828
  }
3823
3829
  $writeGPS = 1 unless defined $writeGPS; # (delete both City and GPS)
3824
3830
  # set default QuickTime tag if necessary
@@ -50,7 +50,7 @@ use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
  require Exporter;
52
52
 
53
- $VERSION = '3.64';
53
+ $VERSION = '3.65';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -283,11 +283,12 @@ my %recognizedAttrs = (
283
283
  # NOTE: this lookup is duplicated in TagLookup.pm!!
284
284
  %specialStruct = (
285
285
  STRUCT_NAME => 1, # [optional] name of structure
286
- NAMESPACE => 1, # [mandatory] namespace prefix used for fields of this structure
286
+ NAMESPACE => 1, # [mandatory for XMP] namespace prefix used for fields of this structure
287
287
  NOTES => 1, # [optional] notes for documentation about this structure
288
288
  TYPE => 1, # [optional] rdf:type resource for struct (if used, the StructType flag
289
289
  # will be set automatically for all derived flattened tags when writing)
290
290
  GROUPS => 1, # [optional] specifies family group 2 name for the structure
291
+ SORT_ORDER => 1, # [optional] order for sorting fields in documentation
291
292
  );
292
293
  # XMP structures (each structure is similar to a tag table so we can
293
294
  # recurse through them in SetPropertyPath() as if they were tag tables)
@@ -2587,6 +2588,7 @@ my %sPantryItem = (
2587
2588
  EnhanceDenoiseAlreadyApplied => { Writable => 'boolean' }, #forum14760
2588
2589
  EnhanceDenoiseVersion => { }, #forum14760 integer?
2589
2590
  EnhanceDenoiseLumaAmount => { }, #forum14760 integer?
2591
+ # FujiRatingAlreadyApplied - boolean written by LR classic 13.2 (forum15815)
2590
2592
  );
2591
2593
 
2592
2594
  # IPTC Core namespace properties (Iptc4xmpCore) (ref 4)
@@ -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.80';
32
+ $VERSION = '12.82';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -921,7 +921,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
921
921
  DICOM=> '(.{128}DICM|\0[\x02\x04\x06\x08]\0[\0-\x20]|[\x02\x04\x06\x08]\0[\0-\x20]\0)',
922
922
  DOCX => 'PK\x03\x04',
923
923
  DPX => '(SDPX|XPDS)',
924
- DR4 => 'IIII\x04\0\x04\0',
924
+ DR4 => 'IIII[\x04|\x05]\0\x04\0',
925
925
  DSS => '(\x02dss|\x03ds2)',
926
926
  DV => '\x1f\x07\0[\x3f\xbf]', # (not tested if extension recognized)
927
927
  DWF => '\(DWF V\d',
@@ -1103,6 +1103,7 @@ my @availableOptions = (
1103
1103
  [ 'FilterW', undef, 'input filter when writing tag values' ],
1104
1104
  [ 'FixBase', undef, 'fix maker notes base offsets' ],
1105
1105
  [ 'Geolocation', undef, 'generate geolocation tags' ],
1106
+ [ 'GeolocAltNames', 1, 'search alternate city names if available' ],
1106
1107
  [ 'GeolocFeature', undef, 'regular expression of geolocation features to match' ],
1107
1108
  [ 'GeolocMinPop', undef, 'minimum geolocation population' ],
1108
1109
  [ 'GeolocMaxDist', undef, 'maximum geolocation distance' ],
@@ -1136,6 +1137,7 @@ my @availableOptions = (
1136
1137
  [ 'NoPDFList', undef, 'flag to avoid splitting PDF List-type tag values' ],
1137
1138
  [ 'NoWarning', undef, 'regular expression for warnings to suppress' ],
1138
1139
  [ 'Password', undef, 'password for password-protected PDF documents' ],
1140
+ [ 'PrintCSV', undef, 'flag to print CSV directly (selected metadata types only)' ],
1139
1141
  [ 'PrintConv', 1, 'flag to enable print conversion' ],
1140
1142
  [ 'QuickTimeHandler', 1, 'flag to add mdir Handler to newly created Meta box' ],
1141
1143
  [ 'QuickTimePad', undef, 'flag to preserve padding of QuickTime CR3 tags' ],
@@ -1691,7 +1693,7 @@ my %systemTagsNotes = (
1691
1693
  Flags => ['Writable' ,'Protected', 'Binary'],
1692
1694
  Permanent => 0, # (this is 1 by default for MakerNotes tags)
1693
1695
  WriteCheck => q{
1694
- return undef if $val =~ /^IIII\x04\0\x04\0/;
1696
+ return undef if $val =~ /^IIII[\x04|\x05]\0\x04\0/;
1695
1697
  return 'Invalid CanonDR4 data';
1696
1698
  },
1697
1699
  },
@@ -1988,27 +1990,34 @@ my %systemTagsNotes = (
1988
1990
  },
1989
1991
  ValueConvInv => q{
1990
1992
  require Image::ExifTool::Geolocation;
1991
- return $val if lc($val) eq 'geotag';
1993
+ # write this tag later if geotagging
1994
+ return $val if $val =~ /\bgeotag\b/i;
1995
+ $val .= ',both';
1992
1996
  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
+ my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($self->Encode($val,'UTF8'), $opts);
1998
+ return '' unless $n;
1999
+ if ($n > 1 and $self->Warn('Multiple matching cities found',2)) {
1997
2000
  warn "$$self{VALUE}{Warning}\n";
1998
2001
  return '';
1999
2002
  }
2000
- my @tags = $self->GetGeolocateTags($wantGroup, defined $$geo[10] ? 0 : 1);
2003
+ my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
2004
+ my @tags = $self->GetGeolocateTags($wantGroup, $km ? 0 : 1);
2001
2005
  my %geoNum = ( City => 0, Province => 1, State => 1, Code => 3, Country => 4,
2002
2006
  Coordinates => 89, Latitude => 8, Longitude => 9 );
2003
2007
  my ($tag, $value);
2004
2008
  foreach $tag (@tags) {
2005
2009
  if ($tag =~ /GPS(Coordinates|Latitude|Longitude)?/) {
2006
- $value = $geoNum{$1} == 89 ? "$$geo[8],$$geo[9]" : $$geo[$geoNum{$1}];
2010
+ $value = $geoNum{$1} == 89 ? "$geo[8],$geo[9]" : $geo[$geoNum{$1}];
2007
2011
  } elsif ($tag =~ /(Code)/ or $tag =~ /(City|Province|State|Country)/) {
2008
- $value = $$geo[$geoNum{$1}];
2012
+ $value = $geo[$geoNum{$1}];
2009
2013
  next unless defined $value;
2010
2014
  $value = $self->Decode($value,'UTF8');
2011
2015
  $value .= ' ' if $tag eq 'iptc:Country-PrimaryLocationCode'; # (IPTC requires 3-char code)
2016
+ } elsif ($tag =~ /LocationName/) {
2017
+ $value = $geo[0] or next;
2018
+ $value .= ', ' . $geo[1] if $geo[1];
2019
+ $value .= ', ' . $geo[4] if $geo[4];
2020
+ $value = $self->Decode($value, 'UTF8');
2012
2021
  } else {
2013
2022
  next; # (shouldn't happen)
2014
2023
  }
@@ -2017,16 +2026,18 @@ my %systemTagsNotes = (
2017
2026
  return '';
2018
2027
  },
2019
2028
  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";
2029
+ my @args = split /\s*,\s*/, $val;
2030
+ my $lat = 1;
2031
+ foreach (@args) {
2032
+ next unless /^[-+]?\d/;
2033
+ require Image::ExifTool::GPS;
2034
+ $_ = Image::ExifTool::GPS::ToDegrees($_, 1, $lat ? 'lat' : 'lon');
2035
+ $lat ^= 1;
2036
+ }
2037
+ return join(',', @args);
2027
2038
  },
2028
- },
2029
- GeolocationBearing => { %geoInfo,
2039
+ },
2040
+ GeolocationBearing => { %geoInfo,
2030
2041
  Notes => q{
2031
2042
  compass bearing to GeolocationCity center. Geolocation tags are
2032
2043
  generated only if API L<Geolocation|../ExifTool.html#Geolocation> option is set
@@ -2640,7 +2651,6 @@ sub ExtractInfo($;@)
2640
2651
  $self->Options(Duplicates => 1) if $$options{HtmlDump};
2641
2652
  # enable Validate option if Validate tag is requested
2642
2653
  $self->Options(Validate => 1) if $$req{validate};
2643
-
2644
2654
  if (defined $_[0]) {
2645
2655
  # only initialize filename if called with arguments
2646
2656
  $$self{FILENAME} = undef; # name of file (or '' if we didn't open it)
@@ -2649,6 +2659,11 @@ sub ExtractInfo($;@)
2649
2659
  $self->ParseArguments(@_); # initialize from our arguments
2650
2660
  }
2651
2661
  }
2662
+ # ignore all tags and set ExtractEmbedded if outputting CSV directly
2663
+ if ($self->Options('PrintCSV')) {
2664
+ $$self{OPTIONS}{IgnoreTags} = { all => 1 };
2665
+ $self->Options(ExtractEmbedded => 1);
2666
+ }
2652
2667
  # initialize ExifTool object members
2653
2668
  $self->Init();
2654
2669
  $$self{InExtract} = 1; # set flag indicating we are inside ExtractInfo
@@ -2829,6 +2844,7 @@ sub ExtractInfo($;@)
2829
2844
  $self->FoundTag('FileTypeExtension', '');
2830
2845
  $self->DoneExtract();
2831
2846
  $raf->Close() if $raf;
2847
+ %saveOptions and $$self{OPTIONS} = \%saveOptions;
2832
2848
  delete $$self{InExtract} unless $reEntry;
2833
2849
  return 1;
2834
2850
  }
@@ -3060,8 +3076,14 @@ sub ExtractInfo($;@)
3060
3076
  # restore necessary members when exiting re-entrant code
3061
3077
  $$self{$_} = $$reEntry{$_} foreach keys %$reEntry;
3062
3078
  SetByteOrder($saveOrder);
3079
+ } else {
3080
+ # call cleanup routines if necessary
3081
+ if ($$self{Cleanup}) {
3082
+ &$_($self) foreach @{$$self{Cleanup}};
3083
+ delete $$self{Cleanup};
3084
+ }
3085
+ delete $$self{InExtract};
3063
3086
  }
3064
- delete $$self{InExtract} unless $reEntry;
3065
3087
 
3066
3088
  # ($type may be undef without an Error when processing sub-documents)
3067
3089
  return 0 if not defined $type or exists $$self{VALUE}{Error};
@@ -4338,25 +4360,27 @@ sub DoneExtract($)
4338
4360
  }
4339
4361
  local $SIG{'__WARN__'} = \&SetWarning;
4340
4362
  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];
4363
+ $$opts{GeolocMulti} = $$opts{Duplicates};
4364
+ my ($n, $i, $km, $be) = Image::ExifTool::Geolocation::Geolocate($arg, $opts);
4365
+ delete $$opts{GeolocMulti};
4366
+ # ($i will be an ARRAY ref if multiple matches were found and the Duplicates option is set)
4367
+ if ($n and (ref $i or $n < 2 or not $self->Warn('Multiple Geolocation cities are possible',2))) {
4368
+ my $list = ref $i ? $i : [ $i ]; # make a list if not done alreaday
4369
+ foreach $i (@$list) {
4370
+ my @geo = Image::ExifTool::Geolocation::GetEntry($i, $$opts{Lang});
4371
+ $self->FoundTag(GeolocationCity => $geo[0]);
4372
+ $self->FoundTag(GeolocationRegion => $geo[1]) if $geo[1];
4373
+ $self->FoundTag(GeolocationSubregion => $geo[2]) if $geo[2];
4374
+ $self->FoundTag(GeolocationCountryCode => $geo[3]);
4375
+ $self->FoundTag(GeolocationCountry => $geo[4]) if $geo[4];
4376
+ $self->FoundTag(GeolocationTimeZone => $geo[5]) if $geo[5];
4377
+ $self->FoundTag(GeolocationFeatureCode => $geo[6]);
4378
+ $self->FoundTag(GeolocationPopulation => $geo[7]);
4379
+ $self->FoundTag(GeolocationPosition => "$geo[8] $geo[9]");
4380
+ next if $i != $$list[0];
4381
+ $self->FoundTag(GeolocationDistance => $km) if defined $km;
4382
+ $self->FoundTag(GeolocationBearing => $be) if defined $be;
4383
+ $self->FoundTag(GeolocationWarning => "Search matched $n cities") if $n > 1;
4360
4384
  }
4361
4385
  } elsif ($evalWarning) {
4362
4386
  $self->Warn(CleanWarning());
@@ -5040,6 +5064,7 @@ sub SetFoundTags($)
5040
5064
  $allTag = 1;
5041
5065
  } elsif ($tag =~ /[*?]/) {
5042
5066
  # allow wildcards in tag names
5067
+ $tag =~ tr/-_A-Za-z0-9*?//dc; # sterilize
5043
5068
  $tag =~ s/\*/[-\\w]*/g;
5044
5069
  $tag =~ s/\?/[-\\w]/g;
5045
5070
  $tag .= '( \\(.*)?' if $doDups or $allGrp;
@@ -5047,6 +5072,7 @@ sub SetFoundTags($)
5047
5072
  next unless @matches; # don't want entry in list for wildcard tags
5048
5073
  $allTag = 1;
5049
5074
  } elsif ($doDups or defined $group) {
5075
+ $tag =~ tr/-_A-Za-z0-9//dc; # sterilize
5050
5076
  # must also look for tags like "Tag (1)"
5051
5077
  # (but be sure not to match temporary ValueConv entries like "Tag #")
5052
5078
  @matches = grep(/^$tag( \(|$)/i, keys %$tagHash);
@@ -5259,6 +5285,16 @@ sub AUTOLOAD
5259
5285
  return DoAutoLoad($AUTOLOAD, @_);
5260
5286
  }
5261
5287
 
5288
+ #------------------------------------------------------------------------------
5289
+ # Add cleanup routine to call before returning from Extract
5290
+ # Inputs: 0) ExifTool ref, 1) code ref to routine with ExifTool ref as an argument
5291
+ sub AddCleanup($)
5292
+ {
5293
+ my ($self, $sub) = @_;
5294
+ $$self{Cleanup} or $$self{Cleanup} = [ ];
5295
+ push @{$$self{Cleanup}}, $sub;
5296
+ }
5297
+
5262
5298
  #------------------------------------------------------------------------------
5263
5299
  # Add warning tag
5264
5300
  # Inputs: 0) ExifTool object reference, 1) warning message
@@ -728,6 +728,12 @@ to use for the geolocation input. May also include regular expressions for
728
728
  more flexible matching. See L<https://exiftool.org/geolocation.html> for
729
729
  more details. Default is undef.
730
730
 
731
+ =item GeolocAltNames
732
+
733
+ Flag to search alternate Geolocation city names if available (ie. if
734
+ $Image::ExifTool::Geolocation::altDir has been set). Set to 0 to disable
735
+ use of the alternate names. Default is 1.
736
+
731
737
  =item GeolocFeature
732
738
 
733
739
  Comma-separated list of feature codes to include in city search, or exclude
@@ -948,6 +954,14 @@ by the value of the Charset option at processing time. Default is undef.
948
954
  Flag to enable automatic print conversion. Also enables inverse
949
955
  print conversion for writing. Default is 1.
950
956
 
957
+ =item PrintCSV
958
+
959
+ Flag to directly print CSV-format output rather than extracting tags
960
+ normally. Currently this feature applies only to GM PDR data (see
961
+ L<Image::ExifTool::TagNames/GM Tags>). Setting this option automatically
962
+ sets L</IgnoreTags> to "all", and L</ExtractEmbedded> to 1. Default is
963
+ undef.
964
+
951
965
  =item QuickTimeHandler
952
966
 
953
967
  Flag set to add an 'mdir' Handler to a newly created Meta box when adding
@@ -998,8 +1012,7 @@ the list. Default is undef.
998
1012
 
999
1013
  Flag to save EXIF/TIFF format type as the family 6 group name when
1000
1014
  extracting information. Without this option set, the family 6 group names
1001
- are not generated. Default is undef. See the L</GetGroup> option for more
1002
- details.
1015
+ are not generated. Default is undef. See L</GetGroup> for more details.
1003
1016
 
1004
1017
  =item SavePath
1005
1018
 
@@ -2473,14 +2486,14 @@ Here is a complete list of groups for each of these families:
2473
2486
  AAC, AFCP, AIFF, APE, APP0, APP1, APP11, APP12, APP13, APP14, APP15, APP2,
2474
2487
  APP3, APP4, APP5, APP6, APP7, APP8, APP9, ASF, Audible, Canon, CanonVRD,
2475
2488
  Composite, DICOM, DNG, DV, DjVu, Ducky, EXE, EXIF, ExifTool, FITS, FLAC,
2476
- FLIR, File, Flash, FlashPix, Font, FotoStation, GIF, GIMP, GeoTiff, GoPro,
2477
- H264, HTML, ICC_Profile, ID3, IPTC, ISO, ITC, JFIF, JPEG, JSON, JUMBF,
2478
- Jpeg2000, LNK, Leaf, Lytro, M2TS, MIE, MIFF, MISB, MNG, MOI, MPC, MPEG, MPF,
2479
- MXF, MakerNotes, Matroska, Meta, Ogg, OpenEXR, Opus, PDF, PICT, PLIST, PNG,
2480
- PSP, Palm, PanasonicRaw, Parrot, PhotoCD, PhotoMechanic, Photoshop,
2481
- PostScript, PrintIM, QuickTime, RAF, RIFF, RSRC, RTF, Radiance, Rawzor,
2482
- Real, Red, SVG, SigmaRaw, Sony, Stim, Theora, Torrent, Trailer, VCard,
2483
- Vorbis, WTV, XML, XMP, ZIP
2489
+ FLIR, File, Flash, FlashPix, Font, FotoStation, GIF, GIMP, GM, GeoTiff,
2490
+ GoPro, H264, HTML, ICC_Profile, ID3, IPTC, ISO, ITC, JFIF, JPEG, JSON,
2491
+ JUMBF, Jpeg2000, LNK, Leaf, Lytro, M2TS, MIE, MIFF, MISB, MNG, MOI, MPC,
2492
+ MPEG, MPF, MXF, MakerNotes, Matroska, Meta, Ogg, OpenEXR, Opus, PDF, PICT,
2493
+ PLIST, PNG, PSP, Palm, PanasonicRaw, Parrot, PhotoCD, PhotoMechanic,
2494
+ Photoshop, PostScript, PrintIM, QuickTime, RAF, RIFF, RSRC, RTF, Radiance,
2495
+ Rawzor, Real, Red, SVG, SigmaRaw, Sony, Stim, Theora, Torrent, Trailer,
2496
+ VCard, Vorbis, WTV, XML, XMP, ZIP
2484
2497
 
2485
2498
  =item Family 1 (Specific Location):
2486
2499
 
@@ -2488,7 +2501,7 @@ AAC, AC3, AFCP, AIFF, APE, ASF, AVI1, Adobe, AdobeCM, AdobeDNG, Apple,
2488
2501
  Audible, CBOR, CIFF, CameraIFD, Canon, CanonCustom, CanonDR4, CanonRaw,
2489
2502
  CanonVRD, Casio, Chapter#, Composite, DICOM, DJI, DNG, DV, DjVu, DjVu-Meta,
2490
2503
  Ducky, EPPIM, EXE, EXIF, ExifIFD, ExifTool, FITS, FLAC, FLIR, File, Flash,
2491
- FlashPix, Font, FotoStation, FujiFilm, FujiIFD, GE, GIF, GIMP, GPS,
2504
+ FlashPix, Font, FotoStation, FujiFilm, FujiIFD, GE, GIF, GIMP, GM, GPS,
2492
2505
  GSpherical, Garmin, GeoTiff, GlobParamIFD, GoPro, GraphConv, H264, HP, HTC,
2493
2506
  HTML, HTML-dc, HTML-ncc, HTML-office, HTML-prod, HTML-vw96, HTTP-equiv,
2494
2507
  ICC-chrm, ICC-clrt, ICC-header, ICC-meas, ICC-meta, ICC-view, ICC_Profile,
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 12.80
3
+ Version: 12.82
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExiftoolVendored
4
- VERSION = Gem::Version.new('12.80.0')
4
+ VERSION = Gem::Version.new('12.82.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.80.0
4
+ version: 12.82.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-03-21 00:00:00.000000000 Z
12
+ date: 2024-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: exiftool
@@ -155,6 +155,7 @@ files:
155
155
  - bin/lib/Image/ExifTool/GE.pm
156
156
  - bin/lib/Image/ExifTool/GIF.pm
157
157
  - bin/lib/Image/ExifTool/GIMP.pm
158
+ - bin/lib/Image/ExifTool/GM.pm
158
159
  - bin/lib/Image/ExifTool/GPS.pm
159
160
  - bin/lib/Image/ExifTool/GeoLang/cs.pm
160
161
  - bin/lib/Image/ExifTool/GeoLang/de.pm