exiftool_vendored 12.57.0 → 12.59.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +39 -0
  3. data/bin/MANIFEST +3 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +2 -2
  7. data/bin/config_files/example.config +1 -0
  8. data/bin/config_files/rotate_regions.config +1 -1
  9. data/bin/exiftool +76 -57
  10. data/bin/lib/Image/ExifTool/AIFF.pm +2 -2
  11. data/bin/lib/Image/ExifTool/APE.pm +2 -2
  12. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +13 -14
  13. data/bin/lib/Image/ExifTool/Canon.pm +26 -6
  14. data/bin/lib/Image/ExifTool/DJI.pm +28 -2
  15. data/bin/lib/Image/ExifTool/Exif.pm +24 -5
  16. data/bin/lib/Image/ExifTool/FlashPix.pm +28 -10
  17. data/bin/lib/Image/ExifTool/FujiFilm.pm +1 -0
  18. data/bin/lib/Image/ExifTool/JPEG.pm +14 -2
  19. data/bin/lib/Image/ExifTool/LIF.pm +10 -2
  20. data/bin/lib/Image/ExifTool/LNK.pm +5 -4
  21. data/bin/lib/Image/ExifTool/MPEG.pm +2 -2
  22. data/bin/lib/Image/ExifTool/MakerNotes.pm +2 -2
  23. data/bin/lib/Image/ExifTool/Minolta.pm +6 -7
  24. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +9 -1
  25. data/bin/lib/Image/ExifTool/Nikon.pm +390 -114
  26. data/bin/lib/Image/ExifTool/Olympus.pm +87 -7
  27. data/bin/lib/Image/ExifTool/PNG.pm +15 -2
  28. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +27 -1
  29. data/bin/lib/Image/ExifTool/Pentax.pm +8 -5
  30. data/bin/lib/Image/ExifTool/PhaseOne.pm +14 -1
  31. data/bin/lib/Image/ExifTool/Photoshop.pm +3 -3
  32. data/bin/lib/Image/ExifTool/QuickTime.pm +16 -11
  33. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +38 -6
  34. data/bin/lib/Image/ExifTool/README +8 -0
  35. data/bin/lib/Image/ExifTool/RIFF.pm +41 -13
  36. data/bin/lib/Image/ExifTool/Rawzor.pm +2 -2
  37. data/bin/lib/Image/ExifTool/Sigma.pm +4 -4
  38. data/bin/lib/Image/ExifTool/Sony.pm +23 -1
  39. data/bin/lib/Image/ExifTool/TagLookup.pm +4464 -4441
  40. data/bin/lib/Image/ExifTool/TagNames.pod +117 -36
  41. data/bin/lib/Image/ExifTool/Validate.pm +5 -5
  42. data/bin/lib/Image/ExifTool/WriteExif.pl +49 -0
  43. data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  44. data/bin/lib/Image/ExifTool/Writer.pl +74 -14
  45. data/bin/lib/Image/ExifTool/XMP.pm +19 -4
  46. data/bin/lib/Image/ExifTool/XMP2.pl +2 -1
  47. data/bin/lib/Image/ExifTool.pm +131 -17
  48. data/bin/lib/Image/ExifTool.pod +40 -5
  49. data/bin/perl-Image-ExifTool.spec +1 -1
  50. data/lib/exiftool_vendored/version.rb +1 -1
  51. metadata +2 -2
@@ -40,7 +40,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
40
40
  use Image::ExifTool::Exif;
41
41
  use Image::ExifTool::APP12;
42
42
 
43
- $VERSION = '2.80';
43
+ $VERSION = '2.81';
44
44
 
45
45
  sub PrintLensInfo($$$);
46
46
 
@@ -3165,21 +3165,38 @@ my %indexInfo = (
3165
3165
  PrintHex => 1,
3166
3166
  ValueConv => '($val & 0x1f) . " " . ($val & 0xffe0)',
3167
3167
  ValueConvInv => 'my @v=split(" ",$val); @v == 2 ? $v[0] + $v[1] : $val',
3168
- PrintConv => [
3168
+ PrintConv => [ # herb values added:
3169
+ # based on code of W.P. in https://exiftool.org/forum/index.php?topic=14144.0
3169
3170
  {
3170
- 0x00 => '(none)',
3171
- 0x01 => 'Center',
3171
+ # 0x00 => '(none)',
3172
+ # 0x01 => 'Center',
3172
3173
  # need to fill this in...
3174
+ 0x00 => '(none)',
3175
+ 0x02 => 'Top-center (horizontal)',
3176
+ 0x04 => 'Right (horizontal)',
3177
+ 0x05 => 'Mid-right (horizontal)',
3178
+ 0x06 => 'Center (horizontal)',
3179
+ 0x07 => 'Mid-left (horizontal)',
3180
+ 0x08 => 'Left (horizontal)',
3181
+ 0x0a => 'Bottom-center (horizontal)',
3182
+ 0x0c => 'Top-center (vertical)',
3183
+ 0x0f => 'Right (vertical)',
3184
+ 0x15 => 'Bottom-center (vertical)',
3185
+ 0x10 => 'Mid-right (vertical)',
3186
+ 0x11 => 'Center (vertical)',
3187
+ 0x12 => 'Mid-left (vertical)',
3188
+ 0x13 => 'Left (vertical)',
3173
3189
  },
3174
3190
  {
3175
3191
  0x00 => 'Single Target',
3176
3192
  0x40 => 'All Target', # (guess)
3177
3193
  },
3178
3194
  ]
3179
- },{ #11
3195
+ },{ #herb all camera model except E-Mxxx and OM-x
3180
3196
  Name => 'AFPoint',
3197
+ Condition => '$$self{Model} !~ /^(E-M|OM-)/ ',
3181
3198
  Writable => 'int16u',
3182
- Notes => 'other models',
3199
+ Notes => 'models other than E-Mxxx and OM-x',
3183
3200
  RawConv => '($val or $$self{Model} ne "E-P1") ? $val : undef',
3184
3201
  PrintConv => {
3185
3202
  # (E-P1 always writes 0, maybe other models do too - PH)
@@ -3189,10 +3206,73 @@ my %indexInfo = (
3189
3206
  3 => 'Center (vertical)', #6 (E-510)
3190
3207
  255 => 'None',
3191
3208
  },
3209
+ },{ #herb all newer models E-Mxxx and OM-x; we do not know details
3210
+ Name => 'AFPoint',
3211
+ Writable => 'int16u',
3212
+ Notes => 'other models',
3192
3213
  }
3193
3214
  ],
3194
3215
  # 0x31a Continuous AF parameters?
3195
- # 0x31b ContinuousFocusMode? (ref forum78245)
3216
+ 0x31b => [ #herb, based on investigations of abgestumpft: https://exiftool.org/forum/index.php?topic=14527.0
3217
+ # for newer models E-Mxxx and OM-x
3218
+ {
3219
+ Name => 'AFPointDetails',
3220
+ Condition => '$$self{Model} =~ m/^E-M|^OM-/ ',
3221
+ Writable => 'int16u',
3222
+ Notes => 'models E-Mxxx and OM-x',
3223
+ PrintHex => 1,
3224
+ ValueConv => '(($val >> 13) & 0x7) . " " . (($val >> 12) & 0x1) . " " . (($val >> 11) & 0x1) . " " .
3225
+ # subject detect face and eye half press
3226
+ (($val >> 8) & 0x3) . " " . (($val >> 7) & 0x1) . " " . (($val >> 5) & 0x1) . " " .
3227
+ # eye AF face detect x-AF with MF
3228
+ (($val >> 4) & 0x1) . " " . (($val >> 3) & 0x1) . " " . ($val & 0x7)',
3229
+ # release object found MF...
3230
+ PrintConvColumns => 4,
3231
+ PrintConv => [
3232
+ {
3233
+ # should be identical to AISubjectTrackingMode
3234
+ 0 => 'No Subject Detection',
3235
+ 1 => 'Motorsports',
3236
+ 2 => 'Airplanes',
3237
+ 3 => 'Trains',
3238
+ 4 => 'Birds',
3239
+ 5 => 'Dogs & Cats',
3240
+ },{
3241
+ 0 => 'Face Priority',
3242
+ 1 => 'Target Priority',
3243
+ },{
3244
+ 0 => 'Normal AF',
3245
+ 1 => 'AF on Half Press',
3246
+ },{
3247
+ 0 => 'No Eye-AF',
3248
+ 1 => 'Right Eye Priority',
3249
+ 2 => 'Left Eye Priority',
3250
+ 3 => 'Both Eyes Priority',
3251
+ },{
3252
+ 0 => 'No Face Detection',
3253
+ 1 => 'Face Detection',
3254
+ },{
3255
+ 0 => 'No MF',
3256
+ 1 => 'With MF',
3257
+ },{
3258
+ 0 => 'AF Priority',
3259
+ 1 => 'Release Priority',
3260
+ },{
3261
+ 0 => 'No Object found',
3262
+ 1 => 'Object found',
3263
+ },{
3264
+ 0 => 'MF',
3265
+ 1 => 'S-AF',
3266
+ 2 => 'C-AF',
3267
+ 6 => 'C-AF + TR',
3268
+ },
3269
+ ],
3270
+ },{ # for older models
3271
+ Name => 'AFPointDetails',
3272
+ Writable => 'int16u',
3273
+ Notes => 'other models',
3274
+ }
3275
+ ],
3196
3276
  0x328 => { #PH
3197
3277
  Name => 'AFInfo',
3198
3278
  SubDirectory => { TagTable => 'Image::ExifTool::Olympus::AFInfo' },
@@ -36,7 +36,7 @@ use strict;
36
36
  use vars qw($VERSION $AUTOLOAD %stdCase);
37
37
  use Image::ExifTool qw(:DataAccess :Utils);
38
38
 
39
- $VERSION = '1.62';
39
+ $VERSION = '1.63';
40
40
 
41
41
  sub ProcessPNG_tEXt($$$);
42
42
  sub ProcessPNG_iTXt($$$);
@@ -1374,6 +1374,7 @@ sub ProcessPNG($$)
1374
1374
  my $datCount = 0;
1375
1375
  my $datBytes = 0;
1376
1376
  my $fastScan = $et->Options('FastScan');
1377
+ my $md5 = $$et{ImageDataMD5};
1377
1378
  my ($n, $sig, $err, $hbuf, $dbuf, $cbuf);
1378
1379
  my ($wasHdr, $wasEnd, $wasDat, $doTxt, @txtOffset);
1379
1380
 
@@ -1453,6 +1454,7 @@ sub ProcessPNG($$)
1453
1454
  if ($datCount and $chunk ne $datChunk) {
1454
1455
  my $s = $datCount > 1 ? 's' : '';
1455
1456
  print $out "$fileType $datChunk ($datCount chunk$s, total $datBytes bytes)\n";
1457
+ print $out "$$et{INDENT}(ImageDataMD5: $datBytes bytes of $datChunk data)\n" if $md5;
1456
1458
  $datCount = $datBytes = 0;
1457
1459
  }
1458
1460
  }
@@ -1539,7 +1541,17 @@ sub ProcessPNG($$)
1539
1541
  }
1540
1542
  # skip over data chunks if possible/necessary
1541
1543
  } elsif (not $validate or $len > $chunkSizeLimit) {
1542
- $raf->Seek($len + 4, 1) or $et->Warn('Seek error'), last;
1544
+ if ($md5) {
1545
+ while ($len) {
1546
+ my $n = $len > 65536 ? 65536 : $len;
1547
+ $raf->Read($dbuf,$n) == $n or last;
1548
+ $md5->add($dbuf);
1549
+ $len -= $n;
1550
+ }
1551
+ $raf->Read($cbuf, 4) == 4 or $et->Warn('Truncated data'), last;
1552
+ } else {
1553
+ $raf->Seek($len + 4, 1) or $et->Warn('Seek error'), last;
1554
+ }
1543
1555
  next;
1544
1556
  }
1545
1557
  } elsif ($wasDat and $isTxtChunk{$chunk}) {
@@ -1558,6 +1570,7 @@ sub ProcessPNG($$)
1558
1570
  $et->Warn("Corrupted $fileType image") unless $wasEnd;
1559
1571
  last;
1560
1572
  }
1573
+ $md5->add($dbuf) if $md5 and $datChunk; # add to MD5 if necessary
1561
1574
  if ($verbose or $validate or ($outfile and not $fastScan)) {
1562
1575
  # check CRC when in verbose mode (since we don't care about speed)
1563
1576
  my $crc = CalculateCRC(\$hbuf, undef, 4);
@@ -21,7 +21,7 @@ use vars qw($VERSION);
21
21
  use Image::ExifTool qw(:DataAccess :Utils);
22
22
  use Image::ExifTool::Exif;
23
23
 
24
- $VERSION = '1.27';
24
+ $VERSION = '1.28';
25
25
 
26
26
  sub ProcessJpgFromRaw($$$);
27
27
  sub WriteJpgFromRaw($$$);
@@ -266,6 +266,7 @@ my %panasonicWhiteBalance = ( #forum9396
266
266
  PanasonicHack => 1,
267
267
  OffsetPair => 0x117, # (use StripByteCounts as the offset pair)
268
268
  NotRealPair => 1, # (to avoid Validate warning)
269
+ IsImageData => 1,
269
270
  },
270
271
  0x119 => {
271
272
  Name => 'DistortionInfo',
@@ -296,6 +297,20 @@ my %panasonicWhiteBalance = ( #forum9396
296
297
  },
297
298
  },
298
299
  # 0x122 - int32u: RAWDataOffset for the GH5s/GX9, or pointer to end of raw data for G9 (forum9295)
300
+ 0x127 => { #github193 (newer models)
301
+ Name => 'JpgFromRaw2',
302
+ Groups => { 2 => 'Preview' },
303
+ DataTag => 'JpgFromRaw2',
304
+ RawConv => '$self->ValidateImage(\$val,$tag)',
305
+ },
306
+ 0x13b => {
307
+ Name => 'Artist',
308
+ Groups => { 2 => 'Author' },
309
+ Permanent => 1, # (so we don't add it if the model doesn't write it)
310
+ Writable => 'string',
311
+ WriteGroup => 'IFD0',
312
+ RawConv => '$val =~ s/\s+$//; $val', # trim trailing blanks
313
+ },
299
314
  0x2bc => { # PH Extension!!
300
315
  Name => 'ApplicationNotes', # (writable directory!)
301
316
  Writable => 'int8u',
@@ -318,6 +333,17 @@ my %panasonicWhiteBalance = ( #forum9396
318
333
  noise-reduction strengths the R, G and B channels
319
334
  },
320
335
  },
336
+ 0x8298 => { #github193
337
+ Name => 'Copyright',
338
+ Groups => { 2 => 'Author' },
339
+ Permanent => 1, # (so we don't add it if the model doesn't write it)
340
+ Format => 'undef',
341
+ Writable => 'string',
342
+ WriteGroup => 'IFD0',
343
+ RawConv => $Image::ExifTool::Exif::Main{0x8298}{RawConv},
344
+ RawConvInv => $Image::ExifTool::Exif::Main{0x8298}{RawConvInv},
345
+ PrintConvInv => $Image::ExifTool::Exif::Main{0x8298}{PrintConvInv},
346
+ },
321
347
  0x83bb => { # PH Extension!!
322
348
  Name => 'IPTC-NAA', # (writable directory!)
323
349
  Format => 'undef', # convert binary values as undef
@@ -58,7 +58,7 @@ use Image::ExifTool::Exif;
58
58
  use Image::ExifTool::GPS;
59
59
  use Image::ExifTool::HP;
60
60
 
61
- $VERSION = '3.41';
61
+ $VERSION = '3.42';
62
62
 
63
63
  sub CryptShutterCount($$);
64
64
  sub PrintFilter($$$);
@@ -72,10 +72,7 @@ sub DecodeAFPoints($$$$;$);
72
72
  Notes => q{
73
73
  The first number gives the series of the lens, and the second identifies the
74
74
  lens model. Note that newer series numbers may not always be properly
75
- identified by cameras running older firmware versions. Decimal values have
76
- been added to differentiate lenses which would otherwise have the same
77
- LensType, and are used by the Composite LensID tag when attempting to
78
- identify the specific lens model.
75
+ identified by cameras running older firmware versions.
79
76
  },
80
77
  OTHER => sub {
81
78
  my ($val, $inv, $conv) = @_;
@@ -4081,6 +4078,7 @@ my %binaryDataAttrs = (
4081
4078
  ValueConvInv => '$val=~s/\.\d+$//; $val',
4082
4079
  PrintConv => \%pentaxLensTypes,
4083
4080
  SeparateTable => 1,
4081
+ PrintInt => 1,
4084
4082
  },
4085
4083
  3 => { #PH
4086
4084
  Name => 'ExtenderStatus',
@@ -4104,6 +4102,7 @@ my %binaryDataAttrs = (
4104
4102
  ValueConvInv => '$val=~s/\.\d+$//; $val',
4105
4103
  PrintConv => \%pentaxLensTypes,
4106
4104
  SeparateTable => 1,
4105
+ PrintInt => 1,
4107
4106
  },
4108
4107
  3 => {
4109
4108
  Name => 'LensData',
@@ -4139,6 +4138,7 @@ my %binaryDataAttrs = (
4139
4138
  },
4140
4139
  PrintConv => \%pentaxLensTypes,
4141
4140
  SeparateTable => 1,
4141
+ PrintInt => 1,
4142
4142
  },
4143
4143
  4 => {
4144
4144
  Name => 'LensData',
@@ -4174,6 +4174,7 @@ my %binaryDataAttrs = (
4174
4174
  },
4175
4175
  PrintConv => \%pentaxLensTypes,
4176
4176
  SeparateTable => 1,
4177
+ PrintInt => 1,
4177
4178
  },
4178
4179
  13 => {
4179
4180
  Name => 'LensData',
@@ -4209,6 +4210,7 @@ my %binaryDataAttrs = (
4209
4210
  },
4210
4211
  PrintConv => \%pentaxLensTypes,
4211
4212
  SeparateTable => 1,
4213
+ PrintInt => 1,
4212
4214
  },
4213
4215
  12 => {
4214
4216
  Name => 'LensData',
@@ -4245,6 +4247,7 @@ my %binaryDataAttrs = (
4245
4247
  },
4246
4248
  PrintConv => \%pentaxLensTypes,
4247
4249
  SeparateTable => 1,
4250
+ PrintInt => 1,
4248
4251
  },
4249
4252
  15 => {
4250
4253
  Name => 'LensData',
@@ -15,7 +15,7 @@ use vars qw($VERSION);
15
15
  use Image::ExifTool qw(:DataAccess :Utils);
16
16
  use Image::ExifTool::Exif;
17
17
 
18
- $VERSION = '1.07';
18
+ $VERSION = '1.08';
19
19
 
20
20
  sub WritePhaseOne($$$);
21
21
  sub ProcessPhaseOne($$$);
@@ -84,6 +84,7 @@ my @formatName = ( undef, 'string', 'int16s', undef, 'int32s' );
84
84
  Name => 'RawData',
85
85
  Format => 'undef', # (actually 2-byte integers, but don't convert)
86
86
  Binary => 1,
87
+ IsImageData => 1,
87
88
  PutFirst => 1,
88
89
  Writable => 0,
89
90
  Drop => 1, # don't copy to other file types
@@ -584,6 +585,7 @@ sub ProcessPhaseOne($$$)
584
585
  my $dirLen = $$dirInfo{DirLen} || $$dirInfo{DataLen} - $dirStart;
585
586
  my $binary = $et->Options('Binary');
586
587
  my $verbose = $et->Options('Verbose');
588
+ my $md5 = $$et{ImageDataMD5};
587
589
  my $htmlDump = $$et{HTML_DUMP};
588
590
 
589
591
  return 0 if $dirLen < 12;
@@ -676,6 +678,17 @@ sub ProcessPhaseOne($$$)
676
678
  }
677
679
  }
678
680
  }
681
+ if ($md5 and $tagInfo and $$tagInfo{IsImageData}) {
682
+ my ($pos, $len) = ($valuePtr, $size);
683
+ while ($len) {
684
+ my $n = $len > 65536 ? 65536 : $len;
685
+ my $tmp = substr($$dataPt, $pos, $n);
686
+ $md5->add($tmp);
687
+ $len -= $n;
688
+ $pos += $n;
689
+ }
690
+ $et->VPrint(0, "$$et{INDENT}(ImageDataMD5: $size bytes of PhaseOne:$$tagInfo{Name})\n");
691
+ }
679
692
  my %parms = (
680
693
  DirName => $ifdType,
681
694
  Index => $index,
@@ -28,7 +28,7 @@ use strict;
28
28
  use vars qw($VERSION $AUTOLOAD $iptcDigestInfo %printFlags);
29
29
  use Image::ExifTool qw(:DataAccess :Utils);
30
30
 
31
- $VERSION = '1.68';
31
+ $VERSION = '1.69';
32
32
 
33
33
  sub ProcessPhotoshop($$$);
34
34
  sub WritePhotoshop($$$);
@@ -74,7 +74,7 @@ my %thumbnailInfo = (
74
74
  my @tags = qw{ImageWidth ImageHeight FileType};
75
75
  my $info = $et->ImageInfo(\$val, @tags);
76
76
  my ($w, $h, $type) = @$info{@tags};
77
- $w and $h and $type eq 'JPEG' or warn("Not a valid JPEG image\n"), return undef;
77
+ $w and $h and $type and $type eq 'JPEG' or warn("Not a valid JPEG image\n"), return undef;
78
78
  my $wbytes = int(($w * 24 + 31) / 32) * 4;
79
79
  return pack('N6n2', 1, $w, $h, $wbytes, $wbytes * $h, length($val), 24, 1) . $val;
80
80
  },
@@ -706,7 +706,7 @@ sub ProcessLayersAndMask($$$)
706
706
  local $_;
707
707
  my ($et, $dirInfo, $tagTablePtr) = @_;
708
708
  my $raf = $$dirInfo{RAF};
709
- my $fileType = $$et{VALUE}{FileType};
709
+ my $fileType = $$et{FileType};
710
710
  my $data;
711
711
 
712
712
  return 0 unless $fileType eq 'PSD' or $fileType eq 'PSB'; # (no layer section in CS1 files)
@@ -47,7 +47,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
47
47
  use Image::ExifTool::Exif;
48
48
  use Image::ExifTool::GPS;
49
49
 
50
- $VERSION = '2.83';
50
+ $VERSION = '2.84';
51
51
 
52
52
  sub ProcessMOV($$;$);
53
53
  sub ProcessKeys($$$);
@@ -447,15 +447,16 @@ my %dupDirOK = ( ipco => 1, '----' => 1 );
447
447
  my %eeStd = ( stco => 'stbl', co64 => 'stbl', stsz => 'stbl', stz2 => 'stbl',
448
448
  stsc => 'stbl', stts => 'stbl' );
449
449
 
450
+ # atoms required for generating ImageDataMD5
451
+ my %md5Box = ( vide => { %eeStd }, soun => { %eeStd } );
452
+
450
453
  # boxes and their containers for the various handler types that we want to save
451
454
  # when the ExtractEmbedded is enabled (currently only the 'gps ' container name is
452
455
  # used, but others have been checked against all available sample files and may be
453
456
  # useful in the future if the names are used for different boxes on other locations)
454
457
  my %eeBox = (
455
458
  # (note: vide is only processed if specific atoms exist in the VideoSampleDesc)
456
- vide => { %eeStd,
457
- JPEG => 'stsd',
458
- },
459
+ vide => { %eeStd, JPEG => 'stsd' },
459
460
  text => { %eeStd },
460
461
  meta => { %eeStd },
461
462
  sbtl => { %eeStd },
@@ -1976,7 +1977,7 @@ my %eeBox2 = (
1976
1977
  Name => 'SanyoMOV',
1977
1978
  Condition => q{
1978
1979
  $$valPt =~ /^SANYO DIGITAL CAMERA\0/ and
1979
- $self->{VALUE}->{FileType} eq "MOV"
1980
+ $$self{FileType} eq "MOV"
1980
1981
  },
1981
1982
  SubDirectory => {
1982
1983
  TagTable => 'Image::ExifTool::Sanyo::MOV',
@@ -1987,7 +1988,7 @@ my %eeBox2 = (
1987
1988
  Name => 'SanyoMP4',
1988
1989
  Condition => q{
1989
1990
  $$valPt =~ /^SANYO DIGITAL CAMERA\0/ and
1990
- $self->{VALUE}->{FileType} eq "MP4"
1991
+ $$self{FileType} eq "MP4"
1991
1992
  },
1992
1993
  SubDirectory => {
1993
1994
  TagTable => 'Image::ExifTool::Sanyo::MP4',
@@ -7161,7 +7162,7 @@ my %eeBox2 = (
7161
7162
  $$self{AudioFormat} = $val;
7162
7163
  return undef unless $val =~ /^[\w ]{4}$/i;
7163
7164
  # check for protected audio format
7164
- $self->OverrideFileType('M4P') if $val eq 'drms' and $$self{VALUE}{FileType} eq 'M4A';
7165
+ $self->OverrideFileType('M4P') if $val eq 'drms' and $$self{FileType} eq 'M4A';
7165
7166
  return $val;
7166
7167
  },
7167
7168
  # see this link for print conversions (not complete):
@@ -9285,7 +9286,8 @@ sub ProcessMOV($$;$)
9285
9286
  $$raf{NoBuffer} = 1 if $fast; # disable buffering in FastScan mode
9286
9287
 
9287
9288
  my $ee = $$et{OPTIONS}{ExtractEmbedded};
9288
- if ($ee) {
9289
+ my $md5 = $$et{ImageDataMD5};
9290
+ if ($ee or $md5) {
9289
9291
  $unkOpt = $$et{OPTIONS}{Unknown};
9290
9292
  require 'Image/ExifTool/QuickTimeStream.pl';
9291
9293
  }
@@ -9367,7 +9369,7 @@ sub ProcessMOV($$;$)
9367
9369
  # set flag to store additional information for ExtractEmbedded option
9368
9370
  my $handlerType = $$et{HandlerType};
9369
9371
  if ($eeBox{$handlerType} and $eeBox{$handlerType}{$tag}) {
9370
- if ($ee) {
9372
+ if ($ee or $md5) {
9371
9373
  # (there is another 'gps ' box with a track log that doesn't contain offsets)
9372
9374
  if ($tag ne 'gps ' or $eeBox{$handlerType}{$tag} eq $dirID) {
9373
9375
  $eeTag = 1;
@@ -9379,6 +9381,9 @@ sub ProcessMOV($$;$)
9379
9381
  } elsif ($ee and $ee > 1 and $eeBox2{$handlerType} and $eeBox2{$handlerType}{$tag}) {
9380
9382
  $eeTag = 1;
9381
9383
  $$et{OPTIONS}{Unknown} = 1;
9384
+ } elsif ($md5 and $md5Box{$handlerType} and $md5Box{$handlerType}{$tag}) {
9385
+ $eeTag = 1;
9386
+ $$et{OPTIONS}{Unknown} = 1;
9382
9387
  }
9383
9388
  my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
9384
9389
 
@@ -9611,7 +9616,7 @@ ItemID: foreach $id (keys %$items) {
9611
9616
  }
9612
9617
  if ($tag eq 'stbl') {
9613
9618
  # process sample data when exiting SampleTable box if extracting embedded
9614
- ProcessSamples($et) if $ee;
9619
+ ProcessSamples($et) if $ee or $md5;
9615
9620
  } elsif ($tag eq 'minf') {
9616
9621
  $$et{HandlerType} = ''; # reset handler type at end of media info box
9617
9622
  }
@@ -9809,7 +9814,7 @@ ItemID: foreach $id (keys %$items) {
9809
9814
  ++$index if defined $index;
9810
9815
  }
9811
9816
  # tweak file type based on track content ("iso*" and "dash" ftyp only)
9812
- if ($topLevel and $$et{VALUE}{FileType} and $$et{VALUE}{FileType} eq 'MP4' and
9817
+ if ($topLevel and $$et{FileType} and $$et{FileType} eq 'MP4' and
9813
9818
  $$et{save_ftyp} and $$et{HasHandler} and $$et{save_ftyp} =~ /^(iso|dash)/ and
9814
9819
  $$et{HasHandler}{soun} and not $$et{HasHandler}{vide})
9815
9820
  {
@@ -599,6 +599,8 @@ my %insvLimit = (
599
599
  0x1a => 'Firmware',
600
600
  0x2a => {
601
601
  Name => 'Parameters',
602
+ # (see https://exiftool.org/forum/index.php?msg=78942)
603
+ Notes => 'number of lenses, 6-axis orientation of each lens, raw resolution',
602
604
  ValueConv => '$val =~ tr/_/ /; $val',
603
605
  },
604
606
  );
@@ -1125,23 +1127,37 @@ sub Process_text($$$;$)
1125
1127
  # Inputs: 0) ExifTool ref
1126
1128
  # Notes: Also accesses ExifTool RAF*, SET_GROUP1, HandlerType, MetaFormat,
1127
1129
  # ee*, and avcC elements (* = must exist)
1130
+ # - may be called either due to ExtractEmbedded option, or ImageDataMD5 requested
1131
+ # - MD5 includes only video and audio data
1128
1132
  sub ProcessSamples($)
1129
1133
  {
1130
1134
  my $et = shift;
1131
1135
  my ($raf, $ee) = @$et{qw(RAF ee)};
1132
- my ($i, $buff, $pos, $hdrLen, $hdrFmt, @time, @dur, $oldIndent);
1136
+ my ($i, $buff, $pos, $hdrLen, $hdrFmt, @time, @dur, $oldIndent, $md5);
1133
1137
 
1134
1138
  return unless $ee;
1135
1139
  delete $$et{ee}; # use only once
1136
1140
 
1137
- # only process specific types of video streams
1141
+ my $eeOpt = $et->Options('ExtractEmbedded');
1138
1142
  my $type = $$et{HandlerType} || '';
1139
1143
  if ($type eq 'vide') {
1140
- if ($$ee{avcC}) { $type = 'avcC' }
1141
- elsif ($$ee{JPEG}) { $type = 'JPEG' }
1142
- else { return }
1144
+ # only process specific types of video streams
1145
+ $md5 = $$et{ImageDataMD5};
1146
+ # only process specific video types if ExtractEmbedded was used
1147
+ # (otherwise we are only here to calculate the audio/video MD5)
1148
+ if ($eeOpt) {
1149
+ if ($$ee{avcC}) { $type = 'avcC' }
1150
+ elsif ($$ee{JPEG}) { $type = 'JPEG' }
1151
+ else { return unless $md5 }
1152
+ }
1153
+ } elsif ($type eq 'soun') {
1154
+ $md5 = $$et{ImageDataMD5};
1155
+ return unless $md5;
1156
+ } else {
1157
+ return unless $eeOpt; # (don't do MD5 on other types)
1143
1158
  }
1144
1159
 
1160
+ my $md5size = 0;
1145
1161
  my ($start, $size) = @$ee{qw(start size)};
1146
1162
  #
1147
1163
  # determine sample start offsets from chunk offsets (stco) and sample-to-chunk table (stsc),
@@ -1160,13 +1176,16 @@ sub ProcessSamples($)
1160
1176
  $timeDelta = shift @$stts;
1161
1177
  }
1162
1178
  my $ts = $$et{MediaTS} || 1;
1179
+ my @chunkSize; # total size of each chunk
1163
1180
  foreach $chunkStart (@$stco) {
1164
1181
  if ($iChunk >= $nextChunk and @$stsc) {
1165
1182
  ($startChunk, $samplesPerChunk, $descIdx) = @{shift @$stsc};
1166
1183
  $nextChunk = $$stsc[0][0] if @$stsc;
1167
1184
  }
1168
1185
  @$size < @$start + $samplesPerChunk and $et->WarnOnce('Sample size error'), last;
1186
+ last unless defined $chunkStart and length $chunkStart;
1169
1187
  my $sampleStart = $chunkStart;
1188
+ my $chunkSize = 0;
1170
1189
  Sample: for ($i=0; ; ) {
1171
1190
  push @$start, $sampleStart;
1172
1191
  if (defined $time) {
@@ -1184,12 +1203,19 @@ Sample: for ($i=0; ; ) {
1184
1203
  --$timeCount;
1185
1204
  }
1186
1205
  # (eventually should use the description indices: $descIdx)
1206
+ $chunkSize += $$size[$#$start];
1187
1207
  last if ++$i >= $samplesPerChunk;
1188
1208
  $sampleStart += $$size[$#$start];
1189
1209
  }
1210
+ push @chunkSize, $chunkSize;
1190
1211
  ++$iChunk;
1191
1212
  }
1192
1213
  @$start == @$size or $et->WarnOnce('Incorrect sample start/size count'), return;
1214
+ # process as chunks if we are only interested in calculating MD5
1215
+ if ($type eq 'soun' or $type eq 'vide') {
1216
+ $start = $stco;
1217
+ $size = \@chunkSize;
1218
+ }
1193
1219
  }
1194
1220
  #
1195
1221
  # extract and parse the sample data
@@ -1221,6 +1247,10 @@ Sample: for ($i=0; ; ) {
1221
1247
  my $size = $$size[$i];
1222
1248
  next unless $raf->Seek($$start[$i], 0) and $raf->Read($buff, $size) == $size;
1223
1249
 
1250
+ if ($md5) {
1251
+ $md5->add($buff);
1252
+ $md5size += length $buff;
1253
+ }
1224
1254
  if ($type eq 'avcC') {
1225
1255
  next if length($buff) <= $hdrLen;
1226
1256
  # scan through all NAL units and send them to ParseH264Video()
@@ -1347,6 +1377,8 @@ Sample: for ($i=0; ; ) {
1347
1377
  SetGPSDateTime($et, $tagTbl, $time[$i]) if $$et{FoundGPSLatitude} and not $$et{FoundGPSDateTime};
1348
1378
  }
1349
1379
  if ($verbose) {
1380
+ my $str = $type eq 'soun' ? 'Audio' : 'Video';
1381
+ $et->VPrint(0, "$$et{INDENT}(ImageDataMD5: $md5size bytes of $str data)\n") if $md5size;
1350
1382
  $$et{INDENT} = $oldIndent;
1351
1383
  $et->VPrint(0, "--------------------------\n");
1352
1384
  }
@@ -1488,7 +1520,7 @@ sub ProcessFreeGPS($$$)
1488
1520
  # Kenwood dashcam sometimes stores absolute year and local time
1489
1521
  # (but sometimes year since 2000 and UTC time in same video!)
1490
1522
  require Time::Local;
1491
- my $time = Image::ExifTool::TimeLocal($sec,$min,$hr,$day,$mon-1,$yr-1900);
1523
+ my $time = Image::ExifTool::TimeLocal($sec,$min,$hr,$day,$mon-1,$yr);
1492
1524
  ($sec,$min,$hr,$day,$mon,$yr) = gmtime($time);
1493
1525
  $yr += 1900;
1494
1526
  ++$mon;
@@ -411,6 +411,10 @@ numerical, and generated automatically otherwise.
411
411
 
412
412
  'IsComposite' - flag set for Composite tags
413
413
 
414
+ 'IsImageData' - flag set if this is an image data offset to
415
+ be included in ImageDataMD5 calculation. Must have an
416
+ OffsetPair entry which is the ID of the corresponding size.
417
+
414
418
  'IsOffset' - flag set if the tag represents an offset to some
415
419
  data, and causes value will be adjusted to an absolute file
416
420
  offset. If set to 2, the offset base of the parent directory
@@ -472,6 +476,10 @@ numerical, and generated automatically otherwise.
472
476
  documentation, padded to the number of digits given by the
473
477
  PrintHex value.
474
478
 
479
+ 'PrintInt' - remove decimal part of tag ID in HTML tag name
480
+ documentation. (To avoid confusing ExifTool users because
481
+ the LensType decimal numbers are for internal use only.)
482
+
475
483
  'PrintSort' - causes PrintConv values to be sorted by value
476
484
  rather than key in the HTML tag name documentation.
477
485