exiftool-vendored.exe 12.44.0 → 12.49.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 (56) hide show
  1. package/bin/exiftool_files/Changes +112 -3
  2. package/bin/exiftool_files/README +45 -44
  3. package/bin/exiftool_files/config_files/acdsee.config +2 -1
  4. package/bin/exiftool_files/config_files/frameCount.config +56 -0
  5. package/bin/exiftool_files/config_files/tiff_version.config +1 -1
  6. package/bin/exiftool_files/exiftool.pl +77 -66
  7. package/bin/exiftool_files/fmt_files/gpx.fmt +3 -0
  8. package/bin/exiftool_files/fmt_files/gpx_wpt.fmt +3 -0
  9. package/bin/exiftool_files/lib/Image/ExifTool/Apple.pm +6 -2
  10. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +17 -9
  11. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +33 -15
  12. package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +8 -1
  13. package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +7 -8
  14. package/bin/exiftool_files/lib/Image/ExifTool/EXE.pm +9 -1
  15. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +11 -7
  16. package/bin/exiftool_files/lib/Image/ExifTool/FLAC.pm +17 -3
  17. package/bin/exiftool_files/lib/Image/ExifTool/FLIR.pm +4 -3
  18. package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +4 -2
  19. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +31 -5
  20. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +2 -2
  21. package/bin/exiftool_files/lib/Image/ExifTool/ICC_Profile.pm +3 -2
  22. package/bin/exiftool_files/lib/Image/ExifTool/ICO.pm +141 -0
  23. package/bin/exiftool_files/lib/Image/ExifTool/ID3.pm +6 -6
  24. package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +55 -8
  25. package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +9 -3
  26. package/bin/exiftool_files/lib/Image/ExifTool/MISB.pm +494 -0
  27. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +3 -1
  28. package/bin/exiftool_files/lib/Image/ExifTool/Matroska.pm +24 -16
  29. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +39 -31
  30. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +5 -3
  31. package/bin/exiftool_files/lib/Image/ExifTool/Panasonic.pm +21 -4
  32. package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +25 -5
  33. package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +29 -3
  34. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +113 -8
  35. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +44 -6
  36. package/bin/exiftool_files/lib/Image/ExifTool/README +1 -1
  37. package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +106 -9
  38. package/bin/exiftool_files/lib/Image/ExifTool/Samsung.pm +2 -2
  39. package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +27 -1
  40. package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +37 -13
  41. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +8 -3
  42. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +188 -7
  43. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +3051 -2732
  44. package/bin/exiftool_files/lib/Image/ExifTool/Text.pm +3 -4
  45. package/bin/exiftool_files/lib/Image/ExifTool/Torrent.pm +2 -3
  46. package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +3 -3
  47. package/bin/exiftool_files/lib/Image/ExifTool/WriteCanonRaw.pl +7 -0
  48. package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +100 -23
  49. package/bin/exiftool_files/lib/Image/ExifTool/WriteIPTC.pl +2 -6
  50. package/bin/exiftool_files/lib/Image/ExifTool/WriteRIFF.pl +359 -0
  51. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +10 -3
  52. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +76 -58
  53. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +11 -4
  54. package/bin/exiftool_files/lib/Image/ExifTool.pm +75 -15
  55. package/bin/exiftool_files/lib/Image/ExifTool.pod +61 -57
  56. package/package.json +2 -2
@@ -0,0 +1,141 @@
1
+ #------------------------------------------------------------------------------
2
+ # File: ICO.pm
3
+ #
4
+ # Description: Read Windows ICO and CUR files
5
+ #
6
+ # Revisions: 2020-10-18 - P. Harvey Created
7
+ #
8
+ # References: 1) https://docs.fileformat.com/image/ico/
9
+ #------------------------------------------------------------------------------
10
+
11
+ package Image::ExifTool::ICO;
12
+
13
+ use strict;
14
+ use vars qw($VERSION);
15
+ use Image::ExifTool qw(:DataAccess :Utils);
16
+
17
+ $VERSION = '1.00';
18
+
19
+ %Image::ExifTool::ICO::Main = (
20
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
21
+ GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' },
22
+ NOTES => 'Information extracted from Windows ICO (icon) and CUR (cursor) files.',
23
+ 2 => {
24
+ Name => 'ImageType',
25
+ Format => 'int16u',
26
+ PrintConv => { 1 => 'Icon', 2 => 'Cursor' },
27
+ },
28
+ 4 => {
29
+ Name => 'ImageCount',
30
+ Format => 'int16u',
31
+ RawConv => '$$self{ImageCount} = $val',
32
+ },
33
+ 6 => {
34
+ Name => 'IconDir',
35
+ SubDirectory => { TagTable => 'Image::ExifTool::ICO::IconDir' },
36
+ },
37
+ );
38
+
39
+ %Image::ExifTool::ICO::IconDir = (
40
+ PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
41
+ GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' },
42
+ 0 => {
43
+ Name => 'ImageWidth',
44
+ ValueConv => '$val or $val + 256',
45
+ },
46
+ 1 => {
47
+ Name => 'ImageHeight',
48
+ ValueConv => '$val or $val + 256',
49
+ },
50
+ 2 => 'NumColors',
51
+ 4 => [{
52
+ Name => 'ColorPlanes',
53
+ Condition => '$$self{FileType} eq "ICO"',
54
+ Format => 'int16u',
55
+ Notes => 'ICO files',
56
+ },{
57
+ Name => 'HotspotX',
58
+ Format => 'int16u',
59
+ Notes => 'CUR files',
60
+ }],
61
+ 6 => [{
62
+ Name => 'BitsPerPixel',
63
+ Condition => '$$self{FileType} eq "ICO"',
64
+ Format => 'int16u',
65
+ Notes => 'ICO files',
66
+ },{
67
+ Name => 'HotspotY',
68
+ Format => 'int16u',
69
+ Notes => 'CUR files',
70
+ }],
71
+ 8 => {
72
+ Name => 'ImageLength',
73
+ Format => 'int32u',
74
+ },
75
+ );
76
+
77
+ #------------------------------------------------------------------------------
78
+ # Process ICO/CUR file
79
+ # Inputs: 0) ExifTool ref, 1) dirInfo ref
80
+ # Returns: 1 on success, 0 if this wasn't a valid ICO/CUR file
81
+ sub ProcessICO($$$)
82
+ {
83
+ my ($et, $dirInfo) = @_;
84
+ my $raf = $$dirInfo{RAF};
85
+ my ($i, $buff);
86
+ # verify this is a valid ICO/CUR file
87
+ return 0 unless $raf->Read($buff, 6) == 6;
88
+ return 0 unless $buff =~ /^\0\0([\x01\x02])\0[^0]\0/s;
89
+ $et->SetFileType($1 eq "\x01" ? 'ICO' : 'CUR');
90
+ SetByteOrder('II');
91
+ my $tagTbl = GetTagTable('Image::ExifTool::ICO::Main');
92
+ my $num = Get16u(\$buff, 4);
93
+ $et->HandleTag($tagTbl, 4, $num);
94
+ for ($i=0; $i<$num; ++$i) {
95
+ $raf->Read($buff, 16) == 16 or $et->Warn('Truncated file'), last;
96
+ $$et{DOC_NUM} = ++$$et{DOC_COUNT} if $i;
97
+ $et->HandleTag($tagTbl, 6, $buff);
98
+ }
99
+ delete $$et{DOC_NUM};
100
+ return 1;
101
+ }
102
+
103
+ 1; # end
104
+
105
+ __END__
106
+
107
+ =head1 NAME
108
+
109
+ Image::ExifTool::ICO - Read ICO meta information
110
+
111
+ =head1 SYNOPSIS
112
+
113
+ This module is used by Image::ExifTool
114
+
115
+ =head1 DESCRIPTION
116
+
117
+ This module contains definitions required by Image::ExifTool to read
118
+ information from Windows ICO (icon) and CUR (cursor) files.
119
+
120
+ =head1 AUTHOR
121
+
122
+ Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
123
+
124
+ This library is free software; you can redistribute it and/or modify it
125
+ under the same terms as Perl itself.
126
+
127
+ =head1 REFERENCES
128
+
129
+ =over 4
130
+
131
+ =item L<https://docs.fileformat.com/image/ico/>
132
+
133
+ =back
134
+
135
+ =head1 SEE ALSO
136
+
137
+ L<Image::ExifTool::TagNames/ICO Tags>,
138
+ L<Image::ExifTool(3pm)|Image::ExifTool>
139
+
140
+ =cut
141
+
@@ -18,7 +18,7 @@ use strict;
18
18
  use vars qw($VERSION);
19
19
  use Image::ExifTool qw(:DataAccess :Utils);
20
20
 
21
- $VERSION = '1.57';
21
+ $VERSION = '1.58';
22
22
 
23
23
  sub ProcessID3v2($$$);
24
24
  sub ProcessPrivate($$$);
@@ -1414,13 +1414,13 @@ sub ProcessID3($$)
1414
1414
  if ($flags & 0x40) {
1415
1415
  # skip the extended header
1416
1416
  $size >= 4 or $et->Warn('Bad ID3 extended header'), last;
1417
- my $len = unpack('N', $hBuff);
1418
- if ($len > length($hBuff) - 4) {
1417
+ my $len = UnSyncSafe(unpack('N', $hBuff));
1418
+ if ($len > length($hBuff)) {
1419
1419
  $et->Warn('Truncated ID3 extended header');
1420
1420
  last;
1421
1421
  }
1422
- $hBuff = substr($hBuff, $len + 4);
1423
- $pos += $len + 4;
1422
+ $hBuff = substr($hBuff, $len);
1423
+ $pos += $len;
1424
1424
  }
1425
1425
  if ($flags & 0x10) {
1426
1426
  # ignore v2.4 footer (10 bytes long)
@@ -1516,7 +1516,7 @@ sub ProcessID3($$)
1516
1516
  }
1517
1517
  }
1518
1518
  #
1519
- # process the the information
1519
+ # process the information
1520
1520
  #
1521
1521
  if ($rtnVal) {
1522
1522
  # first process audio data if it exists
@@ -13,6 +13,7 @@
13
13
  # 6) http://trac.handbrake.fr/browser/trunk/libhb/stream.c
14
14
  # 7) http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=04560141
15
15
  # 8) http://www.w6rz.net/xport.zip
16
+ # 9) https://en.wikipedia.org/wiki/Program-specific_information
16
17
  #
17
18
  # Notes: Variable names containing underlines are the same as in ref 1.
18
19
  #
@@ -31,9 +32,9 @@ use strict;
31
32
  use vars qw($VERSION);
32
33
  use Image::ExifTool qw(:DataAccess :Utils);
33
34
 
34
- $VERSION = '1.21';
35
+ $VERSION = '1.22';
35
36
 
36
- # program map table "stream_type" lookup (ref 6/1)
37
+ # program map table "stream_type" lookup (ref 6/1/9)
37
38
  my %streamType = (
38
39
  0x00 => 'Reserved',
39
40
  0x01 => 'MPEG-1 Video',
@@ -56,9 +57,22 @@ my %streamType = (
56
57
  0x12 => 'MPEG-4 generic',
57
58
  0x13 => 'ISO 14496-1 SL-packetized',
58
59
  0x14 => 'ISO 13818-6 Synchronized Download Protocol',
59
- # 0x15-0x7F => 'ISO 13818-1 Reserved',
60
+ 0x15 => 'Packetized metadata',
61
+ 0x16 => 'Sectioned metadata',
62
+ 0x17 => 'ISO/IEC 13818-6 DSM CC Data Carousel metadata',
63
+ 0x18 => 'ISO/IEC 13818-6 DSM CC Object Carousel metadata',
64
+ 0x19 => 'ISO/IEC 13818-6 Synchronized Download Protocol metadata',
65
+ 0x1a => 'ISO/IEC 13818-11 IPMP',
60
66
  0x1b => 'H.264 (AVC) Video',
67
+ 0x1c => 'ISO/IEC 14496-3 (MPEG-4 raw audio)',
68
+ 0x1d => 'ISO/IEC 14496-17 (MPEG-4 text)',
69
+ 0x1e => 'ISO/IEC 23002-3 (MPEG-4 auxiliary video)',
70
+ 0x1f => 'ISO/IEC 14496-10 SVC (MPEG-4 AVC sub-bitstream)',
71
+ 0x20 => 'ISO/IEC 14496-10 MVC (MPEG-4 AVC sub-bitstream)',
72
+ 0x21 => 'ITU-T Rec. T.800 and ISO/IEC 15444 (JPEG 2000 video)',
61
73
  0x24 => 'H.265 (HEVC) Video', #PH
74
+ 0x42 => 'Chinese Video Standard',
75
+ 0x7f => 'ISO/IEC 13818-11 IPMP (DRM)',
62
76
  0x80 => 'DigiCipher II Video',
63
77
  0x81 => 'A52/AC-3 Audio',
64
78
  0x82 => 'HDMV DTS Audio',
@@ -145,6 +159,7 @@ my $knotsToKph = 1.852; # knots --> km/h
145
159
  # the following tags are for documentation purposes only
146
160
  _AC3 => { SubDirectory => { TagTable => 'Image::ExifTool::M2TS::AC3' } },
147
161
  _H264 => { SubDirectory => { TagTable => 'Image::ExifTool::H264::Main' } },
162
+ _MISB => { SubDirectory => { TagTable => 'Image::ExifTool::MISB::Main' } },
148
163
  );
149
164
 
150
165
  # information extracted from AC-3 audio streams
@@ -278,7 +293,7 @@ sub ParsePID($$$$$)
278
293
  my $verbose = $et->Options('Verbose');
279
294
  if ($verbose > 1) {
280
295
  my $out = $et->Options('TextOut');
281
- printf $out "Parsing stream 0x%.4x (%s)\n", $pid, $pidName;
296
+ printf $out "Parsing stream 0x%.4x (%s) %d bytes\n", $pid, $pidName, length($$dataPt);
282
297
  $et->VerboseDump($dataPt);
283
298
  }
284
299
  my $more = 0;
@@ -303,6 +318,16 @@ sub ParsePID($$$$$)
303
318
  } elsif ($type == 0x81 or $type == 0x87 or $type == 0x91) {
304
319
  # AC-3 audio
305
320
  ParseAC3Audio($et, $dataPt);
321
+ } elsif ($type == 0x15) {
322
+ # packetized metadata (look for MISB code starting after 5-byte header)
323
+ if ($$dataPt =~ /^.{5}\x06\x0e\x2b\x34/s) {
324
+ $more = Image::ExifTool::MISB::ParseMISB($et, $dataPt, GetTagTable('Image::ExifTool::MISB::Main'));
325
+ if (not $$et{OPTIONS}{ExtractEmbedded}) {
326
+ $more = 0; # extract from only the first packet unless ExtractEmbedded is used
327
+ } elsif ($$et{OPTIONS}{ExtractEmbedded} > 2) {
328
+ $more = 1; # read past unknown 0x15 packets if ExtractEmbedded > 2
329
+ }
330
+ }
306
331
  } elsif ($type < 0) {
307
332
  if ($$dataPt =~ /^(.{164})?(.{24})A[NS][EW]/s) {
308
333
  # (Blueskysea B4K, Novatek NT96670)
@@ -426,7 +451,7 @@ sub ProcessM2TS($$)
426
451
  my ($et, $dirInfo) = @_;
427
452
  my $raf = $$dirInfo{RAF};
428
453
  my ($buff, $pLen, $upkPrefix, $j, $fileType, $eof);
429
- my (%pmt, %pidType, %data, %sectLen);
454
+ my (%pmt, %pidType, %data, %sectLen, %packLen, %fromStart);
430
455
  my ($startTime, $endTime, $fwdTime, $backScan, $maxBack);
431
456
  my $verbose = $et->Options('Verbose');
432
457
  my $out = $et->Options('TextOut');
@@ -610,6 +635,7 @@ sub ProcessM2TS($$)
610
635
  $buf2 = $data{$pid};
611
636
  $pos = 0;
612
637
  delete $data{$pid};
638
+ delete $fromStart{$pid};
613
639
  delete $sectLen{$pid};
614
640
  }
615
641
  my $slen = length($buf2); # section length
@@ -736,6 +762,7 @@ sub ProcessM2TS($$)
736
762
  my $more = ParsePID($et, $pid, $pidType{$pid}, $pidName{$pid}, \$data{$pid});
737
763
  # start fresh even if we couldn't process this PID yet
738
764
  delete $data{$pid};
765
+ delete $fromStart{$pid};
739
766
  unless ($more) {
740
767
  delete $needPID{$pid};
741
768
  $didPID{$pid} = 1;
@@ -749,8 +776,8 @@ sub ProcessM2TS($$)
749
776
  my $start_code = Get32u(\$buff, $pos);
750
777
  next unless ($start_code & 0xffffff00) == 0x00000100;
751
778
  my $stream_id = $start_code & 0xff;
779
+ my $pes_packet_length = Get16u(\$buff, $pos + 4);
752
780
  if ($verbose > 1) {
753
- my $pes_packet_length = Get16u(\$buff, $pos + 4);
754
781
  printf $out " Stream ID: 0x%.2x\n", $stream_id;
755
782
  print $out " Packet Len: $pes_packet_length\n";
756
783
  }
@@ -766,6 +793,14 @@ sub ProcessM2TS($$)
766
793
  next if $pos >= $pEnd;
767
794
  }
768
795
  $data{$pid} = substr($buff, $pos, $pEnd-$pos);
796
+ # set flag that we read this payload from the start
797
+ $fromStart{$pid} = 1;
798
+ # save the packet length
799
+ if ($pes_packet_length > 8) {
800
+ $packLen{$pid} = $pes_packet_length - 8; # (where are the 8 extra bytes? - PH)
801
+ } else {
802
+ delete $packLen{$pid};
803
+ }
769
804
  } else {
770
805
  unless (defined $data{$pid}) {
771
806
  # (vsys a6l dashcam GPS record doesn't have a start indicator)
@@ -776,12 +811,24 @@ sub ProcessM2TS($$)
776
811
  $data{$pid} .= substr($buff, $pos, $pEnd-$pos);
777
812
  }
778
813
  # save only the first 256 bytes of most streams, except for
779
- # unknown or H.264 streams where we save 1 kB
780
- my $saveLen = (not $pidType{$pid} or $pidType{$pid} == 0x1b) ? 1024 : 256;
814
+ # unknown, H.264 or metadata streams where we save up to 1 kB
815
+ my $saveLen;
816
+ if (not $pidType{$pid} or $pidType{$pid} == 0x1b) {
817
+ $saveLen = 1024;
818
+ } elsif ($pidType{$pid} == 0x15) {
819
+ # use 1024 or actual size of metadata packet if smaller
820
+ $saveLen = 1024;
821
+ $saveLen = $packLen{$pid} if defined $packLen{$pid} and $saveLen > $packLen{$pid};
822
+ } else {
823
+ $saveLen = 256;
824
+ }
781
825
  if (length($data{$pid}) >= $saveLen) {
782
826
  my $more = ParsePID($et, $pid, $pidType{$pid}, $pidName{$pid}, \$data{$pid});
783
827
  next if $more < 0; # wait for program map table (hopefully not too long)
828
+ # don't stop parsing if we weren't successful and may have missed the start
829
+ $more = 1 if not $more and not $fromStart{$pid};
784
830
  delete $data{$pid};
831
+ delete $fromStart{$pid};
785
832
  $more and $needPID{$pid} = -1, next; # parse more of these
786
833
  delete $needPID{$pid};
787
834
  $didPID{$pid} = 1;
@@ -14,7 +14,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
14
14
  use Image::ExifTool::Exif;
15
15
  use Image::ExifTool::GPS;
16
16
 
17
- $VERSION = '1.49';
17
+ $VERSION = '1.50';
18
18
 
19
19
  sub ProcessMIE($$);
20
20
  sub ProcessMIEGroup($$$);
@@ -448,6 +448,13 @@ my %offOn = ( 0 => 'Off', 1 => 'On' );
448
448
  Notes => 'string composed of R, G, B, Y, Cb and Cr',
449
449
  },
450
450
  Compression => { Name => 'CompressionRatio', Writable => 'rational32u' },
451
+ OriginalImageSize => { # PH added 2022-09-28
452
+ Writable => 'int16u',
453
+ Count => -1,
454
+ Notes => 'size of original image before cropping',
455
+ PrintConv => '$val=~tr/ /x/;$val',
456
+ PrintConvInv => '$val=~tr/x/ /;$val',
457
+ },
451
458
  ImageSize => {
452
459
  Writable => 'int16u',
453
460
  Count => -1,
@@ -1253,8 +1260,7 @@ sub WriteMIEGroup($$$)
1253
1260
  # join multiple values into a single string
1254
1261
  $newVal = join "\0", @newVals;
1255
1262
  # write string as UTF-8,16 or 32 if value contains valid UTF-8 codes
1256
- require Image::ExifTool::XMP;
1257
- my $isUTF8 = Image::ExifTool::XMP::IsUTF8(\$newVal);
1263
+ my $isUTF8 = Image::ExifTool::IsUTF8(\$newVal);
1258
1264
  if ($isUTF8 > 0) {
1259
1265
  $writable = 'utf8';
1260
1266
  # write UTF-16 or UTF-32 if it is more compact