exiftool_vendored 13.14.0 → 13.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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)