exiftool_vendored 13.14.0 → 13.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,7 +112,7 @@ $VERSION = '1.26';
112
112
  113 => 'Power Zoom +',
113
113
  114 => 'Power Zoom -',
114
114
  115 => 'Delete',
115
- 116 => 'Pixel Shift Shooting',
115
+ 116 => 'Pixel Shift Shooting', #Z8 (Z9 fw 5.1 maps as 'Save and Load Power Zoom Position')
116
116
  117 => 'Cycle AF-area Mode',
117
117
  118 => 'Raw Processing (Current)', #118-131 are Playback Retouch options
118
118
  119 => 'Raw Processing (Multiple)',
@@ -9838,7 +9838,7 @@ my %noYes = ( 0 => 'No', 1 => 'Yes' );
9838
9838
  5 => '5 (Delayed)',
9839
9839
  },
9840
9840
  },
9841
- 11 => {Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
9841
+ 11 => { Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
9842
9842
  13 => { # CSa5
9843
9843
  Name => 'StoreByOrientation',
9844
9844
  PrintConv => {
@@ -10149,7 +10149,7 @@ my %noYes = ( 0 => 'No', 1 => 'Yes' );
10149
10149
  5 => '5 (Delayed)',
10150
10150
  },
10151
10151
  },
10152
- 11 => {Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10152
+ 11 => { Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10153
10153
  13 => { # CSa5
10154
10154
  Name => 'StoreByOrientation',
10155
10155
  PrintConv => {
@@ -10547,7 +10547,7 @@ my %noYes = ( 0 => 'No', 1 => 'Yes' );
10547
10547
  5 => '5 (Delayed)',
10548
10548
  },
10549
10549
  },
10550
- 11 => {Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10550
+ 11 => { Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10551
10551
  13 => { # CSa5
10552
10552
  Name => 'StoreByOrientation',
10553
10553
  PrintConv => {
@@ -10957,7 +10957,7 @@ my %noYes = ( 0 => 'No', 1 => 'Yes' );
10957
10957
  5 => '5 (Delayed)',
10958
10958
  },
10959
10959
  },
10960
- 11 => {Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10960
+ 11 => { Name => 'AFPointSel',PrintConv => { 0 => 'Use All',1 => 'Use Half' }}, # CSa4
10961
10961
  13 => { # CSa5
10962
10962
  Name => 'StoreByOrientation',
10963
10963
  PrintConv => {
@@ -37,7 +37,7 @@ use vars qw($VERSION %leicaLensTypes);
37
37
  use Image::ExifTool qw(:DataAccess :Utils);
38
38
  use Image::ExifTool::Exif;
39
39
 
40
- $VERSION = '2.23';
40
+ $VERSION = '2.24';
41
41
 
42
42
  sub ProcessLeicaLEIC($$$);
43
43
  sub WhiteBalanceConv($;$$);
@@ -1464,6 +1464,12 @@ my %shootingMode = (
1464
1464
  5 => 'Animal Eye/Body',
1465
1465
  6 => 'Car',
1466
1466
  7 => 'Motorcycle',
1467
+ 8 => 'Car (main part priority)',
1468
+ 9 => 'Motorcycle (helmet priority)',
1469
+ 10 => 'Train',
1470
+ 11 => 'Train (main part priority)',
1471
+ 12 => 'Airplane',
1472
+ 13 => 'Airplane (nose priority)',
1467
1473
  }
1468
1474
  },
1469
1475
  0xee => { #PH (DC-GH6)
@@ -48,7 +48,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
48
48
  use Image::ExifTool::Exif;
49
49
  use Image::ExifTool::GPS;
50
50
 
51
- $VERSION = '3.09';
51
+ $VERSION = '3.12';
52
52
 
53
53
  sub ProcessMOV($$;$);
54
54
  sub ProcessKeys($$$);
@@ -3522,7 +3522,11 @@ my %userDefined = (
3522
3522
  #
3523
3523
  '----' => {
3524
3524
  Name => 'iTunesInfo',
3525
- SubDirectory => { TagTable => 'Image::ExifTool::QuickTime::iTunesInfo' },
3525
+ Deletable => 1, # (deletable via 'iTunes' group)
3526
+ SubDirectory => {
3527
+ TagTable => 'Image::ExifTool::QuickTime::iTunesInfo',
3528
+ DirName => 'iTunes', # (necessary for group 'iTunes' delete)
3529
+ },
3526
3530
  },
3527
3531
  aART => { Name => 'AlbumArtist', Groups => { 2 => 'Author' } },
3528
3532
  covr => { Name => 'CoverArt', Groups => { 2 => 'Preview' }, Binary => 1 },
@@ -8776,24 +8780,28 @@ sub UnpackLang($;$)
8776
8780
  # Get language code string given QuickTime language and country codes
8777
8781
  # Inputs: 0) numerical language code, 1) numerical country code, 2) no defaults
8778
8782
  # Returns: language code string (ie. "fra-FR") or undef for default language
8783
+ # ex) 0x15c7 0x0000 is 'eng' with no country (ie. returns 'und' unless $noDef)
8784
+ # 0x15c7 0x5553 is 'eng-US'
8785
+ # 0x1a41 0x4652 is 'fra-FR'
8786
+ # 0x55c4 is 'und'
8779
8787
  sub GetLangCode($;$$)
8780
8788
  {
8781
8789
  my ($lang, $ctry, $noDef) = @_;
8782
8790
  # ignore country ('ctry') and language lists ('lang') for now
8783
8791
  undef $ctry if $ctry and $ctry <= 255;
8784
8792
  undef $lang if $lang and $lang <= 255;
8785
- $lang = UnpackLang($lang, $noDef);
8793
+ my $langCode = UnpackLang($lang, $noDef);
8786
8794
  # add country code if specified
8787
8795
  if ($ctry) {
8788
8796
  $ctry = unpack('a2',pack('n',$ctry)); # unpack as ISO 3166-1
8789
8797
  # treat 'ZZ' like a default country (see ref 12)
8790
8798
  undef $ctry if $ctry eq 'ZZ';
8791
8799
  if ($ctry and $ctry =~ /^[A-Z]{2}$/) {
8792
- $lang or $lang = 'und';
8793
- $lang .= "-$ctry";
8800
+ $langCode or $langCode = UnpackLang($lang,1) || 'und';
8801
+ $langCode .= "-$ctry";
8794
8802
  }
8795
8803
  }
8796
- return $lang;
8804
+ return $langCode;
8797
8805
  }
8798
8806
 
8799
8807
  #------------------------------------------------------------------------------
@@ -9659,6 +9667,43 @@ sub ProcessMetaKeys($$$)
9659
9667
  return 1;
9660
9668
  }
9661
9669
 
9670
+ #------------------------------------------------------------------------------
9671
+ # Identify trailers at specified offset from end of file
9672
+ # Inputs: 0) RAF reference, 1) Offset from end of file
9673
+ # Returns: Array ref to first trailer in linked list: 0) name of trailer,
9674
+ # 1) absolute offset to start of this trailer, 2) trailer length,
9675
+ # 3) ref to next trailer. Or undef if no trailer found, or error string on error
9676
+ # - file position is returned to its original location
9677
+ sub IdentifyTrailers($)
9678
+ {
9679
+ my $raf = shift;
9680
+ my ($trailer, $nextTrail, $buff, $type, $len);
9681
+ my $pos = $raf->Tell();
9682
+ my $offset = 0; # positive offset back from end of file
9683
+ while ($raf->Seek(-40-$offset, 2) and $raf->Read($buff, 40) == 40) {
9684
+ if (substr($buff, 8) eq '8db42d694ccc418790edff439fe026bf') {
9685
+ ($type, $len) = ('Insta360', unpack('V',$buff));
9686
+ } elsif ($buff =~ /\&\&\&\&(.{4})$/) {
9687
+ ($type, $len) = ('LigoGPS', Get32u(\$buff, 36));
9688
+ } elsif ($buff =~ /~\0\x04\0zmie~\0\0\x06.{4}([\x10\x18])(\x04)$/s or
9689
+ $buff =~ /~\0\x04\0zmie~\0\0\x0a.{8}([\x10\x18])(\x08)$/s)
9690
+ {
9691
+ my $oldOrder = GetByteOrder();
9692
+ SetByteOrder($1 eq "\x10" ? 'MM' : 'II');
9693
+ $type = 'MIE';
9694
+ $len = ($2 eq "\x04") ? Get32u(\$buff, 34) : Get64u(\$buff, 30);
9695
+ SetByteOrder($oldOrder);
9696
+ } else {
9697
+ last;
9698
+ }
9699
+ $trailer = [ $type , $raf->Tell() - $len, $len, $nextTrail ];
9700
+ $nextTrail = $trailer;
9701
+ $offset += $len;
9702
+ }
9703
+ $raf->Seek($pos,0) or return 'Seek error';
9704
+ return $trailer;
9705
+ }
9706
+
9662
9707
  #------------------------------------------------------------------------------
9663
9708
  # Process a QuickTime atom
9664
9709
  # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) optional tag table ref
@@ -9706,17 +9751,10 @@ sub ProcessMOV($$;$)
9706
9751
  }
9707
9752
  ($size, $tag) = unpack('Na4', $buff);
9708
9753
  my $fast = $$et{OPTIONS}{FastScan} || 0;
9709
- # check for Insta360 or LIGOGPSINFO trailer
9754
+ # check for Insta360, LIGOGPSINFO or MIE trailer
9710
9755
  if ($topLevel and not $fast) {
9711
- my $pos = $raf->Tell();
9712
- if ($raf->Seek(-40, 2) and $raf->Read($buff, 40) == 40) {
9713
- if (substr($buff, 8) eq '8db42d694ccc418790edff439fe026bf') {
9714
- $trailer = [ 'Insta360', $raf->Tell() - unpack('V',$buff) ];
9715
- } elsif ($buff =~ /\&\&\&\&(.{4})$/) {
9716
- $trailer = [ 'LigoGPS', $raf->Tell() - Get32u(\$buff, 36) ];
9717
- }
9718
- }
9719
- $raf->Seek($pos,0) or return 0;
9756
+ $trailer = IdentifyTrailers($raf);
9757
+ $trailer and not ref $trailer and $et->Warn($trailer), return 0;
9720
9758
  }
9721
9759
  if ($dataPt) {
9722
9760
  $verbose and $et->VerboseDir($$dirInfo{DirName});
@@ -9818,6 +9856,7 @@ sub ProcessMOV($$;$)
9818
9856
  $size -= 8;
9819
9857
  }
9820
9858
  if ($validate) {
9859
+ $et->Warn("Invalid 'wide' atom size") if $tag eq 'wide' and $size;
9821
9860
  $$et{ValidatePath} or $$et{ValidatePath} = { };
9822
9861
  my $path = join('-', @{$$et{PATH}}, $tag);
9823
9862
  $path =~ s/-Track-/-$$et{SET_GROUP1}-/ if $$et{SET_GROUP1};
@@ -10314,7 +10353,7 @@ ItemID: foreach $id (reverse sort { $a <=> $b } keys %$items) {
10314
10353
  last if $dirEnd and $dataPos >= $dirEnd; # (note: ignores last value if 0 bytes)
10315
10354
  $lastPos = $raf->Tell() + $dirBase;
10316
10355
  if ($trailer and $lastPos >= $$trailer[1]) {
10317
- $et->Warn(sprintf('%s trailer at offset 0x%x', @$trailer), 1);
10356
+ $et->Warn(sprintf('%s trailer at offset 0x%x (%d bytes)', @$trailer[0..2]), 1);
10318
10357
  last;
10319
10358
  }
10320
10359
  $raf->Read($buff, 8) == 8 or last;
@@ -10365,11 +10404,12 @@ QTLang: foreach $tag (@{$$et{QTLang}}) {
10365
10404
  # process item information now that we are done processing its 'meta' container
10366
10405
  HandleItemInfo($et) if $topLevel or $dirID eq 'meta';
10367
10406
 
10368
- # process LigoGPS trailer now if it exists and we haven't already processed it
10369
- if ($trailer and $$trailer[0] eq 'LigoGPS' and $lastPos <= $$trailer[1] and
10370
- $raf->Seek($$trailer[1]) and $raf->Read($buff, 8) == 8 and $buff =~ /skip$/)
10371
- {
10372
- if ($ee) {
10407
+ # process linked list of trailers
10408
+ for (; $trailer; $trailer=$$trailer[3]) {
10409
+ next if $lastPos > $$trailer[1]; # skip if we have already processed this as an atom
10410
+ last unless $raf->Seek($$trailer[1], 0);
10411
+ if ($$trailer[0] eq 'LigoGPS' and $raf->Read($buff, 8) == 8 and $buff =~ /skip$/) {
10412
+ $ee or $et->Warn('Use the ExtractEmbedded option to decode timed GPS',3), next;
10373
10413
  my $len = Get32u(\$buff, 0) - 16;
10374
10414
  if ($len > 0 and $raf->Read($buff, $len) == $len and $buff =~ /^LIGOGPSINFO\0/) {
10375
10415
  my $tbl = GetTagTable('Image::ExifTool::QuickTime::Stream');
@@ -10378,8 +10418,14 @@ QTLang: foreach $tag (@{$$et{QTLang}}) {
10378
10418
  } else {
10379
10419
  $et->Warn('Unrecognized data in LigoGPS trailer');
10380
10420
  }
10381
- } else {
10382
- $et->Warn('Use the ExtractEmbedded option to decode timed GPS',3);
10421
+ } elsif ($$trailer[0] eq 'Insta360' and $ee) {
10422
+ # process Insta360 trailer if it exists
10423
+ $raf->Seek(0, 2) or $et->Warn('Seek error'), last;
10424
+ my $offset = $raf->Tell() - $$trailer[1] - $$trailer[2];
10425
+ ProcessInsta360($et, { RAF => $raf, DirName => $$trailer[0], Offset => $offset });
10426
+ } elsif ($$trailer[0] eq 'MIE') {
10427
+ require Image::ExifTool::MIE;
10428
+ Image::ExifTool::MIE::ProcessMIE($et, { RAF => $raf, DirName => 'MIE', Trailer => 1 });
10383
10429
  }
10384
10430
  }
10385
10431
  # brute force scan for metadata embedded in media data
@@ -3154,16 +3154,18 @@ sub ProcessInsta360($;$)
3154
3154
  my $verbose = $et->Options('Verbose');
3155
3155
  my $tagTbl = GetTagTable('Image::ExifTool::QuickTime::Stream');
3156
3156
  my $fileEnd = $raf->Tell();
3157
+ my $trailEnd = $fileEnd - $offset;
3157
3158
  my $trailerLen = unpack('x38V', $buff);
3158
- $trailerLen > $fileEnd and $et->Warn('Bad Insta360 trailer size'), return 0;
3159
+ $trailerLen > $trailEnd and $et->Warn('Bad Insta360 trailer size'), return 0;
3159
3160
  if ($dirInfo) {
3160
3161
  $$dirInfo{DirLen} = $trailerLen;
3161
- $$dirInfo{DataPos} = $fileEnd - $trailerLen;
3162
+ $$dirInfo{DataPos} = $trailEnd - $trailerLen;
3162
3163
  if ($$dirInfo{OutFile}) {
3163
3164
  if ($$et{DEL_GROUP}{Insta360}) {
3164
3165
  ++$$et{CHANGED};
3166
+ return 1;
3165
3167
  # just copy the trailer when writing
3166
- } elsif ($trailerLen > $fileEnd or not $raf->Seek($$dirInfo{DataPos}, 0) or
3168
+ } elsif ($trailerLen > $trailEnd or not $raf->Seek($$dirInfo{DataPos}, 0) or
3167
3169
  $raf->Read(${$$dirInfo{OutFile}}, $trailerLen) != $trailerLen)
3168
3170
  {
3169
3171
  return 0;
@@ -3181,7 +3183,7 @@ sub ProcessInsta360($;$)
3181
3183
 
3182
3184
  my $unknown = $et->Options('Unknown');
3183
3185
  # position relative to end of trailer (avoids using large offsets for files > 2 GB)
3184
- my $epos = -78-$offset;
3186
+ my $epos = -78;
3185
3187
  my ($i, $p);
3186
3188
  $$et{SET_GROUP0} = 'Trailer';
3187
3189
  $$et{SET_GROUP1} = 'Insta360';
@@ -3190,7 +3192,7 @@ sub ProcessInsta360($;$)
3190
3192
  for (;;) {
3191
3193
  my ($id, $len) = unpack('vV', $buff);
3192
3194
  ($epos -= $len) + $trailerLen < 0 and last;
3193
- $raf->Seek($epos, 2) or last;
3195
+ $raf->Seek($epos-$offset, 2) or last;
3194
3196
  if ($verbose) {
3195
3197
  $et->VPrint(0, sprintf("Insta360 Record 0x%x (offset 0x%x, %d bytes):\n", $id, $fileEnd + $epos, $len));
3196
3198
  }
@@ -3218,7 +3220,7 @@ sub ProcessInsta360($;$)
3218
3220
  $dlen = 20;
3219
3221
  }
3220
3222
  }
3221
- $raf->Seek($epos, 2) or last;
3223
+ $raf->Seek($epos-$offset, 2) or last;
3222
3224
  }
3223
3225
  } elsif ($id == 0x200) {
3224
3226
  $dlen = $len;
@@ -3347,8 +3349,8 @@ sub ProcessInsta360($;$)
3347
3349
  } else {
3348
3350
  ($epos -= 6) + $trailerLen < 0 and last; # step back to previous record
3349
3351
  }
3350
- $raf->Seek($epos, 2) or last; # seek to start of next footer
3351
- $raf->Read($buff, 6) == 6 or last; # read footer
3352
+ $raf->Seek($epos-$offset, 2) or last; # seek to start of next footer
3353
+ $raf->Read($buff, 6) == 6 or last; # read footer
3352
3354
  }
3353
3355
  delete $$et{DOC_NUM};
3354
3356
  SetByteOrder('MM');
@@ -3607,8 +3609,6 @@ sub ScanMediaData($)
3607
3609
  $et->VPrint(0, "--------------------------\n");
3608
3610
  $$et{INDENT} = substr $$et{INDENT}, 0, -2;
3609
3611
  }
3610
- # process Insta360 trailer if it exists
3611
- ProcessInsta360($et);
3612
3612
  }
3613
3613
 
3614
3614
  1; # end
@@ -905,7 +905,10 @@ numerical, and generated automatically otherwise.
905
905
  Deletable : [Writable SubDirectory's only] Overrides internal test for
906
906
  metadata types with permanent directories (currently QuickTime
907
907
  and Jpeg2000), allowing the tag containing these directories
908
- to be deleted
908
+ to be deleted. Note that either the tag's SubDirectory
909
+ DirName (which defaults to the TagName if not specified) or
910
+ the family 0 group name of the SubDirectory TagTable must
911
+ match a deletable group name.
909
912
 
910
913
  OffsetPair : Used in EXIF table to specify the tagID for the corresponding
911
914
  offset or length tag.
@@ -30,7 +30,7 @@ use strict;
30
30
  use vars qw($VERSION $AUTOLOAD);
31
31
  use Image::ExifTool qw(:DataAccess :Utils);
32
32
 
33
- $VERSION = '1.69';
33
+ $VERSION = '1.70';
34
34
 
35
35
  sub ConvertTimecode($);
36
36
  sub ProcessSGLT($$$);
@@ -1319,6 +1319,11 @@ my %code2charset = (
1319
1319
  Name => 'ImageWidth',
1320
1320
  Format => 'int16u',
1321
1321
  Priority => 0,
1322
+ # add " (lossless)" to FileType since image has a VP8L (lossless) chunk
1323
+ RawConv => q{
1324
+ $self->OverrideFileType($$self{VALUE}{FileType} . ' (lossless)', undef, 'webp');
1325
+ return $val;
1326
+ },
1322
1327
  ValueConv => '($val & 0x3fff) + 1',
1323
1328
  },
1324
1329
  2 => {
@@ -1327,6 +1332,11 @@ my %code2charset = (
1327
1332
  Priority => 0,
1328
1333
  ValueConv => '(($val >> 6) & 0x3fff) + 1',
1329
1334
  },
1335
+ 4 => {
1336
+ Name => 'AlphaIsUsed',
1337
+ Mask => 0x10,
1338
+ PrintConv => { 0 => 'No', 1 => 'Yes' },
1339
+ },
1330
1340
  );
1331
1341
 
1332
1342
  # WebP extended info (ref 14)
@@ -1002,6 +1002,10 @@ my %formatMinMax = (
1002
1002
  '0x0a20-name' => 'DualCameraImageName', # ("FlipPhoto_002")
1003
1003
  '0x0a20' => { Name => 'DualCameraImage', Groups => { 2 => 'Preview' }, Binary => 1 },
1004
1004
  '0x0a30-name' => 'EmbeddedVideoType', # ("MotionPhoto_Data")
1005
+ # Note: A duplicate of this video may be extracted as MotionPhotoVideo from
1006
+ # the Google trailer, but keep this copy named as EmbeddedVideoFile
1007
+ # for backward compatibility and to avoid confusion due to extracting
1008
+ # multiple tags with the same name
1005
1009
  '0x0a30' => { Name => 'EmbeddedVideoFile', Groups => { 2 => 'Video' }, Binary => 1 }, #forum7161
1006
1010
  # 0x0a41-name - seen 'BackupRestore_Data' #forum16086
1007
1011
  # 0x0aa1-name - seen 'MCC_Data'
@@ -1719,7 +1719,7 @@ my %hidUnk = ( Hidden => 1, Unknown => 1 );
1719
1719
  },
1720
1720
  },{
1721
1721
  Name => 'Tag9050c',
1722
- Condition => '$$self{Model} =~ /^(ILCE-(1|7M4|7RM5|7SM3)|ILME-FX3)/',
1722
+ Condition => '$$self{Model} =~ /^(ILCE-(1\b|7M4|7RM5|7SM3)|ILME-FX3)/',
1723
1723
  SubDirectory => {
1724
1724
  TagTable => 'Image::ExifTool::Sony::Tag9050c',
1725
1725
  ByteOrder => 'LittleEndian',