exiftool-vendored.exe 12.56.0 → 12.60.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.
Files changed (54) hide show
  1. package/bin/exiftool_files/Changes +80 -5
  2. package/bin/exiftool_files/README +2 -2
  3. package/bin/exiftool_files/config_files/example.config +1 -0
  4. package/bin/exiftool_files/config_files/rotate_regions.config +1 -1
  5. package/bin/exiftool_files/exiftool.pl +174 -99
  6. package/bin/exiftool_files/lib/Image/ExifTool/AIFF.pm +2 -2
  7. package/bin/exiftool_files/lib/Image/ExifTool/APE.pm +2 -2
  8. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +19 -15
  9. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +26 -6
  10. package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +5 -1
  11. package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +28 -2
  12. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +77 -19
  13. package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +32 -10
  14. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +7 -3
  15. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +7 -2
  16. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +30 -7
  17. package/bin/exiftool_files/lib/Image/ExifTool/JPEG.pm +14 -2
  18. package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +5 -5
  19. package/bin/exiftool_files/lib/Image/ExifTool/LIF.pm +10 -2
  20. package/bin/exiftool_files/lib/Image/ExifTool/LNK.pm +5 -4
  21. package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +3 -3
  22. package/bin/exiftool_files/lib/Image/ExifTool/MPEG.pm +2 -2
  23. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +3 -2
  24. package/bin/exiftool_files/lib/Image/ExifTool/Minolta.pm +6 -7
  25. package/bin/exiftool_files/lib/Image/ExifTool/MinoltaRaw.pm +2 -1
  26. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +1003 -907
  27. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +2 -2
  28. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +1 -1
  29. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +88 -6
  30. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +10 -2
  31. package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +27 -1
  32. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +8 -5
  33. package/bin/exiftool_files/lib/Image/ExifTool/PhaseOne.pm +14 -1
  34. package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +38 -7
  35. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +44 -13
  36. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +40 -6
  37. package/bin/exiftool_files/lib/Image/ExifTool/README +19 -2
  38. package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +34 -13
  39. package/bin/exiftool_files/lib/Image/ExifTool/Rawzor.pm +2 -2
  40. package/bin/exiftool_files/lib/Image/ExifTool/Ricoh.pm +2 -1
  41. package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +5 -4
  42. package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +9 -3
  43. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +24 -1
  44. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4678 -4628
  45. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +305 -113
  46. package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +5 -5
  47. package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +42 -0
  48. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +1 -1
  49. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +150 -36
  50. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +19 -4
  51. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +2 -1
  52. package/bin/exiftool_files/lib/Image/ExifTool.pm +195 -42
  53. package/bin/exiftool_files/lib/Image/ExifTool.pod +44 -9
  54. package/package.json +2 -2
@@ -9938,8 +9938,8 @@ my %noYes = ( 0 => 'No', 1 => 'Yes' );
9938
9938
  },
9939
9939
  },
9940
9940
  217 => { Name => 'MovieMultiSelector', %buttonsZ9, Unknown => 1}, # CSg2-h
9941
- 221 => { Name => 'MovieAFSpeed', ValueConv => '$val - 5', ValueConvInv => '$val + 6' }, # CSg6-a
9942
- 223 => { Name => 'MovieAFSpeedApply', rintConv => {0 => 'Always', 1 => 'Only During Recording'},}, # CSg6-b
9941
+ 221 => { Name => 'MovieAFSpeed', ValueConv => '$val - 5', ValueConvInv => '$val + 5' }, # CSg6-a
9942
+ 223 => { Name => 'MovieAFSpeedApply', PrintConv => {0 => 'Always', 1 => 'Only During Recording'},}, # CSg6-b
9943
9943
  225 => { # CSg7
9944
9944
  Name => 'MovieAFTrackingSensitivity',
9945
9945
  PrintConv => {
@@ -1512,7 +1512,7 @@ my %infoZSeries = (
1512
1512
  6 => 'None',
1513
1513
  },
1514
1514
  }],
1515
- 0x0ee => { Name => 'MovieAFSpeed', ValueConv => '$val - 6', ValueConvInv => '$val + 6' }, # CSg4-a (Z7_2)
1515
+ 0x0ee => { Name => 'MovieAFSpeed', ValueConv => '$val - 6', ValueConvInv => '$val + 6' }, # CSg4-a (Z7_2)
1516
1516
  0x0ef => { # CSg4-b (Z7_2)
1517
1517
  Name => 'MovieAFSpeedApply',
1518
1518
  PrintConv => {
@@ -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.79';
43
+ $VERSION = '2.81';
44
44
 
45
45
  sub PrintLensInfo($$$);
46
46
 
@@ -116,6 +116,7 @@ my %olympusLensTypes = (
116
116
  '0 35 10' => 'Olympus M.Zuiko 100-400mm F5.0-6.3', #IB
117
117
  '0 36 10' => 'Olympus M.Zuiko Digital ED 8-25mm F4 Pro', #IB
118
118
  '0 37 10' => 'Olympus M.Zuiko Digital ED 40-150mm F4.0 Pro', #forum3833
119
+ '0 39 10' => 'Olympus M.Zuiko Digital ED 90mm F3.5 Macro IS Pro', #forum3833
119
120
  # Sigma lenses
120
121
  '1 01 00' => 'Sigma 18-50mm F3.5-5.6 DC', #8
121
122
  '1 01 10' => 'Sigma 30mm F2.8 EX DN', #NJ
@@ -3164,21 +3165,38 @@ my %indexInfo = (
3164
3165
  PrintHex => 1,
3165
3166
  ValueConv => '($val & 0x1f) . " " . ($val & 0xffe0)',
3166
3167
  ValueConvInv => 'my @v=split(" ",$val); @v == 2 ? $v[0] + $v[1] : $val',
3167
- PrintConv => [
3168
+ PrintConv => [ # herb values added:
3169
+ # based on code of W.P. in https://exiftool.org/forum/index.php?topic=14144.0
3168
3170
  {
3169
- 0x00 => '(none)',
3170
- 0x01 => 'Center',
3171
+ # 0x00 => '(none)',
3172
+ # 0x01 => 'Center',
3171
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)',
3172
3189
  },
3173
3190
  {
3174
3191
  0x00 => 'Single Target',
3175
3192
  0x40 => 'All Target', # (guess)
3176
3193
  },
3177
3194
  ]
3178
- },{ #11
3195
+ },{ #herb all camera model except E-Mxxx and OM-x
3179
3196
  Name => 'AFPoint',
3197
+ Condition => '$$self{Model} !~ /^(E-M|OM-)/ ',
3180
3198
  Writable => 'int16u',
3181
- Notes => 'other models',
3199
+ Notes => 'models other than E-Mxxx and OM-x',
3182
3200
  RawConv => '($val or $$self{Model} ne "E-P1") ? $val : undef',
3183
3201
  PrintConv => {
3184
3202
  # (E-P1 always writes 0, maybe other models do too - PH)
@@ -3188,9 +3206,73 @@ my %indexInfo = (
3188
3206
  3 => 'Center (vertical)', #6 (E-510)
3189
3207
  255 => 'None',
3190
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',
3191
3213
  }
3192
3214
  ],
3193
3215
  # 0x31a Continuous AF parameters?
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
+ ],
3194
3276
  0x328 => { #PH
3195
3277
  Name => 'AFInfo',
3196
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,12 @@ 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
+ $et->ImageDataMD5($raf, $len);
1546
+ $raf->Read($cbuf, 4) == 4 or $et->Warn('Truncated data'), last;
1547
+ } else {
1548
+ $raf->Seek($len + 4, 1) or $et->Warn('Seek error'), last;
1549
+ }
1543
1550
  next;
1544
1551
  }
1545
1552
  } elsif ($wasDat and $isTxtChunk{$chunk}) {
@@ -1558,6 +1565,7 @@ sub ProcessPNG($$)
1558
1565
  $et->Warn("Corrupted $fileType image") unless $wasEnd;
1559
1566
  last;
1560
1567
  }
1568
+ $md5->add($dbuf) if $md5 and $datChunk; # add to MD5 if necessary
1561
1569
  if ($verbose or $validate or ($outfile and not $fastScan)) {
1562
1570
  # check CRC when in verbose mode (since we don't care about speed)
1563
1571
  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.67';
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
  },
@@ -571,6 +571,13 @@ my %unicodeString = (
571
571
  ValueConv => '100 * $val / 255',
572
572
  PrintConv => 'sprintf("%d%%",$val)',
573
573
  },
574
+ _xvis => {
575
+ Name => 'LayerVisible',
576
+ Format => 'int8u',
577
+ List => 1,
578
+ ValueConv => '$val & 0x02',
579
+ PrintConv => { 0x02 => 'No', 0x00 => 'Yes' },
580
+ },
574
581
  # tags extracted from additional layer information (tag ID's are real)
575
582
  # - must be able to accommodate a blank entry to preserve the list ordering
576
583
  luni => {
@@ -589,6 +596,16 @@ my %unicodeString = (
589
596
  List => 1,
590
597
  Unknown => 1,
591
598
  },
599
+ lclr => {
600
+ Name => 'LayerColors',
601
+ Format => 'int16u',
602
+ Count => 1,
603
+ List => 1,
604
+ PrintConv => {
605
+ 0=>'None', 1=>'Red', 2=>'Orange', 3=>'Yellow',
606
+ 4=>'Green', 5=>'Blue', 6=>'Violet', 7=>'Gray',
607
+ },
608
+ },
592
609
  shmd => { # layer metadata (undocumented structure)
593
610
  # (for now, only extract layerTime. May also contain "layerXMP" --
594
611
  # it would be nice to decode this but I need a sample)
@@ -603,6 +620,13 @@ my %unicodeString = (
603
620
  ValueConv => 'length $val ? ConvertUnixTime($val,1) : ""',
604
621
  PrintConv => 'length $val ? $self->ConvertDateTime($val) : ""',
605
622
  },
623
+ lsct => {
624
+ Name => 'LayerSections',
625
+ Format => 'int32u',
626
+ Count => 1,
627
+ List => 1,
628
+ PrintConv => { 0 => 'Layer', 1 => 'Folder (open)', 2 => 'Folder (closed)', 3 => 'Divider' },
629
+ },
606
630
  );
607
631
 
608
632
  # tags extracted from ImageSourceData found in TIFF images (ref PH)
@@ -682,7 +706,7 @@ sub ProcessLayersAndMask($$$)
682
706
  local $_;
683
707
  my ($et, $dirInfo, $tagTablePtr) = @_;
684
708
  my $raf = $$dirInfo{RAF};
685
- my $fileType = $$et{VALUE}{FileType};
709
+ my $fileType = $$et{FileType};
686
710
  my $data;
687
711
 
688
712
  return 0 unless $fileType eq 'PSD' or $fileType eq 'PSB'; # (no layer section in CS1 files)
@@ -748,17 +772,16 @@ sub ProcessLayers($$$)
748
772
  my $pos = 0;
749
773
  return 0 if $dirLen < 2;
750
774
  $raf->Read($buff, 2) == 2 or return 0;
751
- my $num = Get16s(\$buff, 0);
775
+ my $num = Get16s(\$buff, 0); # number of layers
752
776
  $num = -$num if $num < 0; # (first channel is transparency data if negative)
753
777
  $et->VerboseDir('Layers', $num, $dirLen);
754
778
  $et->HandleTag($tagTablePtr, '_xcnt', $num, Start => $pos, Size => 2, %dinfo); # LayerCount
755
779
  my $oldIndent = $$et{INDENT};
756
780
  $$et{INDENT} .= '| ';
757
-
758
781
  $pos += 2;
759
782
  my $psb = $$et{IsPSB}; # is PSB format?
760
783
  my $psiz = $psb ? 8 : 4;
761
- for ($i=0; $i<$num; ++$i) {
784
+ for ($i=0; $i<$num; ++$i) { # process each layer
762
785
  $et->VPrint(0, $oldIndent.'+ [Layer '.($i+1)." of $num]\n");
763
786
  last if $pos + 18 > $dirLen;
764
787
  $raf->Read($buff, 18) == 18 or last;
@@ -776,6 +799,7 @@ sub ProcessLayers($$$)
776
799
  $sig =~ /^(8BIM|MIB8)$/ or last; # verify signature
777
800
  $et->HandleTag($tagTablePtr, '_xbnd', undef, Start => 4, Size => 4, %dinfo);
778
801
  $et->HandleTag($tagTablePtr, '_xopc', undef, Start => 8, Size => 1, %dinfo);
802
+ $et->HandleTag($tagTablePtr, '_xvis', undef, Start =>10, Size => 1, %dinfo);
779
803
  my $nxt = $pos + 16 + Get32u(\$buff, 12);
780
804
  $n = Get32u(\$buff, 16); # get size of layer mask data
781
805
  $pos += 20 + $n; # skip layer mask data
@@ -823,7 +847,7 @@ sub ProcessLayers($$$)
823
847
  $raf->Read($buff, $n) == $n or last;
824
848
  $dinfo{DataPos} = $pos;
825
849
  while ($count{$tag} < $i) {
826
- $et->HandleTag($tagTablePtr, $tag, '');
850
+ $et->HandleTag($tagTablePtr, $tag, $tag eq 'lsct' ? 0 : '');
827
851
  ++$count{$tag};
828
852
  }
829
853
  $et->HandleTag($tagTablePtr, $tag, undef, Start => 0, Size => $n, %dinfo);
@@ -840,6 +864,13 @@ sub ProcessLayers($$$)
840
864
  }
841
865
  $pos = $nxt;
842
866
  }
867
+ # pad lists if necessary to have an entry for each layer
868
+ foreach (sort keys %count) {
869
+ while ($count{$_} < $num) {
870
+ $et->HandleTag($tagTablePtr, $_, $_ eq 'lsct' ? 0 : '');
871
+ ++$count{$_};
872
+ }
873
+ }
843
874
  $$et{INDENT} = $oldIndent;
844
875
  return 1;
845
876
  }
@@ -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($$$);
@@ -419,6 +419,18 @@ my %channelLabel = (
419
419
  0x1ffff => 'Discrete_65535',
420
420
  );
421
421
 
422
+ my %qtFlags = ( #12
423
+ 0 => 'undef', 22 => 'unsigned int', 71 => 'float[2] size',
424
+ 1 => 'UTF-8', 23 => 'float', 72 => 'float[4] rect',
425
+ 2 => 'UTF-16', 24 => 'double', 74 => 'int64s',
426
+ 3 => 'ShiftJIS', 27 => 'BMP', 75 => 'int8u',
427
+ 4 => 'UTF-8 sort', 28 => 'QT atom', 76 => 'int16u',
428
+ 5 => 'UTF-16 sort', 65 => 'int8s', 77 => 'int32u',
429
+ 13 => 'JPEG', 66 => 'int16s', 78 => 'int64u',
430
+ 14 => 'PNG', 67 => 'int32s', 79 => 'double[3][3]',
431
+ 21 => 'signed int', 70 => 'float[2] point',
432
+ );
433
+
422
434
  # properties which don't get inherited from the parent
423
435
  my %dontInherit = (
424
436
  ispe => 1, # size of parent may be different
@@ -435,15 +447,16 @@ my %dupDirOK = ( ipco => 1, '----' => 1 );
435
447
  my %eeStd = ( stco => 'stbl', co64 => 'stbl', stsz => 'stbl', stz2 => 'stbl',
436
448
  stsc => 'stbl', stts => 'stbl' );
437
449
 
450
+ # atoms required for generating ImageDataMD5
451
+ my %md5Box = ( vide => { %eeStd }, soun => { %eeStd } );
452
+
438
453
  # boxes and their containers for the various handler types that we want to save
439
454
  # when the ExtractEmbedded is enabled (currently only the 'gps ' container name is
440
455
  # used, but others have been checked against all available sample files and may be
441
456
  # useful in the future if the names are used for different boxes on other locations)
442
457
  my %eeBox = (
443
458
  # (note: vide is only processed if specific atoms exist in the VideoSampleDesc)
444
- vide => { %eeStd,
445
- JPEG => 'stsd',
446
- },
459
+ vide => { %eeStd, JPEG => 'stsd' },
447
460
  text => { %eeStd },
448
461
  meta => { %eeStd },
449
462
  sbtl => { %eeStd },
@@ -1159,7 +1172,10 @@ my %eeBox2 = (
1159
1172
  },
1160
1173
  {
1161
1174
  Name => 'GarminGPS',
1162
- Condition => '$$valPt=~/^\x9b\x63\x0f\x8d\x63\x74\x40\xec\x82\x04\xbc\x5f\xf5\x09\x17\x28/ and $$self{OPTIONS}{ExtractEmbedded}',
1175
+ Condition => q{
1176
+ $$valPt=~/^\x9b\x63\x0f\x8d\x63\x74\x40\xec\x82\x04\xbc\x5f\xf5\x09\x17\x28/ and
1177
+ $$self{OPTIONS}{ExtractEmbedded}
1178
+ },
1163
1179
  SubDirectory => {
1164
1180
  TagTable => 'Image::ExifTool::QuickTime::Stream',
1165
1181
  ProcessProc => \&ProcessGarminGPS,
@@ -1961,7 +1977,7 @@ my %eeBox2 = (
1961
1977
  Name => 'SanyoMOV',
1962
1978
  Condition => q{
1963
1979
  $$valPt =~ /^SANYO DIGITAL CAMERA\0/ and
1964
- $self->{VALUE}->{FileType} eq "MOV"
1980
+ $$self{FileType} eq "MOV"
1965
1981
  },
1966
1982
  SubDirectory => {
1967
1983
  TagTable => 'Image::ExifTool::Sanyo::MOV',
@@ -1972,7 +1988,7 @@ my %eeBox2 = (
1972
1988
  Name => 'SanyoMP4',
1973
1989
  Condition => q{
1974
1990
  $$valPt =~ /^SANYO DIGITAL CAMERA\0/ and
1975
- $self->{VALUE}->{FileType} eq "MP4"
1991
+ $$self{FileType} eq "MP4"
1976
1992
  },
1977
1993
  SubDirectory => {
1978
1994
  TagTable => 'Image::ExifTool::Sanyo::MP4',
@@ -7146,7 +7162,7 @@ my %eeBox2 = (
7146
7162
  $$self{AudioFormat} = $val;
7147
7163
  return undef unless $val =~ /^[\w ]{4}$/i;
7148
7164
  # check for protected audio format
7149
- $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';
7150
7166
  return $val;
7151
7167
  },
7152
7168
  # see this link for print conversions (not complete):
@@ -8768,6 +8784,16 @@ sub HandleItemInfo($)
8768
8784
  $et->VPrint(0, "$$et{INDENT} [snip $snip bytes]\n") if $snip;
8769
8785
  }
8770
8786
  }
8787
+ # do MD5 checksum of AVIF "av01" image data
8788
+ if ($type eq 'av01' and $$et{ImageDataMD5}) {
8789
+ my $md5 = $$et{ImageDataMD5};
8790
+ my $tot = 0;
8791
+ foreach $extent (@{$$item{Extents}}) {
8792
+ $raf->Seek($$extent[1] + $base, 0) or $et->Warn('Seek error in av01 image data'), last;
8793
+ $tot += $et->ImageDataMD5($raf, $$extent[2], 'av01 image', 1);
8794
+ }
8795
+ $et->VPrint(0, "$$et{INDENT}(ImageDataMD5: $tot bytes of av01 data)\n") if $tot;
8796
+ }
8771
8797
  next unless $name;
8772
8798
  # assemble the data for this item
8773
8799
  undef $buff;
@@ -9270,7 +9296,8 @@ sub ProcessMOV($$;$)
9270
9296
  $$raf{NoBuffer} = 1 if $fast; # disable buffering in FastScan mode
9271
9297
 
9272
9298
  my $ee = $$et{OPTIONS}{ExtractEmbedded};
9273
- if ($ee) {
9299
+ my $md5 = $$et{ImageDataMD5};
9300
+ if ($ee or $md5) {
9274
9301
  $unkOpt = $$et{OPTIONS}{Unknown};
9275
9302
  require 'Image/ExifTool/QuickTimeStream.pl';
9276
9303
  }
@@ -9352,7 +9379,7 @@ sub ProcessMOV($$;$)
9352
9379
  # set flag to store additional information for ExtractEmbedded option
9353
9380
  my $handlerType = $$et{HandlerType};
9354
9381
  if ($eeBox{$handlerType} and $eeBox{$handlerType}{$tag}) {
9355
- if ($ee) {
9382
+ if ($ee or $md5) {
9356
9383
  # (there is another 'gps ' box with a track log that doesn't contain offsets)
9357
9384
  if ($tag ne 'gps ' or $eeBox{$handlerType}{$tag} eq $dirID) {
9358
9385
  $eeTag = 1;
@@ -9364,6 +9391,9 @@ sub ProcessMOV($$;$)
9364
9391
  } elsif ($ee and $ee > 1 and $eeBox2{$handlerType} and $eeBox2{$handlerType}{$tag}) {
9365
9392
  $eeTag = 1;
9366
9393
  $$et{OPTIONS}{Unknown} = 1;
9394
+ } elsif ($md5 and $md5Box{$handlerType} and $md5Box{$handlerType}{$tag}) {
9395
+ $eeTag = 1;
9396
+ $$et{OPTIONS}{Unknown} = 1;
9367
9397
  }
9368
9398
  my $tagInfo = $et->GetTagInfo($tagTablePtr, $tag);
9369
9399
 
@@ -9596,7 +9626,7 @@ ItemID: foreach $id (keys %$items) {
9596
9626
  }
9597
9627
  if ($tag eq 'stbl') {
9598
9628
  # process sample data when exiting SampleTable box if extracting embedded
9599
- ProcessSamples($et) if $ee;
9629
+ ProcessSamples($et) if $ee or $md5;
9600
9630
  } elsif ($tag eq 'minf') {
9601
9631
  $$et{HandlerType} = ''; # reset handler type at end of media info box
9602
9632
  }
@@ -9656,6 +9686,7 @@ ItemID: foreach $id (keys %$items) {
9656
9686
  }
9657
9687
  }
9658
9688
  $langInfo or $langInfo = $tagInfo;
9689
+ my $str = $qtFlags{$flags} ? " ($qtFlags{$flags})" : '';
9659
9690
  $et->VerboseInfo($tag, $langInfo,
9660
9691
  Value => ref $value ? $$value : $value,
9661
9692
  DataPt => \$val,
@@ -9664,7 +9695,7 @@ ItemID: foreach $id (keys %$items) {
9664
9695
  Size => $len,
9665
9696
  Format => $format,
9666
9697
  Index => $index,
9667
- Extra => sprintf(", Type='${type}', Flags=0x%x, Lang=0x%.4x",$flags,$lang),
9698
+ Extra => sprintf(", Type='${type}', Flags=0x%x%s, Lang=0x%.4x",$flags,$str,$lang),
9668
9699
  ) if $verbose;
9669
9700
  # use "Keys" in path instead of ItemList if this was defined by a Keys tag
9670
9701
  my $isKey = $$tagInfo{Groups} && $$tagInfo{Groups}{1} && $$tagInfo{Groups}{1} eq 'Keys';
@@ -9793,7 +9824,7 @@ ItemID: foreach $id (keys %$items) {
9793
9824
  ++$index if defined $index;
9794
9825
  }
9795
9826
  # tweak file type based on track content ("iso*" and "dash" ftyp only)
9796
- if ($topLevel and $$et{VALUE}{FileType} and $$et{VALUE}{FileType} eq 'MP4' and
9827
+ if ($topLevel and $$et{FileType} and $$et{FileType} eq 'MP4' and
9797
9828
  $$et{save_ftyp} and $$et{HasHandler} and $$et{save_ftyp} =~ /^(iso|dash)/ and
9798
9829
  $$et{HasHandler}{soun} and not $$et{HasHandler}{vide})
9799
9830
  {