exiftool_vendored 13.55.0 → 13.57.1

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.
@@ -36,7 +36,7 @@ use vars qw($VERSION);
36
36
  use Image::ExifTool qw(:Public);
37
37
  use Image::ExifTool::GPS;
38
38
 
39
- $VERSION = '1.87';
39
+ $VERSION = '1.88';
40
40
 
41
41
  sub JITTER() { return 2 } # maximum time jitter
42
42
 
@@ -103,12 +103,31 @@ my %fixInfoKeys = (
103
103
 
104
104
  # category for select keys
105
105
  my %keyCategory = (
106
- dir => 'orient',
106
+ track => 'track',
107
+ speed => 'track',
108
+ alt => 'alt',
109
+ dir => 'orient',
107
110
  pitch => 'orient',
108
- roll => 'orient',
109
- hdop => 'dop',
110
- pdop => 'dop',
111
- vdop => 'dop',
111
+ roll => 'orient',
112
+ hdop => 'dop',
113
+ pdop => 'dop',
114
+ vdop => 'dop',
115
+ );
116
+
117
+ # list of tags used when geotagging from image/video files,
118
+ # and the corresponding fix information key
119
+ my %tagKey = (
120
+ GPSDateTime => 'time',
121
+ GPSLatitude => 'lat',
122
+ GPSLongitude => 'lon',
123
+ GPSTrack => 'track',
124
+ GPSSpeed => 'speed',
125
+ GPSAltitude => 'alt',
126
+ TimeStamp => 'time',
127
+ # the following are needed to generate Composite GPSDateTime tag
128
+ # since any tag not listed here is ignored
129
+ GPSTimeStamp => '',
130
+ GPSDateStamp => '',
112
131
  );
113
132
 
114
133
  # tags which may exist separately in some formats (eg. CSV)
@@ -163,7 +182,7 @@ sub SplitCSV($$)
163
182
  }
164
183
 
165
184
  #------------------------------------------------------------------------------
166
- # Load GPS track log file
185
+ # Load GPS track log file or read GPS from image/video file
167
186
  # Inputs: 0) ExifTool ref, 1) track log data or file name
168
187
  # Returns: geotag hash data reference or error string
169
188
  # - the geotag hash has the following members:
@@ -175,7 +194,7 @@ sub SplitCSV($$)
175
194
  # - the fix information hash may contain:
176
195
  # lat - signed latitude (required)
177
196
  # lon - signed longitude (required)
178
- # alt - signed altitude
197
+ # alt - signed altitude (m)
179
198
  # time - fix time in UTC as XML string
180
199
  # fixtype- type of fix ('none'|'2d'|'3d'|'dgps'|'pps')
181
200
  # pdop - dilution of precision
@@ -277,7 +296,7 @@ sub LoadTrackLog($$;$)
277
296
  # determine file format
278
297
  if (not $format) {
279
298
  s/^\xef\xbb\xbf//; # remove leading BOM if it exists
280
- if (/^\xff\xfe|\xfe\xff/) {
299
+ if (/^(\xff\xfe|\xfe\xff)/) {
281
300
  return "ExifTool doesn't yet read UTF16-format track logs";
282
301
  }
283
302
  if (/^<(\?xml|gpx)[\s>]/) { # look for XML or GPX header
@@ -380,6 +399,8 @@ sub LoadTrackLog($$;$)
380
399
  } elsif (/"(durationMinutesOffsetFromStartTime|startTime)"\s*:/) {
381
400
  $format = 'JSON'; # new Google Takeout JSON format (fixes seem to be in order)
382
401
  $raf->Seek(0,0); # rewind to start of file
402
+ } elsif (/\0/) {
403
+ last; # (could be an image file)
383
404
  } else {
384
405
  # search only first 50 lines of file for a valid fix
385
406
  last if ++$skipped > 50;
@@ -860,6 +881,71 @@ DoneFix: $isDate = 1;
860
881
  push @fixTimes, $time; # save time of all fixes in order
861
882
  ++$numPoints;
862
883
  }
884
+ #
885
+ # If the file wasn't a recognized track log, it could be one of the file types
886
+ # supported for reading metadata, so try to extract GPS tags from it
887
+ #
888
+ unless ($format) {
889
+ $raf->Seek(0,0);
890
+ # load track from metadata in file
891
+ my $et2 = Image::ExifTool->new;
892
+ $et2->Options(
893
+ Sort => 'File',
894
+ IgnoreTags => 'All',
895
+ RequestTags => join(',',keys %tagKey),
896
+ PrintConv => 0,
897
+ KeepUTCTime => 1,
898
+ ExtractEmbedded => 3,
899
+ QuickTimeUTC => $et->Options('QuickTimeUTC')
900
+ );
901
+ unless ($et2->ExtractInfo($raf)) {
902
+ $raf->Close();
903
+ return "Unrecognized file format '${val}'";
904
+ }
905
+ my @tags = $et2->GetTagList();
906
+ my ($tag, $fix, $time, $name);
907
+ my ($lastGrp, $lastTag) = ('', '');
908
+ if (@tags) {
909
+ push @tags, $tags[-1]; # duplicate last tag to act as an end marker
910
+ $isDate = 1;
911
+ $sortFixes = 1; # (fixes may not be in order)
912
+ }
913
+ foreach $tag (@tags) {
914
+ my $grp = $et2->GetGroup($tag, 3);
915
+ if ($grp ne $lastGrp or $tag eq $lastTag) {
916
+ # add fix to our lookup
917
+ if ($time and $$fix{lat} and $$fix{lon}) {
918
+ if ($$points{$time}) {
919
+ # could possibly happen if time jumps around
920
+ $$points{$time}{$_} = $$fix{$_} foreach keys %$fix;
921
+ } else {
922
+ $$points{$time} = $fix;
923
+ # convert speed to knots
924
+ $$fix{speed} and $$fix{speed} /= $speedConv{K};
925
+ push @fixTimes, $time; # save time of all fixes in order
926
+ ++$numPoints;
927
+ }
928
+ }
929
+ $lastGrp = $grp;
930
+ undef $time;
931
+ $fix = { };
932
+ }
933
+ $lastTag = $tag;
934
+ ($name = $tag) =~ s/ .*//;
935
+ my $key = $tagKey{$name};
936
+ unless ($key) {
937
+ defined $key or $et->Warn("Internal error with tag name $key $name ($tag)");
938
+ next;
939
+ }
940
+ my $val = $et2->GetValue($tag);
941
+ if ($key eq 'time') {
942
+ $time = Image::ExifTool::GetUnixTime($val) unless $time;
943
+ } elsif (not defined $$fix{$key}) {
944
+ $$fix{$key} = $val;
945
+ $$has{$keyCategory{$key}} = 1 if $keyCategory{$key};
946
+ }
947
+ }
948
+ }
863
949
  $raf->Close();
864
950
 
865
951
  # set date flags
@@ -1645,9 +1731,11 @@ This module is used by Image::ExifTool
1645
1731
  This module loads GPS track logs, interpolates to determine position based
1646
1732
  on time, and sets new GPS values for geotagging images. Currently supported
1647
1733
  formats are GPX, NMEA RMC/GGA/GLL/GSA/ZDA, KML, IGC, Garmin XML and TCX,
1648
- Magellan PMGNTRK, Honeywell PTNTHPR, Bramor gEO, Winplus Beacon text,
1649
- GPS/IMU CSV, DJI/Columbus/ExifTool CSV format and 3 different Google JSON
1650
- formats.
1734
+ Magellan PMGNTRK, Honeywell PTNTHPR, Bramor gEO, Winplus Beacon text, Garmin
1735
+ FIT, GPS/IMU CSV, DJI/Columbus/ExifTool CSV format and 3 different Google
1736
+ JSON formats. As well, ExifTool can geotag from any supported file or set
1737
+ of files containing GPS metadata provided that GPSDateTime, GPSLatitude and
1738
+ GPSLongitude are available.
1651
1739
 
1652
1740
  Methods in this module should not be called directly. Instead, the Geotag
1653
1741
  feature is accessed by writing the values of the ExifTool Geotag, Geosync
@@ -33,6 +33,7 @@ my %sPose = (
33
33
  RotationZ => { Writable => 'real', Groups => { 2 => 'Location' } },
34
34
  RotationW => { Writable => 'real', Groups => { 2 => 'Location' } },
35
35
  Timestamp => {
36
+ Name => 'TimeStamp',
36
37
  Writable => 'integer',
37
38
  Shift => 'Time',
38
39
  Groups => { 2 => 'Time' },
@@ -72,6 +73,7 @@ my %sEarthPose = (
72
73
  RotationZ => { Writable => 'real', Groups => { 2 => 'Location' } },
73
74
  RotationW => { Writable => 'real', Groups => { 2 => 'Location' } },
74
75
  Timestamp => {
76
+ Name => 'TimeStamp',
75
77
  Writable => 'integer',
76
78
  Shift => 'Time',
77
79
  Groups => { 2 => 'Time' },
@@ -188,6 +188,8 @@ my %convCelsius = ( PrintConv => 'sprintf("%.2f C", $val)' );
188
188
  0x2c4 => { Name => 'VisibleFocalLength', Format => 'float' },
189
189
  );
190
190
 
191
+ 1; # end
192
+
191
193
  __END__
192
194
 
193
195
  =head1 NAME
@@ -1299,7 +1299,7 @@ $VERSION = '1.38';
1299
1299
  },
1300
1300
  'BabyAge' => 'Kindesalter',
1301
1301
  'BabyName' => 'Kindesname',
1302
- 'BackLight' => 'Hintergrundbeleuchtung',
1302
+ 'Backlight' => 'Hintergrundbeleuchtung',
1303
1303
  'BackgroundColor' => 'Hintergrundfarbe',
1304
1304
  'BackgroundColorIndicator' => 'Indikator Hintergrundfarbe',
1305
1305
  'BackgroundColorValue' => 'Hintergrundfarbwert',
@@ -1234,7 +1234,7 @@ $VERSION = '1.37';
1234
1234
  },
1235
1235
  'BabyAge' => 'Âge du bébé',
1236
1236
  'BabyName' => 'Nom du bébé',
1237
- 'BackLight' => {
1237
+ 'Backlight' => {
1238
1238
  Description => 'Contre-jour',
1239
1239
  PrintConv => {
1240
1240
  'Back Lit 1' => 'Rétroéclairage 1',
@@ -2296,7 +2296,7 @@ my %componentDataDef = (
2296
2296
  # '060e2b34.0104.0101.03010602.00000000' => { Name => 'Minutes' },
2297
2297
  # '060e2b34.0104.0101.03010603.00000000' => { Name => 'Seconds' },
2298
2298
  # '060e2b34.0104.0101.03010604.00000000' => { Name => 'msBy4' },
2299
- # '060e2b34.0104.0101.03010700.00000000' => { Name => 'Timestamp' },
2299
+ # '060e2b34.0104.0101.03010700.00000000' => { Name => 'TimeStamp' },
2300
2300
  # '060e2b34.0104.0101.04010100.00000000' => { Name => 'UInt8Array' },
2301
2301
  # '060e2b34.0104.0101.04010300.00000000' => { Name => 'Int32Array' },
2302
2302
  # '060e2b34.0104.0101.04010400.00000000' => { Name => 'Int64Array' },
@@ -108,7 +108,7 @@ my $debug; # set to 1 to enable debugging code
108
108
  {
109
109
  Name => 'MakerNoteFLIR',
110
110
  # (starts with IFD, Make is 'FLIR Systems AB' or 'FLIR Systems')
111
- Condition => '$$self{Make} =~ /^FLIR Systems/',
111
+ Condition => '$$self{Make} =~ /^(FLIR Systems|Teledyne FLIR)/',
112
112
  SubDirectory => {
113
113
  TagTable => 'Image::ExifTool::FLIR::Main',
114
114
  Start => '$valuePtr',
@@ -361,6 +361,7 @@ my %shootingMode = (
361
361
  '16 0' => '1-area', # (FZ8)
362
362
  '16 16' => '1-area (high speed)', # (FZ8)
363
363
  '16 32' => '1-area +', #forum16903 (G9M2)
364
+ '16 225'=> '225-area 2', #forum16903 (S5D)
364
365
  '17 0' => 'Full Area', #forum16903 (G9M2)
365
366
  # '32 0' is Face Detect for FS7, and Face Detect or Focus Tracking
366
367
  # for the DMC-FZ200 (ref 17), and Auto is DMC-L1 guess,
@@ -279,6 +279,8 @@ sub ProcessProtobuf($$$;$)
279
279
  return 1;
280
280
  }
281
281
 
282
+ 1; # end
283
+
282
284
  __END__
283
285
 
284
286
  =head1 NAME
@@ -49,7 +49,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
49
49
  use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
 
52
- $VERSION = '3.33';
52
+ $VERSION = '3.34';
53
53
 
54
54
  sub ProcessMOV($$;$);
55
55
  sub ProcessKeys($$$);
@@ -9588,7 +9588,7 @@ sub ProcessMetaData($$$)
9588
9588
  my $tag = Get32u($dataPt, $pos + 2);
9589
9589
  my $lang = Get16u($dataPt, $pos + 6);
9590
9590
  my $enc = Get16u($dataPt, $pos + 8);
9591
- my $val = substr($$dataPt, $pos + 10, $size);
9591
+ my $val = substr($$dataPt, $pos + 10, $size - 10);
9592
9592
  my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
9593
9593
  if ($tagInfo) {
9594
9594
  # convert language code to ASCII (ignore read-only bit)
@@ -111,7 +111,7 @@ my %insvLimit = (
111
111
  The tags below are extracted from timed metadata in QuickTime and other
112
112
  formats of video files when the ExtractEmbedded option is used. Although
113
113
  most of these tags are combined into the single table below, ExifTool
114
- currently reads 122 different types of timed GPS metadata from video files.
114
+ currently reads 123 different types of timed GPS metadata.
115
115
  },
116
116
  GPSLatitude => { PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "N")', RawConv => '$$self{FoundGPSLatitude} = 1; $val' },
117
117
  GPSLongitude => { PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")' },
@@ -1654,6 +1654,7 @@ sub CalcDuration($@)
1654
1654
  # FujiFilm REAL 3D AVI's), but the video stream information isn't reliable for
1655
1655
  # some cameras (eg. Olympus FE models), so use the video stream information
1656
1656
  # only if the RIFF header duration is 2 to 3 times longer
1657
+ # (also see https://github.com/exiftool/exiftool/issues/371)
1657
1658
  my $dur1;
1658
1659
  $dur1 = $val[1] / $val[0] if $val[0];
1659
1660
  if ($val[2] and $val[3]) {
@@ -698,6 +698,8 @@ my %convUnicode = (
698
698
  0x95 => { Name => 'FileNumber', Format => 'int16u' },
699
699
  );
700
700
 
701
+ 1; # end
702
+
701
703
  __END__
702
704
 
703
705
  =head1 NAME
@@ -1593,7 +1593,7 @@ my %tagLookup = (
1593
1593
  'chromaticaberrationb' => { 536 => 'ChromaticAberrationB', 538 => 'ChromaticAberrationB' },
1594
1594
  'chromaticaberrationblue' => { 111 => 0x20708, 117 => 0x6b },
1595
1595
  'chromaticaberrationcorr' => { 86 => [0x4,0x5] },
1596
- 'chromaticaberrationcorrection' => { 127 => 0x7034, 400 => 0x1, 518 => 0x900d },
1596
+ 'chromaticaberrationcorrection' => { 127 => [0x7034,0xa410], 400 => 0x1, 518 => 0x900d },
1597
1597
  'chromaticaberrationcorrparams' => { 127 => 0x7035, 512 => 0x66a, 513 => [0x37c,0x384,0x39c,0x3b0,0x3b8] },
1598
1598
  'chromaticaberrationon' => { 111 => '0x20703.0', 117 => 0x62 },
1599
1599
  'chromaticaberrationr' => { 536 => 'ChromaticAberrationR', 538 => 'ChromaticAberrationR' },
@@ -2536,6 +2536,8 @@ my %tagLookup = (
2536
2536
  'destinationcitycode' => { 418 => 0x1001 },
2537
2537
  'destinationdst' => { 411 => 0x26, 417 => '0.3' },
2538
2538
  'developmentdynamicrange' => { 135 => 0x1403 },
2539
+ 'developmenttype' => { 127 => 0xa40d },
2540
+ 'developmenttypedescription' => { 127 => 0xa40e },
2539
2541
  'deviantmatrixcustom' => { 157 => 0x7de },
2540
2542
  'deviantmatrixdaylight' => { 157 => 0x7da },
2541
2543
  'deviantmatrixflash' => { 157 => 0x7dd },
@@ -2630,7 +2632,7 @@ my %tagLookup = (
2630
2632
  'distortion' => { 454 => 0xa050 },
2631
2633
  'distortioncompensation' => { 518 => 0x8040 },
2632
2634
  'distortioncontrol' => { 289 => 0x10 },
2633
- 'distortioncorrection' => { 86 => 0x3, 111 => 0x20705, 117 => 0x67, 127 => 0x7036, 233 => 0x4, 347 => 0x50b, 376 => '7.1', 400 => 0x0, 512 => 0x601, 513 => 0x5b },
2635
+ 'distortioncorrection' => { 86 => 0x3, 111 => 0x20705, 117 => 0x67, 127 => [0x7036,0xa40f], 233 => 0x4, 347 => 0x50b, 376 => '7.1', 400 => 0x0, 512 => 0x601, 513 => 0x5b },
2634
2636
  'distortioncorrection2' => { 351 => 0x1011 },
2635
2637
  'distortioncorrectionalreadyapplied' => { 533 => 'DistortionCorrectionAlreadyApplied' },
2636
2638
  'distortioncorrectionon' => { 111 => '0x20705.0', 117 => 0x63 },
@@ -4224,6 +4226,7 @@ my %tagLookup = (
4224
4226
  'lcdmatrixmarvin' => { 157 => 0xe76 },
4225
4227
  'lcdpanels' => { 91 => 0x8 },
4226
4228
  'lcheditor' => { 318 => 0x8ae85e },
4229
+ 'learningoptoutin' => { 127 => 0x9287 },
4227
4230
  'legacyiptcdigest' => { 554 => 'LegacyIPTCDigest' },
4228
4231
  'legalcode' => { 534 => 'legalcode' },
4229
4232
  'lens' => { 127 => 0xfdea, 258 => 0x84, 533 => 'Lens' },
@@ -5205,7 +5208,7 @@ my %tagLookup = (
5205
5208
  'nikonsettings' => { 258 => 0x4e },
5206
5209
  'noisefilter' => { 347 => 0x527 },
5207
5210
  'noiseprofile' => { 127 => 0xc761 },
5208
- 'noisereduction' => { 135 => [0x100b,0x100e], 201 => 0xb0, 202 => 0x60, 203 => 0x3f, 258 => 0x95, 318 => 0x753dcbc0, 319 => 0x17, 347 => 0x50a, 352 => 0x103a, 372 => 0x2d, 411 => 0x49, 447 => 0x100f, 449 => 0x2a },
5211
+ 'noisereduction' => { 127 => 0xa412, 135 => [0x100b,0x100e], 201 => 0xb0, 202 => 0x60, 203 => 0x3f, 258 => 0x95, 318 => 0x753dcbc0, 319 => 0x17, 347 => 0x50a, 352 => 0x103a, 372 => 0x2d, 411 => 0x49, 447 => 0x100f, 449 => 0x2a },
5209
5212
  'noisereduction2' => { 351 => 0x1010 },
5210
5213
  'noisereductionapplied' => { 127 => 0xc6f7 },
5211
5214
  'noisereductionintensity' => { 319 => 0x9 },
@@ -6656,6 +6659,7 @@ my %tagLookup = (
6656
6659
  'setting' => { 555 => 'setting' },
6657
6660
  'shadingcompensation' => { 347 => 0x50c, 372 => 0x8a },
6658
6661
  'shadingcompensation2' => { 351 => 0x1012 },
6662
+ 'shadingcorrection' => { 127 => 0xa411 },
6659
6663
  'shadow' => { 457 => 0xe },
6660
6664
  'shadowadj' => { 111 => 0x2030b },
6661
6665
  'shadowcorrection' => { 411 => 0x79 },