exiftool-vendored.exe 12.56.0 → 12.62.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 (60) hide show
  1. package/bin/exiftool_files/Changes +115 -5
  2. package/bin/exiftool_files/LICENSE +674 -0
  3. package/bin/exiftool_files/README +45 -44
  4. package/bin/exiftool_files/config_files/example.config +1 -0
  5. package/bin/exiftool_files/config_files/rotate_regions.config +1 -1
  6. package/bin/exiftool_files/exiftool.pl +262 -160
  7. package/bin/exiftool_files/lib/Image/ExifTool/AIFF.pm +2 -2
  8. package/bin/exiftool_files/lib/Image/ExifTool/APE.pm +2 -2
  9. package/bin/exiftool_files/lib/Image/ExifTool/BMP.pm +0 -1
  10. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +23 -19
  11. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +26 -6
  12. package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +5 -1
  13. package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +28 -2
  14. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +77 -19
  15. package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +33 -10
  16. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +7 -3
  17. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +7 -2
  18. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +30 -7
  19. package/bin/exiftool_files/lib/Image/ExifTool/JPEG.pm +14 -2
  20. package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +36 -11
  21. package/bin/exiftool_files/lib/Image/ExifTool/LIF.pm +10 -2
  22. package/bin/exiftool_files/lib/Image/ExifTool/LNK.pm +5 -4
  23. package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +3 -3
  24. package/bin/exiftool_files/lib/Image/ExifTool/MPEG.pm +2 -2
  25. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +3 -2
  26. package/bin/exiftool_files/lib/Image/ExifTool/Minolta.pm +6 -7
  27. package/bin/exiftool_files/lib/Image/ExifTool/MinoltaRaw.pm +2 -1
  28. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +1005 -909
  29. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +2 -2
  30. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +1 -1
  31. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +88 -6
  32. package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +17 -8
  33. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +10 -2
  34. package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +27 -1
  35. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +8 -5
  36. package/bin/exiftool_files/lib/Image/ExifTool/PhaseOne.pm +14 -1
  37. package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +38 -7
  38. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +48 -14
  39. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +91 -27
  40. package/bin/exiftool_files/lib/Image/ExifTool/README +19 -2
  41. package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +34 -13
  42. package/bin/exiftool_files/lib/Image/ExifTool/Rawzor.pm +2 -2
  43. package/bin/exiftool_files/lib/Image/ExifTool/Ricoh.pm +2 -1
  44. package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +5 -4
  45. package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +9 -3
  46. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +39 -10
  47. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4687 -4628
  48. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +338 -117
  49. package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +5 -5
  50. package/bin/exiftool_files/lib/Image/ExifTool/WPG.pm +296 -0
  51. package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +42 -0
  52. package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +7 -8
  53. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +1 -1
  54. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +162 -40
  55. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +35 -8
  56. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +2 -1
  57. package/bin/exiftool_files/lib/Image/ExifTool/ZIP.pm +159 -41
  58. package/bin/exiftool_files/lib/Image/ExifTool.pm +286 -65
  59. package/bin/exiftool_files/lib/Image/ExifTool.pod +95 -51
  60. package/package.json +2 -2
@@ -11,6 +11,7 @@
11
11
  # 4) http://DataCompression.info/ArchiveFormats/RAR202.txt
12
12
  # 5) https://jira.atlassian.com/browse/CONF-21706
13
13
  # 6) http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/indesign/cs55-docs/IDML/idml-specification.pdf
14
+ # 7) https://www.rarlab.com/technote.htm
14
15
  #------------------------------------------------------------------------------
15
16
 
16
17
  package Image::ExifTool::ZIP;
@@ -19,7 +20,7 @@ use strict;
19
20
  use vars qw($VERSION $warnString);
20
21
  use Image::ExifTool qw(:DataAccess :Utils);
21
22
 
22
- $VERSION = '1.28';
23
+ $VERSION = '1.29';
23
24
 
24
25
  sub WarnProc($) { $warnString = $_[0]; }
25
26
 
@@ -191,7 +192,7 @@ my %iWorkType = (
191
192
  11 => 'Comment',
192
193
  );
193
194
 
194
- # RAR tags (ref 4)
195
+ # RAR v4 tags (ref 4)
195
196
  %Image::ExifTool::ZIP::RAR = (
196
197
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
197
198
  GROUPS => { 2 => 'Other' },
@@ -254,8 +255,45 @@ my %iWorkType = (
254
255
  },
255
256
  );
256
257
 
258
+ # RAR v5 tags (ref 7, github#203)
259
+ %Image::ExifTool::ZIP::RAR5 = (
260
+ GROUPS => { 2 => 'Other' },
261
+ VARS => { NO_ID => 1 },
262
+ NOTES => 'These tags are extracted from RAR v5 archive files.',
263
+ RARVersion => { },
264
+ CompressedSize => { },
265
+ ModifyDate => {
266
+ Groups => { 2 => 'Time' },
267
+ ValueConv => 'ConvertUnixTime($val,1)',
268
+ PrintConv => '$self->ConvertDateTime($val)',
269
+ },
270
+ UncompressedSize => { },
271
+ OperatingSystem => {
272
+ PrintConv => { 0 => 'Win32', 1 => 'Unix' },
273
+ },
274
+ ArchivedFileName => { },
275
+ );
276
+
277
+ #------------------------------------------------------------------------------
278
+ # Read unsigned LEB (Little Endian Base) from file
279
+ # Inputs: 0) RAF ref
280
+ # Returns: integer value
281
+ sub ReadULEB($)
282
+ {
283
+ my $raf = shift;
284
+ my ($i, $buff);
285
+ my $rtnVal = 0;
286
+ for ($i=0; ; ++$i) {
287
+ $raf->Read($buff, 1) or last;
288
+ my $num = ord($buff);
289
+ $rtnVal += ($num & 0x7f) << ($i * 7);
290
+ $num & 0x80 or last;
291
+ }
292
+ return $rtnVal;
293
+ }
294
+
257
295
  #------------------------------------------------------------------------------
258
- # Extract information from a RAR file (ref 4)
296
+ # Extract information from a RAR file
259
297
  # Inputs: 0) ExifTool object reference, 1) dirInfo reference
260
298
  # Returns: 1 on success, 0 if this wasn't a valid RAR file
261
299
  sub ProcessRAR($$)
@@ -263,51 +301,129 @@ sub ProcessRAR($$)
263
301
  my ($et, $dirInfo) = @_;
264
302
  my $raf = $$dirInfo{RAF};
265
303
  my ($flags, $buff);
304
+ my $docNum = 0;
266
305
 
267
- return 0 unless $raf->Read($buff, 7) and $buff eq "Rar!\x1a\x07\0";
306
+ return 0 unless $raf->Read($buff, 7) and $buff =~ "Rar!\x1a\x07[\0\x01]";
268
307
 
269
- $et->SetFileType();
270
- SetByteOrder('II');
271
- my $tagTablePtr = GetTagTable('Image::ExifTool::ZIP::RAR');
272
- my $docNum = 0;
308
+ if ($buff eq "Rar!\x1a\x07\0") { # RARv4 (ref 4)
273
309
 
274
- for (;;) {
275
- # read block header
276
- $raf->Read($buff, 7) == 7 or last;
277
- my ($type, $flags, $size) = unpack('xxCvv', $buff);
278
- $size -= 7;
279
- if ($flags & 0x8000) {
280
- $raf->Read($buff, 4) == 4 or last;
281
- $size += unpack('V',$buff) - 4;
282
- }
283
- last if $size < 0;
284
- next unless $size; # ignore blocks with no data
285
- # don't try to read very large blocks unless LargeFileSupport is enabled
286
- if ($size >= 0x80000000 and not $et->Options('LargeFileSupport')) {
287
- $et->Warn('Large block encountered. Aborting.');
288
- last;
310
+ $et->SetFileType();
311
+ SetByteOrder('II');
312
+ my $tagTablePtr = GetTagTable('Image::ExifTool::ZIP::RAR5');
313
+ $et->HandleTag($tagTablePtr, 'RARVersion', 4);
314
+ $tagTablePtr = GetTagTable('Image::ExifTool::ZIP::RAR');
315
+
316
+ for (;;) {
317
+ # read block header
318
+ $raf->Read($buff, 7) == 7 or last;
319
+ my ($type, $flags, $size) = unpack('xxCvv', $buff);
320
+ $size -= 7;
321
+ if ($flags & 0x8000) {
322
+ $raf->Read($buff, 4) == 4 or last;
323
+ $size += unpack('V',$buff) - 4;
324
+ }
325
+ last if $size < 0;
326
+ next unless $size; # ignore blocks with no data
327
+ # don't try to read very large blocks unless LargeFileSupport is enabled
328
+ if ($size >= 0x80000000 and not $et->Options('LargeFileSupport')) {
329
+ $et->Warn('Large block encountered. Aborting.');
330
+ last;
331
+ }
332
+ # process the block
333
+ if ($type == 0x74) { # file block
334
+ # read maximum 4 KB from a file block
335
+ my $n = $size > 4096 ? 4096 : $size;
336
+ $raf->Read($buff, $n) == $n or last;
337
+ # add compressed size to start of data so we can extract it with the other tags
338
+ $buff = pack('V',$size) . $buff;
339
+ $$et{DOC_NUM} = ++$docNum;
340
+ $et->ProcessDirectory({ DataPt => \$buff }, $tagTablePtr);
341
+ $size -= $n;
342
+ } elsif ($type == 0x75 and $size > 6) { # comment block
343
+ $raf->Read($buff, $size) == $size or last;
344
+ # save comment, only if "Stored" (this is untested)
345
+ if (Get8u(\$buff, 3) == 0x30) {
346
+ $et->FoundTag('Comment', substr($buff, 6));
347
+ }
348
+ next;
349
+ }
350
+ # seek to the start of the next block
351
+ $raf->Seek($size, 1) or last if $size;
289
352
  }
290
- # process the block
291
- if ($type == 0x74) { # file block
292
- # read maximum 4 KB from a file block
293
- my $n = $size > 4096 ? 4096 : $size;
294
- $raf->Read($buff, $n) == $n or last;
295
- # add compressed size to start of data so we can extract it with the other tags
296
- $buff = pack('V',$size) . $buff;
297
- $$et{DOC_NUM} = ++$docNum;
298
- $et->ProcessDirectory({ DataPt => \$buff }, $tagTablePtr);
299
- $size -= $n;
300
- } elsif ($type == 0x75 and $size > 6) { # comment block
301
- $raf->Read($buff, $size) == $size or last;
302
- # save comment, only if "Stored" (this is untested)
303
- if (Get8u(\$buff, 3) == 0x30) {
304
- $et->FoundTag('Comment', substr($buff, 6));
353
+
354
+ } else { # RARv5 (ref 7, github#203)
355
+
356
+ return 0 unless $raf->Read($buff, 1) and $buff eq "\0";
357
+ $et->SetFileType();
358
+ my $tagTablePtr = GetTagTable('Image::ExifTool::ZIP::RAR5');
359
+ $et->HandleTag($tagTablePtr, 'RARVersion', 5);
360
+ $$et{INDENT} .= '| ';
361
+
362
+ # loop through header blocks
363
+ for (;;) {
364
+ $raf->Seek(4, 1); # skip header CRC
365
+ my $headSize = ReadULEB($raf);
366
+ last if $headSize == 0;
367
+ # read the header and create new RAF object for reading it
368
+ my $header;
369
+ $raf->Read($header, $headSize) == $headSize or last;
370
+ my $rafHdr = new File::RandomAccess(\$header);
371
+ my $headType = ReadULEB($rafHdr); # get header type
372
+
373
+ if ($headType == 4) { # encryption block
374
+ $et->Warn("File is encrypted.", 0);
375
+ last;
305
376
  }
306
- next;
377
+ # skip over all headers except file or service header
378
+ next unless $headType == 2 or $headType == 3;
379
+ $et->VerboseDir('RAR5 file', undef, $headSize) if $headType == 2;
380
+
381
+ my $headFlag = ReadULEB($rafHdr);
382
+ ReadULEB($rafHdr); # skip extraSize
383
+ my $dataSize;
384
+ if ($headFlag & 0x0002) {
385
+ $dataSize = ReadULEB($rafHdr); # compressed data size
386
+ if ($headType == 2) {
387
+ $et->HandleTag($tagTablePtr, 'CompressedSize', $dataSize);
388
+ } else {
389
+ $raf->Seek($dataSize, 1); # skip service data section
390
+ next;
391
+ }
392
+ } else {
393
+ next if $headType == 3; # all done with service header
394
+ $dataSize = 0;
395
+ }
396
+ my $fileFlag = ReadULEB($rafHdr);
397
+ my $uncompressedSize = ReadULEB($rafHdr);
398
+ $et->HandleTag($tagTablePtr, 'UncompressedSize', $uncompressedSize) unless $fileFlag & 0x0008;
399
+ ReadULEB($rafHdr); # skip file attributes
400
+ if ($fileFlag & 0x0002) {
401
+ $rafHdr->Read($buff, 4) == 4 or last;
402
+ # (untested)
403
+ $et->HandleTag($tagTablePtr, 'ModifyDate', unpack('V', $buff));
404
+ }
405
+ $rafHdr->Seek(4, 1) if $fileFlag & 0x0004; # skip CRC if present
406
+
407
+ ReadULEB($rafHdr); # skip compressionInfo
408
+
409
+ # get operating system
410
+ my $os = ReadULEB($rafHdr);
411
+ $et->HandleTag($tagTablePtr, 'OperatingSystem', $os);
412
+
413
+ # get filename
414
+ $rafHdr->Read($buff, 1) == 1 or last;
415
+ my $nameLen = ord($buff);
416
+ $rafHdr->Read($buff, $nameLen) == $nameLen or last;
417
+ $buff =~ s/\0+$//; # remove trailing nulls (if any)
418
+ $et->HandleTag($tagTablePtr, 'ArchivedFileName', $buff);
419
+
420
+ $$et{DOC_NUM} = ++$docNum;
421
+
422
+ $raf->Seek($dataSize, 1); # skip data section
307
423
  }
308
- # seek to the start of the next block
309
- $raf->Seek($size, 1) or last if $size;
424
+ $$et{INDENT} = substr($$et{INDENT}, 0, -2);
310
425
  }
426
+
311
427
  $$et{DOC_NUM} = 0;
312
428
  if ($docNum > 1 and not $et->Options('Duplicates')) {
313
429
  $et->Warn("Use the Duplicates option to extract tags for all $docNum files", 1);
@@ -735,6 +851,8 @@ under the same terms as Perl itself.
735
851
 
736
852
  =item L<http://DataCompression.info/ArchiveFormats/RAR202.txt>
737
853
 
854
+ =item L<https://www.rarlab.com/technote.htm>
855
+
738
856
  =back
739
857
 
740
858
  =head1 SEE ALSO