exiftool-vendored.exe 12.28.0 → 12.34.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.
- package/bin/exiftool_files/Changes +108 -5
- package/bin/exiftool_files/README +2 -2
- package/bin/exiftool_files/arg_files/xmp2exif.args +2 -1
- package/bin/exiftool_files/config_files/example.config +1 -1
- package/bin/exiftool_files/exiftool.pl +40 -26
- package/bin/exiftool_files/fmt_files/gpx.fmt +1 -1
- package/bin/exiftool_files/fmt_files/gpx_wpt.fmt +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +16 -3
- package/bin/exiftool_files/lib/Image/ExifTool/CBOR.pm +331 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +35 -5
- package/bin/exiftool_files/lib/Image/ExifTool/Charset.pm +2 -0
- package/bin/exiftool_files/lib/Image/ExifTool/DPX.pm +13 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +98 -4
- package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +1 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +13 -2
- package/bin/exiftool_files/lib/Image/ExifTool/GoPro.pm +16 -1
- package/bin/exiftool_files/lib/Image/ExifTool/ICC_Profile.pm +96 -4
- package/bin/exiftool_files/lib/Image/ExifTool/ID3.pm +15 -3
- package/bin/exiftool_files/lib/Image/ExifTool/JSON.pm +7 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +60 -26
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/nl.pm +60 -59
- package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +81 -14
- package/bin/exiftool_files/lib/Image/ExifTool/MacOS.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +12 -3
- package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +10 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +8 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Other.pm +93 -0
- package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +11 -12
- package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +7 -6
- package/bin/exiftool_files/lib/Image/ExifTool/Panasonic.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +2 -1
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +67 -9
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +133 -119
- package/bin/exiftool_files/lib/Image/ExifTool/README +9 -2
- package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +6 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Samsung.pm +47 -10
- package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +80 -32
- package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +139 -4
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +224 -30
- package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +1 -0
- package/bin/exiftool_files/lib/Image/ExifTool/WritePNG.pl +2 -0
- package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +17 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +43 -0
- package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +21 -8
- package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +4 -1
- package/bin/exiftool_files/lib/Image/ExifTool/XMPStruct.pl +3 -1
- package/bin/exiftool_files/lib/Image/ExifTool.pm +8892 -8839
- package/bin/exiftool_files/lib/Image/ExifTool.pod +24 -15
- package/package.json +3 -3
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
#------------------------------------------------------------------------------
|
|
2
|
+
# File: CBOR.pm
|
|
3
|
+
#
|
|
4
|
+
# Description: Read CBOR format metadata
|
|
5
|
+
#
|
|
6
|
+
# Revisions: 2021-09-30 - P. Harvey Created
|
|
7
|
+
#
|
|
8
|
+
# References: 1) https://c2pa.org/public-draft/
|
|
9
|
+
# 2) https://datatracker.ietf.org/doc/html/rfc7049
|
|
10
|
+
#------------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
package Image::ExifTool::CBOR;
|
|
13
|
+
use strict;
|
|
14
|
+
use vars qw($VERSION);
|
|
15
|
+
use Image::ExifTool qw(:DataAccess :Utils);
|
|
16
|
+
use Image::ExifTool::JSON;
|
|
17
|
+
|
|
18
|
+
$VERSION = '1.01';
|
|
19
|
+
|
|
20
|
+
sub ProcessCBOR($$$);
|
|
21
|
+
sub ReadCBORValue($$$$);
|
|
22
|
+
|
|
23
|
+
# optional CBOR type code
|
|
24
|
+
my %cborType6 = (
|
|
25
|
+
0 => 'date/time string',
|
|
26
|
+
1 => 'epoch-based date/time',
|
|
27
|
+
2 => 'positive bignum',
|
|
28
|
+
3 => 'negative bignum',
|
|
29
|
+
4 => 'decimal fraction',
|
|
30
|
+
5 => 'bigfloat',
|
|
31
|
+
21 => 'expected base64url encoding',
|
|
32
|
+
22 => 'expected base64 encoding',
|
|
33
|
+
23 => 'expected base16 encoding',
|
|
34
|
+
24 => 'encoded CBOR data',
|
|
35
|
+
32 => 'URI',
|
|
36
|
+
33 => 'base64url',
|
|
37
|
+
34 => 'base64',
|
|
38
|
+
35 => 'regular expression',
|
|
39
|
+
36 => 'MIME message',
|
|
40
|
+
55799 => 'CBOR magic number',
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
my %cborType7 = (
|
|
44
|
+
20 => 'False',
|
|
45
|
+
21 => 'True',
|
|
46
|
+
22 => 'null',
|
|
47
|
+
23 => 'undef',
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
%Image::ExifTool::CBOR::Main = (
|
|
51
|
+
GROUPS => { 0 => 'JUMBF', 1 => 'CBOR', 2 => 'Other' },
|
|
52
|
+
VARS => { NO_ID => 1 },
|
|
53
|
+
PROCESS_PROC => \&ProcessCBOR,
|
|
54
|
+
NOTES => q{
|
|
55
|
+
The tags below are extracted from CBOR (Concise Binary Object
|
|
56
|
+
Representation) metadata. The C2PA specification uses this format for some
|
|
57
|
+
metadata. As well as these tags, ExifTool will read any existing tags.
|
|
58
|
+
},
|
|
59
|
+
'dc:title' => 'Title',
|
|
60
|
+
'dc:format' => 'Format',
|
|
61
|
+
# my sample file has the following 2 tags in CBOR, but they should be JSON
|
|
62
|
+
authorName => { Name => 'AuthorName', Groups => { 2 => 'Author' } },
|
|
63
|
+
authorIdentifier=> { Name => 'AuthorIdentifier', Groups => { 2 => 'Author' } },
|
|
64
|
+
documentID => { },
|
|
65
|
+
instanceID => { },
|
|
66
|
+
thumbnailHash => { List => 1 },
|
|
67
|
+
thumbnailUrl => { Name => 'ThumbnailURL' },
|
|
68
|
+
relationship => { }
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
#------------------------------------------------------------------------------
|
|
72
|
+
# Read CBOR value
|
|
73
|
+
# Inputs: 0) ExifTool ref, 1) data ref, 2) position in data, 3) data end
|
|
74
|
+
# Returns: 0) value, 1) error string, 2) new data position
|
|
75
|
+
sub ReadCBORValue($$$$)
|
|
76
|
+
{
|
|
77
|
+
my ($et, $dataPt, $pos, $end) = @_;
|
|
78
|
+
return(undef, 'Truncated CBOR data', $pos) if $pos >= $end;
|
|
79
|
+
my $verbose = $$et{OPTIONS}{Verbose};
|
|
80
|
+
my $indent = $$et{INDENT};
|
|
81
|
+
my $dumpStart = $pos;
|
|
82
|
+
my $fmt = Get8u($dataPt, $pos++);
|
|
83
|
+
my $dat = $fmt & 0x1f;
|
|
84
|
+
my ($num, $val, $err, $size);
|
|
85
|
+
$fmt >>= 5;
|
|
86
|
+
if ($dat < 24) {
|
|
87
|
+
$num = $dat;
|
|
88
|
+
} elsif ($dat == 31) { # indefinite count (not used in C2PA)
|
|
89
|
+
$num = -1; # (flag for indefinite count)
|
|
90
|
+
$et->VPrint(1, "$$et{INDENT} (indefinite count):\n");
|
|
91
|
+
} else {
|
|
92
|
+
my $format = { 24 => 'int8u', 25 => 'int16u', 26 => 'int32u', 27 => 'int64u' }->{$dat};
|
|
93
|
+
return(undef, "Invalid CBOR integer type $dat", $pos) unless $format;
|
|
94
|
+
$size = Image::ExifTool::FormatSize($format);
|
|
95
|
+
return(undef, 'Truncated CBOR integer value', $pos) if $pos + $size > $end;
|
|
96
|
+
$num = ReadValue($dataPt, $pos, $format, 1, $size);
|
|
97
|
+
$pos += $size;
|
|
98
|
+
}
|
|
99
|
+
my $pre = '';
|
|
100
|
+
if (defined $$et{cbor_pre} and $fmt != 6) {
|
|
101
|
+
$pre = $$et{cbor_pre};
|
|
102
|
+
delete $$et{cbor_pre};
|
|
103
|
+
}
|
|
104
|
+
if ($fmt == 0) { # positive integer
|
|
105
|
+
$val = $num;
|
|
106
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}int+: $val\n");
|
|
107
|
+
} elsif ($fmt == 1) { # negative integer
|
|
108
|
+
$val = -1 * $num;
|
|
109
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}int-: $val\n");
|
|
110
|
+
} elsif ($fmt == 2 or $fmt == 3) { # byte/UTF8 string
|
|
111
|
+
return(undef, 'Truncated CBOR string value', $pos) if $pos + $num > $end;
|
|
112
|
+
if ($num < 0) { # (should not happen in C2PA)
|
|
113
|
+
my $string = '';
|
|
114
|
+
$$et{INDENT} .= ' ';
|
|
115
|
+
for (;;) {
|
|
116
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
|
117
|
+
return(undef, $err, $pos) if $err;
|
|
118
|
+
last if not defined $val; # hit the break?
|
|
119
|
+
# (note: strictly we should be checking that this was a string we read)
|
|
120
|
+
$string .= $val;
|
|
121
|
+
}
|
|
122
|
+
$$et{INDENT} = $indent;
|
|
123
|
+
return($string, undef, $pos); # return concatenated byte/text string
|
|
124
|
+
} else {
|
|
125
|
+
$val = substr($$dataPt, $pos, $num);
|
|
126
|
+
}
|
|
127
|
+
$pos += $num;
|
|
128
|
+
if ($fmt == 2) { # (byte string)
|
|
129
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}byte: <binary data ".length($val)." bytes>\n");
|
|
130
|
+
my $dat = $val;
|
|
131
|
+
$val = \$dat; # use scalar reference for binary data
|
|
132
|
+
} else { # (text string)
|
|
133
|
+
$val = $et->Decode($val, 'UTF8');
|
|
134
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}text: '${val}'\n");
|
|
135
|
+
}
|
|
136
|
+
} elsif ($fmt == 4 or $fmt == 5) { # list/hash
|
|
137
|
+
if ($fmt == 4) {
|
|
138
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}list: <$num elements>\n");
|
|
139
|
+
} else {
|
|
140
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}hash: <$num pairs>\n");
|
|
141
|
+
$num *= 2;
|
|
142
|
+
}
|
|
143
|
+
$$et{INDENT} .= ' ';
|
|
144
|
+
my $i = 0;
|
|
145
|
+
my @list;
|
|
146
|
+
Image::ExifTool::HexDump($dataPt, $pos - $dumpStart,
|
|
147
|
+
Start => $dumpStart,
|
|
148
|
+
DataPos => $$et{cbor_datapos},
|
|
149
|
+
Prefix => $$et{INDENT},
|
|
150
|
+
) if $verbose > 2;
|
|
151
|
+
while ($num) {
|
|
152
|
+
$$et{cbor_pre} = "$i) ";
|
|
153
|
+
if ($fmt == 4) {
|
|
154
|
+
++$i;
|
|
155
|
+
} elsif ($num & 0x01) {
|
|
156
|
+
$$et{cbor_pre} = ' ' x length($$et{cbor_pre});
|
|
157
|
+
++$i;
|
|
158
|
+
}
|
|
159
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
|
160
|
+
return(undef, $err, $pos) if $err;
|
|
161
|
+
if (not defined $val) {
|
|
162
|
+
return(undef, 'Unexpected list terminator', $pos) unless $num < 0;
|
|
163
|
+
last;
|
|
164
|
+
}
|
|
165
|
+
push @list, $val;
|
|
166
|
+
--$num;
|
|
167
|
+
}
|
|
168
|
+
$dumpStart = $pos;
|
|
169
|
+
$$et{INDENT} = $indent;
|
|
170
|
+
if ($fmt == 5) {
|
|
171
|
+
my ($i, @keys);
|
|
172
|
+
my %hash = ( _ordered_keys_ => \@keys );
|
|
173
|
+
for ($i=0; $i<@list-1; $i+=2) {
|
|
174
|
+
$hash{$list[$i]} = $list[$i+1];
|
|
175
|
+
push @keys, $list[$i]; # save ordered list of keys
|
|
176
|
+
}
|
|
177
|
+
$val = \%hash;
|
|
178
|
+
} else {
|
|
179
|
+
$val = \@list;
|
|
180
|
+
}
|
|
181
|
+
} elsif ($fmt == 6) { # optional tag
|
|
182
|
+
if ($verbose) {
|
|
183
|
+
my $str = "$num (" . ($cborType6{$num} || 'unknown') . ')';
|
|
184
|
+
my $spc = $$et{cbor_pre} ? (' ' x length $$et{cbor_pre}) : '';
|
|
185
|
+
$et->VPrint(1, "$$et{INDENT} $spc<CBOR optional type $str>\n");
|
|
186
|
+
Image::ExifTool::HexDump($dataPt, $pos - $dumpStart,
|
|
187
|
+
Start => $dumpStart,
|
|
188
|
+
DataPos => $$et{cbor_datapos},
|
|
189
|
+
Prefix => $$et{INDENT} . ' ',
|
|
190
|
+
) if $verbose > 2;
|
|
191
|
+
}
|
|
192
|
+
# read next value (note: in the case of multiple tags,
|
|
193
|
+
# this nesting will apply the tags in the correct order)
|
|
194
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
|
195
|
+
$dumpStart = $pos;
|
|
196
|
+
# convert some values according to the optional tag number (untested)
|
|
197
|
+
if ($num == 0 and not ref $val) { # date/time string
|
|
198
|
+
require Image::ExifTool::XMP;
|
|
199
|
+
$val = Image::ExifTool::XMP::ConvertXMPDate($val);
|
|
200
|
+
} elsif ($num == 1 and not ref $val) { # epoch-based date/time
|
|
201
|
+
if (Image::ExifTool::IsFloat($val)) {
|
|
202
|
+
my $dec = ($val == int($val)) ? undef : 6;
|
|
203
|
+
$val = Image::ExifTool::ConvertUnixTime($val, 1, $dec);
|
|
204
|
+
}
|
|
205
|
+
} elsif (($num == 2 or $num == 3) and ref($val) eq 'SCALAR') { # pos/neg bignum
|
|
206
|
+
my $big = 0;
|
|
207
|
+
$big = 256 * $big + Get8u($val,$_) foreach 0..(length($$val) - 1);
|
|
208
|
+
$val = $num==2 ? $big : -$big;
|
|
209
|
+
} elsif (($num == 4 or $num == 5) and # decimal fraction or bigfloat
|
|
210
|
+
ref($val) eq 'ARRAY' and @$val == 2 and
|
|
211
|
+
Image::ExifTool::IsInt($$val[0]) and Image::ExifTool::IsInt($$val[1]))
|
|
212
|
+
{
|
|
213
|
+
$val = $$val[1] * ($num == 4 ? 10 : 2) ** $$val[0];
|
|
214
|
+
}
|
|
215
|
+
} elsif ($fmt == 7) {
|
|
216
|
+
if ($dat == 31) {
|
|
217
|
+
undef $val; # "break" = end of indefinite array/hash (not used in C2PA)
|
|
218
|
+
} elsif ($dat < 24) {
|
|
219
|
+
$val = $cborType7{$num};
|
|
220
|
+
$val = "Unknown ($val)" unless defined $val;
|
|
221
|
+
} elsif ($dat == 25) { # half-precision float
|
|
222
|
+
my $exp = ($num >> 10) & 0x1f;
|
|
223
|
+
my $mant = $num & 0x3ff;
|
|
224
|
+
if ($exp == 0) {
|
|
225
|
+
$val = $mant ** -24;
|
|
226
|
+
$val *= -1 if $num & 0x8000;
|
|
227
|
+
} elsif (exp != 31) {
|
|
228
|
+
$val = ($mant + 1024) ** ($exp - 25);
|
|
229
|
+
$val *= -1 if $num & 0x8000;
|
|
230
|
+
} else {
|
|
231
|
+
$val = $mant == 0 ? '<inf>' : '<nan>';
|
|
232
|
+
}
|
|
233
|
+
} elsif ($dat == 26) { # float
|
|
234
|
+
$val = GetFloat($dataPt, $pos - $size);
|
|
235
|
+
} elsif ($dat == 27) { # double
|
|
236
|
+
$val = GetDouble($dataPt, $pos - $size);
|
|
237
|
+
} else {
|
|
238
|
+
return(undef, "Invalid CBOR type 7 variant $num", $pos);
|
|
239
|
+
}
|
|
240
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}typ7: ".(defined $val ? $val : '<break>')."\n");
|
|
241
|
+
} else {
|
|
242
|
+
return(undef, "Unknown CBOR format $fmt", $pos);
|
|
243
|
+
}
|
|
244
|
+
Image::ExifTool::HexDump($dataPt, $pos - $dumpStart,
|
|
245
|
+
Start => $dumpStart,
|
|
246
|
+
DataPos => $$et{cbor_datapos},
|
|
247
|
+
Prefix => $$et{INDENT} . ' ',
|
|
248
|
+
MaxLen => $verbose < 5 ? ($verbose == 3 ? 96 : 2048) : undef,
|
|
249
|
+
) if $verbose > 2;
|
|
250
|
+
return($val, $err, $pos);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
#------------------------------------------------------------------------------
|
|
254
|
+
# Read CBOR box
|
|
255
|
+
# Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
|
|
256
|
+
# Returns: 1 on success
|
|
257
|
+
sub ProcessCBOR($$$)
|
|
258
|
+
{
|
|
259
|
+
my ($et, $dirInfo, $tagTablePtr) = @_;
|
|
260
|
+
my $dataPt = $$dirInfo{DataPt};
|
|
261
|
+
my $pos = $$dirInfo{DirStart};
|
|
262
|
+
my $end = $pos + $$dirInfo{DirLen};
|
|
263
|
+
my ($val, $err, $tag, $i);
|
|
264
|
+
|
|
265
|
+
$et->VerboseDir('CBOR', undef, $$dirInfo{DirLen});
|
|
266
|
+
|
|
267
|
+
$$et{cbor_datapos} = $$dirInfo{DataPos} + $$dirInfo{Base};
|
|
268
|
+
|
|
269
|
+
while ($pos < $end) {
|
|
270
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
|
271
|
+
$err and $et->Warn($err), last;
|
|
272
|
+
if (ref $val eq 'HASH') {
|
|
273
|
+
foreach $tag (@{$$val{_ordered_keys_}}) {
|
|
274
|
+
Image::ExifTool::JSON::ProcessTag($et, $tagTablePtr, $tag, $$val{$tag});
|
|
275
|
+
}
|
|
276
|
+
} elsif (ref $val eq 'ARRAY') {
|
|
277
|
+
for ($i=0; $i<@$val; ++$i) {
|
|
278
|
+
Image::ExifTool::JSON::ProcessTag($et, $tagTablePtr, "Item$i", $$val[$i]);
|
|
279
|
+
}
|
|
280
|
+
} elsif ($val eq '0') {
|
|
281
|
+
$et->VPrint(1, "$$et{INDENT} <CBOR end>\n");
|
|
282
|
+
last; # (treat as padding)
|
|
283
|
+
} else {
|
|
284
|
+
$et->VPrint(1, "$$et{INDENT} Unknown value: $val\n");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return 1;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
1; # end
|
|
291
|
+
|
|
292
|
+
__END__
|
|
293
|
+
|
|
294
|
+
=head1 NAME
|
|
295
|
+
|
|
296
|
+
Image::ExifTool::CBOR - Read CBOR format metadata
|
|
297
|
+
|
|
298
|
+
=head1 SYNOPSIS
|
|
299
|
+
|
|
300
|
+
This module is used by Image::ExifTool
|
|
301
|
+
|
|
302
|
+
=head1 DESCRIPTION
|
|
303
|
+
|
|
304
|
+
This module contains definitions required by Image::ExifTool read Concise
|
|
305
|
+
Binary Object Representation (CBOR) formatted metadata, used by the C2PA
|
|
306
|
+
specification.
|
|
307
|
+
|
|
308
|
+
=head1 AUTHOR
|
|
309
|
+
|
|
310
|
+
Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
|
|
311
|
+
|
|
312
|
+
This library is free software; you can redistribute it and/or modify it
|
|
313
|
+
under the same terms as Perl itself.
|
|
314
|
+
|
|
315
|
+
=head1 REFERENCES
|
|
316
|
+
|
|
317
|
+
=over 4
|
|
318
|
+
|
|
319
|
+
=item L<https://c2pa.org/public-draft/>
|
|
320
|
+
|
|
321
|
+
=item L<https://datatracker.ietf.org/doc/html/rfc7049>
|
|
322
|
+
|
|
323
|
+
=back
|
|
324
|
+
|
|
325
|
+
=head1 SEE ALSO
|
|
326
|
+
|
|
327
|
+
L<Image::ExifTool::TagNames/CBOR Tags>,
|
|
328
|
+
L<Image::ExifTool(3pm)|Image::ExifTool>
|
|
329
|
+
|
|
330
|
+
=cut
|
|
331
|
+
|
|
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
|
|
|
88
88
|
sub ProcessExifInfo($$$);
|
|
89
89
|
sub SwapWords($);
|
|
90
90
|
|
|
91
|
-
$VERSION = '4.
|
|
91
|
+
$VERSION = '4.53';
|
|
92
92
|
|
|
93
93
|
# Note: Removed 'USM' from 'L' lenses since it is redundant - PH
|
|
94
94
|
# (or is it? Ref 32 shows 5 non-USM L-type lenses)
|
|
@@ -187,7 +187,7 @@ $VERSION = '4.49';
|
|
|
187
187
|
37.2 => 'Tamron AF 28-300mm f/3.5-6.3 XR Di VC LD Aspherical [IF] Macro (A20)', #38
|
|
188
188
|
37.3 => 'Tamron SP AF 17-50mm f/2.8 XR Di II VC LD Aspherical [IF]', #34
|
|
189
189
|
37.4 => 'Tamron AF 18-270mm f/3.5-6.3 Di II VC LD Aspherical [IF] Macro', #forum2937
|
|
190
|
-
38 => 'Canon EF 80-200mm f/4.5-5.6', #32
|
|
190
|
+
38 => 'Canon EF 80-200mm f/4.5-5.6 II', #32 (II added ref https://github.com/Exiv2/exiv2/issues/1906)
|
|
191
191
|
39 => 'Canon EF 75-300mm f/4-5.6',
|
|
192
192
|
40 => 'Canon EF 28-80mm f/3.5-5.6',
|
|
193
193
|
41 => 'Canon EF 28-90mm f/4-5.6', #32
|
|
@@ -519,7 +519,8 @@ $VERSION = '4.49';
|
|
|
519
519
|
507 => 'Canon EF 16-35mm f/4L IS USM', #42
|
|
520
520
|
508 => 'Canon EF 11-24mm f/4L USM or Tamron Lens', #PH
|
|
521
521
|
508.1 => 'Tamron 10-24mm f/3.5-4.5 Di II VC HLD (B023)', #PH
|
|
522
|
-
624 => 'Sigma 70-200mm f/2.8 DG OS HSM | S', #IB (018)
|
|
522
|
+
624 => 'Sigma 70-200mm f/2.8 DG OS HSM | S or other Sigma Lens', #IB (018)
|
|
523
|
+
624.1 => 'Sigma 150-600mm f/5-6.3 | C', #ChrisSkopec
|
|
523
524
|
747 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens', #JR
|
|
524
525
|
747.1 => 'Tamron SP 150-600mm f/5-6.3 Di VC USD G2', #50
|
|
525
526
|
748 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x or Tamron Lens', #JR (1.4x Mk III)
|
|
@@ -557,7 +558,8 @@ $VERSION = '4.49';
|
|
|
557
558
|
4158 => 'Canon EF-S 18-55mm f/4-5.6 IS STM', #PH
|
|
558
559
|
4159 => 'Canon EF-M 32mm f/1.4 STM', #42
|
|
559
560
|
4160 => 'Canon EF-S 35mm f/2.8 Macro IS STM', #42
|
|
560
|
-
4208 => 'Sigma 56mm f/1.4 DC DN | C', #forum10603
|
|
561
|
+
4208 => 'Sigma 56mm f/1.4 DC DN | C or other Sigma Lens', #forum10603
|
|
562
|
+
4208.1 => 'Sigma 30mm F1.4 DC DN | C', #git issue#83 (016)
|
|
561
563
|
# (Nano USM lenses - 0x90xx)
|
|
562
564
|
36910 => 'Canon EF 70-300mm f/4-5.6 IS II USM', #42
|
|
563
565
|
36912 => 'Canon EF-S 18-135mm f/3.5-5.6 IS USM', #42
|
|
@@ -592,6 +594,12 @@ $VERSION = '4.49';
|
|
|
592
594
|
'61182.20' => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
|
|
593
595
|
'61182.21' => 'Canon RF 70-200mm F4L IS USM', #42
|
|
594
596
|
'61182.22' => 'Canon RF 50mm F1.8 STM', #42
|
|
597
|
+
'61182.23' => 'Canon RF 14-35mm F4L IS USM', #IB
|
|
598
|
+
'61182.24' => 'Canon RF 100-400mm F5.6-8 IS USM', #42
|
|
599
|
+
'61182.25' => 'Canon RF 100-400mm F5.6-8 IS USM + RF1.4x', #42 (NC)
|
|
600
|
+
'61182.26' => 'Canon RF 100-400mm F5.6-8 IS USM + RF2x', #42 (NC)
|
|
601
|
+
'61182.27' => 'Canon RF 16mm F2.8 STM', #42
|
|
602
|
+
#'61182.xx' => 'Canon RF 100mm F2.8L MACRO IS USM',
|
|
595
603
|
65535 => 'n/a',
|
|
596
604
|
);
|
|
597
605
|
|
|
@@ -6727,7 +6735,17 @@ my %ciMaxFocal = (
|
|
|
6727
6735
|
PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
|
|
6728
6736
|
},
|
|
6729
6737
|
# 22 - values: 0, 1
|
|
6730
|
-
|
|
6738
|
+
23 => { #JohnMoyer (forum12925)
|
|
6739
|
+
Name => 'ShutterMode',
|
|
6740
|
+
PrintConv => {
|
|
6741
|
+
0 => 'Mechanical',
|
|
6742
|
+
1 => 'Electronic First Curtain',
|
|
6743
|
+
2 => 'Electronic',
|
|
6744
|
+
# 3 => ?
|
|
6745
|
+
# 21 => ?
|
|
6746
|
+
# 22 => ?
|
|
6747
|
+
},
|
|
6748
|
+
},
|
|
6731
6749
|
25 => { #PH
|
|
6732
6750
|
Name => 'FlashExposureLock',
|
|
6733
6751
|
PrintConv => \%offOn,
|
|
@@ -6760,6 +6778,12 @@ my %ciMaxFocal = (
|
|
|
6760
6778
|
277 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
|
|
6761
6779
|
278 => 'Canon RF 70-200mm F4L IS USM', #42
|
|
6762
6780
|
280 => 'Canon RF 50mm F1.8 STM', #42
|
|
6781
|
+
281 => 'Canon RF 14-35mm F4L IS USM', #42/IB
|
|
6782
|
+
283 => 'Canon RF 100-400mm F5.6-8 IS USM', #42
|
|
6783
|
+
284 => 'Canon RF 100-400mm F5.6-8 IS USM + RF1.4x', #42 (NC)
|
|
6784
|
+
285 => 'Canon RF 100-400mm F5.6-8 IS USM + RF2x', #42 (NC)
|
|
6785
|
+
288 => 'Canon RF 16mm F2.8 STM', #42
|
|
6786
|
+
#xxx => 'Canon RF 100mm F2.8L MACRO IS USM',
|
|
6763
6787
|
# Note: add new RF lenses to %canonLensTypes with ID 61182
|
|
6764
6788
|
},
|
|
6765
6789
|
},
|
|
@@ -8734,6 +8758,7 @@ my %filterConv = (
|
|
|
8734
8758
|
# --> ignored when reading, but offsets are updated when writing
|
|
8735
8759
|
CMT1 => { # (CR3 files)
|
|
8736
8760
|
Name => 'IFD0',
|
|
8761
|
+
PreservePadding => 1,
|
|
8737
8762
|
SubDirectory => {
|
|
8738
8763
|
TagTable => 'Image::ExifTool::Exif::Main',
|
|
8739
8764
|
ProcessProc => \&Image::ExifTool::ProcessTIFF,
|
|
@@ -8742,6 +8767,7 @@ my %filterConv = (
|
|
|
8742
8767
|
},
|
|
8743
8768
|
CMT2 => { # (CR3 files)
|
|
8744
8769
|
Name => 'ExifIFD',
|
|
8770
|
+
PreservePadding => 1,
|
|
8745
8771
|
SubDirectory => {
|
|
8746
8772
|
TagTable => 'Image::ExifTool::Exif::Main',
|
|
8747
8773
|
ProcessProc => \&Image::ExifTool::ProcessTIFF,
|
|
@@ -8750,6 +8776,7 @@ my %filterConv = (
|
|
|
8750
8776
|
},
|
|
8751
8777
|
CMT3 => { # (CR3 files)
|
|
8752
8778
|
Name => 'MakerNoteCanon',
|
|
8779
|
+
PreservePadding => 1,
|
|
8753
8780
|
SubDirectory => {
|
|
8754
8781
|
TagTable => 'Image::ExifTool::Canon::Main',
|
|
8755
8782
|
ProcessProc => \&ProcessCMT3,
|
|
@@ -8758,6 +8785,7 @@ my %filterConv = (
|
|
|
8758
8785
|
},
|
|
8759
8786
|
CMT4 => { # (CR3 files)
|
|
8760
8787
|
Name => 'GPSInfo',
|
|
8788
|
+
PreservePadding => 1,
|
|
8761
8789
|
SubDirectory => {
|
|
8762
8790
|
TagTable => 'Image::ExifTool::GPS::Main',
|
|
8763
8791
|
ProcessProc => \&Image::ExifTool::ProcessTIFF,
|
|
@@ -8768,6 +8796,7 @@ my %filterConv = (
|
|
|
8768
8796
|
THMB => {
|
|
8769
8797
|
Name => 'ThumbnailImage',
|
|
8770
8798
|
Groups => { 2 => 'Preview' },
|
|
8799
|
+
PreservePadding => 1,
|
|
8771
8800
|
RawConv => 'substr($val, 16)',
|
|
8772
8801
|
Binary => 1,
|
|
8773
8802
|
},
|
|
@@ -8782,6 +8811,7 @@ my %filterConv = (
|
|
|
8782
8811
|
WRITE_PROC => 'Image::ExifTool::QuickTime::WriteQuickTime',
|
|
8783
8812
|
CNOP => {
|
|
8784
8813
|
Name => 'CanonVRD',
|
|
8814
|
+
PreservePadding => 1,
|
|
8785
8815
|
SubDirectory => {
|
|
8786
8816
|
TagTable => 'Image::ExifTool::CanonVRD::Main',
|
|
8787
8817
|
WriteProc => 'Image::ExifTool::CanonVRD::WriteCanonDR4',
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
# Revisions: 2009/08/28 - P. Harvey created
|
|
7
7
|
# 2010/01/20 - P. Harvey complete re-write
|
|
8
8
|
# 2010/07/16 - P. Harvey added UTF-16 support
|
|
9
|
+
#
|
|
10
|
+
# Notes: Charset lookups are generated using my convertCharset script
|
|
9
11
|
#------------------------------------------------------------------------------
|
|
10
12
|
|
|
11
13
|
package Image::ExifTool::Charset;
|
|
@@ -15,7 +15,7 @@ use strict;
|
|
|
15
15
|
use vars qw($VERSION);
|
|
16
16
|
use Image::ExifTool qw(:DataAccess :Utils);
|
|
17
17
|
|
|
18
|
-
$VERSION = '1.
|
|
18
|
+
$VERSION = '1.06';
|
|
19
19
|
|
|
20
20
|
# DPX tags
|
|
21
21
|
%Image::ExifTool::DPX::Main = (
|
|
@@ -156,7 +156,18 @@ $VERSION = '1.05';
|
|
|
156
156
|
1532=> { Name => 'SourceCreateDate', Format => 'string[24]' },
|
|
157
157
|
1556=> { Name => 'InputDeviceName', Format => 'string[32]' },
|
|
158
158
|
1588=> { Name => 'InputDeviceSerialNumber', Format => 'string[32]' },
|
|
159
|
-
# 1620=> { Name => '
|
|
159
|
+
# 1620 => { Name => 'Border', Format => 'int16u[4]' },
|
|
160
|
+
1628 => {
|
|
161
|
+
Name => 'AspectRatio',
|
|
162
|
+
Format => 'int32u[2]',
|
|
163
|
+
RawConv => '$val =~ /4294967295/ ? undef : $val', # ignore undefined values
|
|
164
|
+
PrintConv => q{
|
|
165
|
+
return 'undef' if $val eq '0 0';
|
|
166
|
+
return 'inf' if $val=~/ 0$/;
|
|
167
|
+
my @a=split(' ',$val);
|
|
168
|
+
return join(':', Rationalize($a[0]/$a[1]));
|
|
169
|
+
},
|
|
170
|
+
},
|
|
160
171
|
1724 => { Name => 'OriginalFrameRate',Format => 'float' },
|
|
161
172
|
1728 => { Name => 'ShutterAngle', Format => 'float', RawConv => '($val =~ /\d/ and $val !~ /nan/i) ? $val : undef' }, #2
|
|
162
173
|
1732 => { Name => 'FrameID', Format => 'string[32]' },
|
|
@@ -56,7 +56,7 @@ use vars qw($VERSION $AUTOLOAD @formatSize @formatName %formatNumber %intFormat
|
|
|
56
56
|
use Image::ExifTool qw(:DataAccess :Utils);
|
|
57
57
|
use Image::ExifTool::MakerNotes;
|
|
58
58
|
|
|
59
|
-
$VERSION = '4.
|
|
59
|
+
$VERSION = '4.37';
|
|
60
60
|
|
|
61
61
|
sub ProcessExif($$$);
|
|
62
62
|
sub WriteExif($$$);
|
|
@@ -265,6 +265,7 @@ sub BINARY_DATA_LIMIT { return 10 * 1024 * 1024; }
|
|
|
265
265
|
32892 => 'Sequential Color Filter', #JR (Sony ARQ)
|
|
266
266
|
34892 => 'Linear Raw', #2
|
|
267
267
|
51177 => 'Depth Map', # (DNG 1.5)
|
|
268
|
+
52527 => 'Semantic Mask', # (DNG 1.6)
|
|
268
269
|
);
|
|
269
270
|
|
|
270
271
|
%orientation = (
|
|
@@ -291,6 +292,7 @@ sub BINARY_DATA_LIMIT { return 10 * 1024 * 1024; }
|
|
|
291
292
|
9 => 'Depth map of reduced-resolution image', # (DNG 1.5)
|
|
292
293
|
16 => 'Enhanced image data', # (DNG 1.5)
|
|
293
294
|
0x10001 => 'Alternate reduced-resolution image', # (DNG 1.2)
|
|
295
|
+
0x10004 => 'Semantic Mask', # (DNG 1.6)
|
|
294
296
|
0xffffffff => 'invalid', #(found in E5700 NEF's)
|
|
295
297
|
BITMASK => {
|
|
296
298
|
0 => 'Reduced resolution',
|
|
@@ -366,6 +368,7 @@ my %opcodeInfo = (
|
|
|
366
368
|
11 => 'DeltaPerColumn',
|
|
367
369
|
12 => 'ScalePerRow',
|
|
368
370
|
13 => 'ScalePerColumn',
|
|
371
|
+
14 => 'WarpRectilinear2', # (DNG 1.6)
|
|
369
372
|
},
|
|
370
373
|
PrintConvInv => undef, # (so the inverse conversion is not performed)
|
|
371
374
|
);
|
|
@@ -3038,12 +3041,12 @@ my %opcodeInfo = (
|
|
|
3038
3041
|
},
|
|
3039
3042
|
},
|
|
3040
3043
|
#
|
|
3041
|
-
# DNG tags 0xc6XX and
|
|
3044
|
+
# DNG tags 0xc6XX, 0xc7XX and 0xcdXX (ref 2 unless otherwise stated)
|
|
3042
3045
|
#
|
|
3043
3046
|
0xc612 => {
|
|
3044
3047
|
Name => 'DNGVersion',
|
|
3045
3048
|
Notes => q{
|
|
3046
|
-
tags 0xc612-
|
|
3049
|
+
tags 0xc612-0xcd3b are defined by the DNG specification unless otherwise
|
|
3047
3050
|
noted. See L<https://helpx.adobe.com/photoshop/digital-negative.html> for
|
|
3048
3051
|
the specification
|
|
3049
3052
|
},
|
|
@@ -4041,6 +4044,97 @@ my %opcodeInfo = (
|
|
|
4041
4044
|
Protected => 1,
|
|
4042
4045
|
WriteGroup => 'IFD0',
|
|
4043
4046
|
},
|
|
4047
|
+
0xcd2d => { # DNG 1.6
|
|
4048
|
+
Name => 'ProfileGainTableMap',
|
|
4049
|
+
Writable => 'undef',
|
|
4050
|
+
WriteGroup => 'SubIFD',
|
|
4051
|
+
Protected => 1,
|
|
4052
|
+
Binary => 1,
|
|
4053
|
+
},
|
|
4054
|
+
0xcd2e => { # DNG 1.6
|
|
4055
|
+
Name => 'SemanticName',
|
|
4056
|
+
# Writable => 'string',
|
|
4057
|
+
WriteGroup => 'SubIFD' #? (NC) Semantic Mask IFD (only for Validate)
|
|
4058
|
+
},
|
|
4059
|
+
0xcd30 => { # DNG 1.6
|
|
4060
|
+
Name => 'SemanticInstanceIFD',
|
|
4061
|
+
# Writable => 'string',
|
|
4062
|
+
WriteGroup => 'SubIFD' #? (NC) Semantic Mask IFD (only for Validate)
|
|
4063
|
+
},
|
|
4064
|
+
0xcd31 => { # DNG 1.6
|
|
4065
|
+
Name => 'CalibrationIlluminant3',
|
|
4066
|
+
Writable => 'int16u',
|
|
4067
|
+
WriteGroup => 'IFD0',
|
|
4068
|
+
Protected => 1,
|
|
4069
|
+
SeparateTable => 'LightSource',
|
|
4070
|
+
PrintConv => \%lightSource,
|
|
4071
|
+
},
|
|
4072
|
+
0xcd32 => { # DNG 1.6
|
|
4073
|
+
Name => 'CameraCalibration3',
|
|
4074
|
+
Writable => 'rational64s',
|
|
4075
|
+
WriteGroup => 'IFD0',
|
|
4076
|
+
Count => -1,
|
|
4077
|
+
Protected => 1,
|
|
4078
|
+
},
|
|
4079
|
+
0xcd33 => { # DNG 1.6
|
|
4080
|
+
Name => 'ColorMatrix3',
|
|
4081
|
+
Writable => 'rational64s',
|
|
4082
|
+
WriteGroup => 'IFD0',
|
|
4083
|
+
Count => -1,
|
|
4084
|
+
Protected => 1,
|
|
4085
|
+
},
|
|
4086
|
+
0xcd34 => { # DNG 1.6
|
|
4087
|
+
Name => 'ForwardMatrix3',
|
|
4088
|
+
Writable => 'rational64s',
|
|
4089
|
+
WriteGroup => 'IFD0',
|
|
4090
|
+
Count => -1,
|
|
4091
|
+
Protected => 1,
|
|
4092
|
+
},
|
|
4093
|
+
0xcd35 => { # DNG 1.6
|
|
4094
|
+
Name => 'IlluminantData1',
|
|
4095
|
+
Writable => 'undef',
|
|
4096
|
+
WriteGroup => 'IFD0',
|
|
4097
|
+
Protected => 1,
|
|
4098
|
+
},
|
|
4099
|
+
0xcd36 => { # DNG 1.6
|
|
4100
|
+
Name => 'IlluminantData2',
|
|
4101
|
+
Writable => 'undef',
|
|
4102
|
+
WriteGroup => 'IFD0',
|
|
4103
|
+
Protected => 1,
|
|
4104
|
+
},
|
|
4105
|
+
0xcd37 => { # DNG 1.6
|
|
4106
|
+
Name => 'IlluminantData3',
|
|
4107
|
+
Writable => 'undef',
|
|
4108
|
+
WriteGroup => 'IFD0',
|
|
4109
|
+
Protected => 1,
|
|
4110
|
+
},
|
|
4111
|
+
0xcd38 => { # DNG 1.6
|
|
4112
|
+
Name => 'MaskSubArea',
|
|
4113
|
+
# Writable => 'int32u',
|
|
4114
|
+
WriteGroup => 'SubIFD', #? (NC) Semantic Mask IFD (only for Validate)
|
|
4115
|
+
Count => 4,
|
|
4116
|
+
},
|
|
4117
|
+
0xcd39 => { # DNG 1.6
|
|
4118
|
+
Name => 'ProfileHueSatMapData3',
|
|
4119
|
+
%longBin,
|
|
4120
|
+
Writable => 'float',
|
|
4121
|
+
WriteGroup => 'IFD0',
|
|
4122
|
+
Count => -1,
|
|
4123
|
+
Protected => 1,
|
|
4124
|
+
},
|
|
4125
|
+
0xcd3a => { # DNG 1.6
|
|
4126
|
+
Name => 'ReductionMatrix3',
|
|
4127
|
+
Writable => 'rational64s',
|
|
4128
|
+
WriteGroup => 'IFD0',
|
|
4129
|
+
Count => -1,
|
|
4130
|
+
Protected => 1,
|
|
4131
|
+
},
|
|
4132
|
+
0xcd3b => { # DNG 1.6
|
|
4133
|
+
Name => 'RGBTables',
|
|
4134
|
+
Writable => 'undef',
|
|
4135
|
+
WriteGroup => 'IFD0',
|
|
4136
|
+
Protected => 1,
|
|
4137
|
+
},
|
|
4044
4138
|
0xea1c => { #13
|
|
4045
4139
|
Name => 'Padding',
|
|
4046
4140
|
Binary => 1,
|
|
@@ -5918,7 +6012,7 @@ sub ProcessExif($$$)
|
|
|
5918
6012
|
my $size = $count * $formatSize[$format];
|
|
5919
6013
|
my $readSize = $size;
|
|
5920
6014
|
if ($size > 4) {
|
|
5921
|
-
if ($size > 0x7fffffff) {
|
|
6015
|
+
if ($size > 0x7fffffff and (not $tagInfo or not $$tagInfo{ReadFromRAF})) {
|
|
5922
6016
|
$et->Warn(sprintf("Invalid size (%u) for %s %s",$size,$dir,TagName($tagID,$tagInfo)), $inMakerNotes);
|
|
5923
6017
|
++$warnCount;
|
|
5924
6018
|
next;
|