exiftool_vendored 12.25.0 → 12.32.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/Changes +114 -4
- data/bin/MANIFEST +11 -0
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +44 -43
- data/bin/arg_files/xmp2exif.args +2 -1
- data/bin/config_files/convert_regions.config +25 -14
- data/bin/config_files/example.config +1 -1
- data/bin/exiftool +72 -56
- data/bin/fmt_files/gpx.fmt +1 -1
- data/bin/fmt_files/gpx_wpt.fmt +1 -1
- data/bin/lib/Image/ExifTool/BuildTagLookup.pm +10 -2
- data/bin/lib/Image/ExifTool/CBOR.pm +277 -0
- data/bin/lib/Image/ExifTool/Canon.pm +25 -18
- data/bin/lib/Image/ExifTool/DPX.pm +13 -2
- data/bin/lib/Image/ExifTool/Exif.pm +11 -6
- data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
- data/bin/lib/Image/ExifTool/FujiFilm.pm +1 -0
- data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
- data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
- data/bin/lib/Image/ExifTool/ID3.pm +15 -3
- data/bin/lib/Image/ExifTool/JPEG.pm +68 -2
- data/bin/lib/Image/ExifTool/JSON.pm +4 -2
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +58 -26
- data/bin/lib/Image/ExifTool/LIF.pm +153 -0
- data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
- data/bin/lib/Image/ExifTool/M2TS.pm +103 -7
- data/bin/lib/Image/ExifTool/MIE.pm +2 -1
- data/bin/lib/Image/ExifTool/MRC.pm +1 -1
- data/bin/lib/Image/ExifTool/Nikon.pm +15 -4
- data/bin/lib/Image/ExifTool/NikonSettings.pm +10 -2
- data/bin/lib/Image/ExifTool/Olympus.pm +5 -2
- data/bin/lib/Image/ExifTool/Other.pm +93 -0
- data/bin/lib/Image/ExifTool/PDF.pm +9 -12
- data/bin/lib/Image/ExifTool/PNG.pm +7 -6
- data/bin/lib/Image/ExifTool/Panasonic.pm +14 -2
- data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
- data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
- data/bin/lib/Image/ExifTool/QuickTime.pm +103 -24
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +203 -121
- data/bin/lib/Image/ExifTool/README +3 -0
- data/bin/lib/Image/ExifTool/RIFF.pm +7 -2
- data/bin/lib/Image/ExifTool/Samsung.pm +47 -10
- data/bin/lib/Image/ExifTool/Sony.pm +84 -33
- data/bin/lib/Image/ExifTool/TagLookup.pm +50 -3
- data/bin/lib/Image/ExifTool/TagNames.pod +135 -29
- data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
- data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
- data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
- data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
- data/bin/lib/Image/ExifTool/WriteQuickTime.pl +11 -4
- data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
- data/bin/lib/Image/ExifTool/Writer.pl +3 -0
- data/bin/lib/Image/ExifTool/XMP.pm +17 -5
- data/bin/lib/Image/ExifTool/XMP2.pl +2 -1
- data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
- data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
- data/bin/lib/Image/ExifTool.pm +79 -37
- data/bin/lib/Image/ExifTool.pod +62 -60
- data/bin/perl-Image-ExifTool.spec +43 -42
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +6 -3
data/bin/exiftool
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
use strict;
|
11
11
|
require 5.004;
|
12
12
|
|
13
|
-
my $version = '12.
|
13
|
+
my $version = '12.32';
|
14
14
|
|
15
15
|
# add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
|
16
16
|
my $exeDir;
|
@@ -1954,10 +1954,19 @@ sub GetImageInfo($$)
|
|
1954
1954
|
my $pipe = $file;
|
1955
1955
|
if ($doUnzip) {
|
1956
1956
|
# pipe through gzip or bzip2 if necessary
|
1957
|
-
if ($file =~ /\.gz$/i) {
|
1958
|
-
$
|
1959
|
-
|
1960
|
-
|
1957
|
+
if ($file =~ /\.(gz|bz2)$/i) {
|
1958
|
+
my $type = lc $1;
|
1959
|
+
if ($file =~ /[^-_.'A-Za-z0-9\/\\]/) {
|
1960
|
+
Warn "Error: Insecure zip file name. Skipped\n";
|
1961
|
+
EFile($file);
|
1962
|
+
++$countBad;
|
1963
|
+
return;
|
1964
|
+
}
|
1965
|
+
if ($type eq 'gz') {
|
1966
|
+
$pipe = qq{gzip -dc "$file" |};
|
1967
|
+
} else {
|
1968
|
+
$pipe = qq{bzip2 -dc "$file" |};
|
1969
|
+
}
|
1961
1970
|
}
|
1962
1971
|
}
|
1963
1972
|
# evaluate -if expression for conditional processing
|
@@ -2218,7 +2227,7 @@ sub GetImageInfo($$)
|
|
2218
2227
|
my $f = $file;
|
2219
2228
|
CleanXML(\$f);
|
2220
2229
|
print $fp "\n<rdf:Description rdf:about='${f}'";
|
2221
|
-
print $fp "\n xmlns:et='http://ns.exiftool.
|
2230
|
+
print $fp "\n xmlns:et='http://ns.exiftool.org/1.0/'";
|
2222
2231
|
print $fp " et:toolkit='Image::ExifTool $Image::ExifTool::VERSION'";
|
2223
2232
|
# define namespaces for all tag groups
|
2224
2233
|
my (%groups, @groups, $grp0, $grp1);
|
@@ -2240,7 +2249,7 @@ sub GetImageInfo($$)
|
|
2240
2249
|
unless ($grp eq $grp1 and $grp =~ /^(ExifTool|File|Composite|Unknown)$/) {
|
2241
2250
|
$grp .= "/$grp1";
|
2242
2251
|
}
|
2243
|
-
print $fp "\n xmlns:$grp1='http://ns.exiftool.
|
2252
|
+
print $fp "\n xmlns:$grp1='http://ns.exiftool.org/$grp/1.0/'";
|
2244
2253
|
}
|
2245
2254
|
print $fp '>' if $outFormat < 1; # finish rdf:Description token unless short format
|
2246
2255
|
$ind = $outFormat >= 0 ? ' ' : ' ';
|
@@ -3241,7 +3250,8 @@ sub FormatXML($$$)
|
|
3241
3250
|
} elsif (ref $val eq 'HASH') {
|
3242
3251
|
$gt = " rdf:parseType='Resource'>";
|
3243
3252
|
my $val2 = '';
|
3244
|
-
|
3253
|
+
my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
|
3254
|
+
foreach (@keys) {
|
3245
3255
|
# (some variable-namespace XML structure fields may have a different group)
|
3246
3256
|
my $tok = /:/ ? $_ : ($grp . ':' . $_);
|
3247
3257
|
$val2 .= "\n$ind <$tok" . FormatXML($$val{$_}, "$ind ", $grp) . "</$tok>";
|
@@ -3318,7 +3328,8 @@ sub FormatJSON($$$)
|
|
3318
3328
|
} elsif (ref $val eq 'HASH') {
|
3319
3329
|
my ($bra, $ket, $sep) = $json == 1 ? ('{','}',':') : ('Array(',')',' =>');
|
3320
3330
|
print $fp $bra;
|
3321
|
-
|
3331
|
+
my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
|
3332
|
+
foreach (@keys) {
|
3322
3333
|
print $fp ',' if $comma;
|
3323
3334
|
my $key = EscapeJSON($_, 1);
|
3324
3335
|
print $fp qq(\n$ind $key$sep );
|
@@ -4263,7 +4274,10 @@ sub FilterArgfileLine($)
|
|
4263
4274
|
# escaped by an odd number of backslashes, and escape a single backslash
|
4264
4275
|
# if it occurs at the end of the string
|
4265
4276
|
$arg =~ s{\\(.)|(["\$\@]|\\$)}{'\\'.($2 || $1)}sge;
|
4266
|
-
|
4277
|
+
# un-escape characters in C string
|
4278
|
+
my %esc = ( a => "\a", b => "\b", f => "\f", n => "\n",
|
4279
|
+
r => "\r", t => "\t", '"' => '"', '\\' => '\\' );
|
4280
|
+
$arg =~ s/\\(.)/$esc{$1}||'\\'.$1/egs;
|
4267
4281
|
} else {
|
4268
4282
|
$arg =~ s/^\s+//; # remove leading white space
|
4269
4283
|
$arg =~ s/[\x0d\x0a]+$//s; # remove trailing newline
|
@@ -4469,47 +4483,48 @@ supported by ExifTool (r = read, w = write, c = create):
|
|
4469
4483
|
|
4470
4484
|
File Types
|
4471
4485
|
------------+-------------+-------------+-------------+------------
|
4472
|
-
360 r/w |
|
4473
|
-
3FR r |
|
4474
|
-
3G2 r/w |
|
4475
|
-
3GP r/w |
|
4476
|
-
A r |
|
4477
|
-
AA r |
|
4478
|
-
AAE r |
|
4479
|
-
AAX r/w |
|
4480
|
-
ACR r |
|
4481
|
-
AFM r |
|
4482
|
-
AI r/w |
|
4483
|
-
AIFF r |
|
4484
|
-
APE r |
|
4485
|
-
ARQ r/w |
|
4486
|
-
ARW r/w |
|
4487
|
-
ASF r |
|
4488
|
-
AVI r |
|
4489
|
-
AVIF r/w |
|
4490
|
-
AZW r |
|
4491
|
-
BMP r |
|
4492
|
-
BPG r |
|
4493
|
-
BTF r |
|
4494
|
-
CHM r |
|
4495
|
-
COS r |
|
4496
|
-
CR2 r/w |
|
4497
|
-
CR3 r/w |
|
4498
|
-
CRM r/w |
|
4499
|
-
CRW r/w |
|
4500
|
-
CS1 r/w |
|
4501
|
-
CSV r |
|
4502
|
-
CZI r |
|
4503
|
-
DCM r |
|
4504
|
-
DCP r/w |
|
4505
|
-
DCR r |
|
4506
|
-
DFONT r |
|
4507
|
-
DIVX r |
|
4508
|
-
DJVU r |
|
4509
|
-
DLL r |
|
4510
|
-
DNG r/w |
|
4511
|
-
DOC r |
|
4512
|
-
DOCX r |
|
4486
|
+
360 r/w | DR4 r/w/c | JNG r/w | ODP r | RIFF r
|
4487
|
+
3FR r | DSS r | JP2 r/w | ODS r | RSRC r
|
4488
|
+
3G2 r/w | DV r | JPEG r/w | ODT r | RTF r
|
4489
|
+
3GP r/w | DVB r/w | JSON r | OFR r | RW2 r/w
|
4490
|
+
A r | DVR-MS r | JXL r | OGG r | RWL r/w
|
4491
|
+
AA r | DYLIB r | K25 r | OGV r | RWZ r
|
4492
|
+
AAE r | EIP r | KDC r | ONP r | RM r
|
4493
|
+
AAX r/w | EPS r/w | KEY r | OPUS r | SEQ r
|
4494
|
+
ACR r | EPUB r | LA r | ORF r/w | SKETCH r
|
4495
|
+
AFM r | ERF r/w | LFP r | ORI r/w | SO r
|
4496
|
+
AI r/w | EXE r | LIF r | OTF r | SR2 r/w
|
4497
|
+
AIFF r | EXIF r/w/c | LNK r | PAC r | SRF r
|
4498
|
+
APE r | EXR r | LRV r/w | PAGES r | SRW r/w
|
4499
|
+
ARQ r/w | EXV r/w/c | M2TS r | PBM r/w | SVG r
|
4500
|
+
ARW r/w | F4A/V r/w | M4A/V r/w | PCD r | SWF r
|
4501
|
+
ASF r | FFF r/w | MACOS r | PCX r | THM r/w
|
4502
|
+
AVI r | FITS r | MAX r | PDB r | TIFF r/w
|
4503
|
+
AVIF r/w | FLA r | MEF r/w | PDF r/w | TORRENT r
|
4504
|
+
AZW r | FLAC r | MIE r/w/ | PEF r/w | TTC r
|
4505
|
+
BMP r | FLIF r/w | MIFF r c | PFA r | TTF r
|
4506
|
+
BPG r | FLV r | MKA r | PFB r | TXT r
|
4507
|
+
BTF r | FPF r | MKS r | PFM r | VCF r
|
4508
|
+
CHM r | FPX r | MKV r | PGF r | VRD r/w/c
|
4509
|
+
COS r | GIF r/w | MNG r/w | PGM r/w | VSD r
|
4510
|
+
CR2 r/w | GPR r/w | MOBI r | PLIST r | WAV r
|
4511
|
+
CR3 r/w | GZ r | MODD r | PICT r | WDP r/w
|
4512
|
+
CRM r/w | HDP r/w | MOI r | PMP r | WEBP r
|
4513
|
+
CRW r/w | HDR r | MOS r/w | PNG r/w | WEBM r
|
4514
|
+
CS1 r/w | HEIC r/w | MOV r/w | PPM r/w | WMA r
|
4515
|
+
CSV r | HEIF r/w | MP3 r | PPT r | WMV r
|
4516
|
+
CZI r | HTML r | MP4 r/w | PPTX r | WTV r
|
4517
|
+
DCM r | ICC r/w/c | MPC r | PS r/w | WV r
|
4518
|
+
DCP r/w | ICS r | MPG r | PSB r/w | X3F r/w
|
4519
|
+
DCR r | IDML r | MPO r/w | PSD r/w | XCF r
|
4520
|
+
DFONT r | IIQ r/w | MQV r/w | PSP r | XLS r
|
4521
|
+
DIVX r | IND r/w | MRC r | QTIF r/w | XLSX r
|
4522
|
+
DJVU r | INSP r/w | MRW r/w | R3D r | XMP r/w/c
|
4523
|
+
DLL r | INSV r | MXF r | RA r | ZIP r
|
4524
|
+
DNG r/w | INX r | NEF r/w | RAF r/w |
|
4525
|
+
DOC r | ISO r | NRW r/w | RAM r |
|
4526
|
+
DOCX r | ITC r | NUMBERS r | RAR r |
|
4527
|
+
DPX r | J2C r | O r | RAW r/w |
|
4513
4528
|
|
4514
4529
|
Meta Information
|
4515
4530
|
----------------------+----------------------+---------------------
|
@@ -5393,7 +5408,7 @@ with this command:
|
|
5393
5408
|
|
5394
5409
|
produces output like this:
|
5395
5410
|
|
5396
|
-
-- Generated by ExifTool 12.
|
5411
|
+
-- Generated by ExifTool 12.32 --
|
5397
5412
|
File: a.jpg - 2003:10:31 15:44:19
|
5398
5413
|
(f/5.6, 1/60s, ISO 100)
|
5399
5414
|
File: b.jpg - 2006:05:23 11:57:38
|
@@ -5709,9 +5724,10 @@ The B<-t> option adds tag table information to the output (see B<-t> for
|
|
5709
5724
|
details).
|
5710
5725
|
|
5711
5726
|
Note: This output is NOT the same as XMP because it uses
|
5712
|
-
dynamically-generated property names corresponding to the ExifTool tag
|
5713
|
-
names, and not the standard XMP
|
5714
|
-
|
5727
|
+
dynamically-generated property names corresponding to the ExifTool tag names
|
5728
|
+
with ExifTool family 1 group names as namespaces, and not the standard XMP
|
5729
|
+
properties and namespaces. To write XMP instead, use the B<-o> option with
|
5730
|
+
an XMP extension for the output file.
|
5715
5731
|
|
5716
5732
|
=back
|
5717
5733
|
|
@@ -6358,7 +6374,7 @@ exit status of the command (see L</EXIT STATUS>).
|
|
6358
6374
|
|
6359
6375
|
Save the names of files giving errors (I<NUM> missing or 1), files that were
|
6360
6376
|
unchanged (I<NUM> is 2), files that fail the B<-if> condition (I<NUM> is 4),
|
6361
|
-
or any combination thereof
|
6377
|
+
or any combination thereof by summing I<NUM> (eg. B<-efile3> is the same
|
6362
6378
|
has having both B<-efile> and B<-efile2> options with the same I<ERRFILE>).
|
6363
6379
|
By default, file names are appended to any existing I<ERRFILE>, but
|
6364
6380
|
I<ERRFILE> is overwritten if an exclamation point is added to the option
|
data/bin/fmt_files/gpx.fmt
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
# 2019/10/24 - PH Preserve sub-seconds in GPSDateTime value
|
14
14
|
#
|
15
15
|
# Notes: 1) Input file(s) must contain GPSLatitude and GPSLongitude.
|
16
|
-
# 2) The -
|
16
|
+
# 2) The -ee3 option is to extract the full track from video files.
|
17
17
|
# 3) The -fileOrder option may be used to control the order of the
|
18
18
|
# generated track points when processing multiple files.
|
19
19
|
#------------------------------------------------------------------------------
|
data/bin/fmt_files/gpx_wpt.fmt
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# 2019/10/24 - PH Preserve sub-seconds in GPSDateTime value
|
15
15
|
#
|
16
16
|
# Notes: 1) Input file(s) must contain GPSLatitude and GPSLongitude.
|
17
|
-
# 2) The -
|
17
|
+
# 2) The -ee3 option is to extract the full track from video files.
|
18
18
|
# 3) The -fileOrder option may be used to control the order of the
|
19
19
|
# generated track points when processing multiple files.
|
20
20
|
#------------------------------------------------------------------------------
|
@@ -35,7 +35,7 @@ use Image::ExifTool::Sony;
|
|
35
35
|
use Image::ExifTool::Validate;
|
36
36
|
use Image::ExifTool::MacOS;
|
37
37
|
|
38
|
-
$VERSION = '3.
|
38
|
+
$VERSION = '3.45';
|
39
39
|
@ISA = qw(Exporter);
|
40
40
|
|
41
41
|
sub NumbersFirst($$);
|
@@ -68,6 +68,7 @@ my %tweakOrder = (
|
|
68
68
|
IPTC => 'Exif', # put IPTC after EXIF,
|
69
69
|
GPS => 'XMP', # etc...
|
70
70
|
Composite => 'Extra',
|
71
|
+
CBOR => 'JSON',
|
71
72
|
GeoTiff => 'GPS',
|
72
73
|
CanonVRD=> 'CanonCustom',
|
73
74
|
DJI => 'Casio',
|
@@ -2117,7 +2118,7 @@ sub WriteTagNames($$)
|
|
2117
2118
|
$short = $$shortName{$tableName};
|
2118
2119
|
my @names = split ' ', $short;
|
2119
2120
|
my $class = shift @names;
|
2120
|
-
if (@names) {
|
2121
|
+
if (@names and $class ne 'Other') {
|
2121
2122
|
# add heading for tables without a Main
|
2122
2123
|
unless ($heading eq $class) {
|
2123
2124
|
$heading = $class;
|
@@ -2145,6 +2146,13 @@ sub WriteTagNames($$)
|
|
2145
2146
|
$short = $$shortName{$tableName};
|
2146
2147
|
$short = $tableName unless $short;
|
2147
2148
|
$url = "$short.html";
|
2149
|
+
# handle various tables in "Other.pm"
|
2150
|
+
if ($short =~ /^Other (.*)/) {
|
2151
|
+
$short = $1;
|
2152
|
+
$url = 'Other.html#' . $1;
|
2153
|
+
} else {
|
2154
|
+
$url = "$short.html";
|
2155
|
+
}
|
2148
2156
|
print HTMLFILE "<a href='${url}'>$short</a>";
|
2149
2157
|
++$count;
|
2150
2158
|
}
|
@@ -0,0 +1,277 @@
|
|
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.00';
|
19
|
+
|
20
|
+
sub ProcessCBOR($$$);
|
21
|
+
sub ReadCBORValue($$$$);
|
22
|
+
|
23
|
+
# optional CBOR type codes
|
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 $fmt = Get8u($dataPt, $pos++);
|
82
|
+
my $dat = $fmt & 0x1f;
|
83
|
+
my ($num, $val, $err, $size);
|
84
|
+
$fmt >>= 5;
|
85
|
+
if ($dat < 24) {
|
86
|
+
$num = $dat;
|
87
|
+
} elsif ($dat == 31) { # indefinite count (not used in C2PA)
|
88
|
+
$num = -1; # (flag for indefinite count)
|
89
|
+
$et->VPrint(1, "$$et{INDENT} (indefinite count):\n");
|
90
|
+
} else {
|
91
|
+
my $format = { 24 => 'int8u', 25 => 'int16u', 26 => 'int32u', 27 => 'int64u' }->{$dat};
|
92
|
+
return(undef, "Invalid CBOR integer type $dat", $pos) unless $format;
|
93
|
+
$size = Image::ExifTool::FormatSize($format);
|
94
|
+
return(undef, 'Truncated CBOR integer value', $pos) if $pos + $size > $end;
|
95
|
+
$num = ReadValue($dataPt, $pos, $format, 1, $size);
|
96
|
+
$pos += $size;
|
97
|
+
}
|
98
|
+
my ($pre, $opt) = ('', ':');
|
99
|
+
if ($verbose and $fmt != 6) {
|
100
|
+
if (defined $$et{cbor_pre}) {
|
101
|
+
$pre = "$$et{cbor_pre}";
|
102
|
+
delete $$et{cbor_pre};
|
103
|
+
}
|
104
|
+
if (defined $$et{cbor_opt}) {
|
105
|
+
$opt = ", $$et{cbor_opt}:";
|
106
|
+
delete $$et{cbor_opt};
|
107
|
+
}
|
108
|
+
}
|
109
|
+
if ($fmt == 0) { # positive integer
|
110
|
+
$val = $num;
|
111
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}int+$opt $val\n");
|
112
|
+
} elsif ($fmt == 1) { # negative integer
|
113
|
+
$val = -1 * $num;
|
114
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}int-$opt $val\n");
|
115
|
+
} elsif ($fmt == 2 or $fmt == 3) { # byte/UTF8 string
|
116
|
+
return(undef, 'Truncated CBOR string value', $pos) if $pos + $num > $end;
|
117
|
+
if ($num < 0) { # (should not happen in C2PA)
|
118
|
+
my $string = '';
|
119
|
+
$$et{INDENT} .= ' ';
|
120
|
+
for (;;) {
|
121
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
122
|
+
return(undef, $err, $pos) if $err;
|
123
|
+
last if not defined $val; # hit the break?
|
124
|
+
# (note: strictly we should be checking that this was a string we read)
|
125
|
+
$string .= $val;
|
126
|
+
}
|
127
|
+
$$et{INDENT} = $indent;
|
128
|
+
return($string, undef, $pos); # return concatenated strings
|
129
|
+
} else {
|
130
|
+
$val = substr($$dataPt, $pos, $num);
|
131
|
+
}
|
132
|
+
$pos += $num;
|
133
|
+
if ($fmt == 2) {
|
134
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}byte$opt <binary data ".length($val)." bytes>\n");
|
135
|
+
return(\$val, undef, $pos); # (byte string)
|
136
|
+
}
|
137
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}text$opt '${val}'\n");
|
138
|
+
} elsif ($fmt == 4 or $fmt == 5) { # list/hash
|
139
|
+
if ($fmt == 4) {
|
140
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}list$opt <$num elements>\n");
|
141
|
+
} else {
|
142
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}hash$opt <$num pairs>\n");
|
143
|
+
$num *= 2;
|
144
|
+
}
|
145
|
+
$$et{INDENT} .= ' ';
|
146
|
+
my $i = 0;
|
147
|
+
my @list;
|
148
|
+
while ($num) {
|
149
|
+
$$et{cbor_pre} = "$i) ";
|
150
|
+
if ($fmt == 4) {
|
151
|
+
++$i;
|
152
|
+
} elsif ($num & 0x01) {
|
153
|
+
$$et{cbor_pre} = ' ' x length($$et{cbor_pre});
|
154
|
+
++$i;
|
155
|
+
}
|
156
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
157
|
+
return(undef, $err, $pos) if $err;
|
158
|
+
if (not defined $val) {
|
159
|
+
return(undef, 'Unexpected list terminator', $pos) unless $num < 0;
|
160
|
+
last;
|
161
|
+
}
|
162
|
+
push @list, $val;
|
163
|
+
--$num;
|
164
|
+
}
|
165
|
+
$$et{INDENT} = $indent;
|
166
|
+
if ($fmt == 5) {
|
167
|
+
my ($i, @keys);
|
168
|
+
my %hash = ( _ordered_keys_ => \@keys );
|
169
|
+
for ($i=0; $i<@list-1; $i+=2) {
|
170
|
+
$hash{$list[$i]} = $list[$i+1];
|
171
|
+
push @keys, $list[$i]; # save ordered list of keys
|
172
|
+
}
|
173
|
+
$val = \%hash;
|
174
|
+
} else {
|
175
|
+
$val = \@list;
|
176
|
+
}
|
177
|
+
} elsif ($fmt == 6) { # optional type
|
178
|
+
$$et{cbor_opt} = $cborType6{$num} || "<unknown type $num>";
|
179
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
180
|
+
} elsif ($fmt == 7) {
|
181
|
+
if ($dat == 31) {
|
182
|
+
undef $val; # "break" = end of indefinite array/hash (not used in C2PA)
|
183
|
+
} elsif ($dat < 24) {
|
184
|
+
$val = $cborType7{$num};
|
185
|
+
$val = "Unknown ($val)" unless defined $val;
|
186
|
+
} elsif ($dat == 25) { # half-precision float
|
187
|
+
my $exp = ($num >> 10) & 0x1f;
|
188
|
+
my $mant = $num & 0x3ff;
|
189
|
+
if ($exp == 0) {
|
190
|
+
$val = $mant ** -24;
|
191
|
+
$val *= -1 if $num & 0x8000;
|
192
|
+
} elsif (exp != 31) {
|
193
|
+
$val = ($mant + 1024) ** ($exp - 25);
|
194
|
+
$val *= -1 if $num & 0x8000;
|
195
|
+
} else {
|
196
|
+
$val = $mant == 0 ? '<inf>' : '<nan>';
|
197
|
+
}
|
198
|
+
} elsif ($dat == 26) { # float
|
199
|
+
$val = GetFloat($dataPt, $pos - $size);
|
200
|
+
} elsif ($dat == 27) { # double
|
201
|
+
$val = GetDouble($dataPt, $pos - $size);
|
202
|
+
} else {
|
203
|
+
return(undef, "Invalid CBOR type 7 variant $num", $pos);
|
204
|
+
}
|
205
|
+
$et->VPrint(1, "$$et{INDENT} ${pre}typ7$opt ".(defined $val ? $val : '<break>')."\n");
|
206
|
+
} else {
|
207
|
+
return(undef, "Unknown CBOR format $fmt", $pos);
|
208
|
+
}
|
209
|
+
return($val, $err, $pos);
|
210
|
+
}
|
211
|
+
|
212
|
+
#------------------------------------------------------------------------------
|
213
|
+
# Read CBOR box
|
214
|
+
# Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
|
215
|
+
# Returns: 1 on success
|
216
|
+
sub ProcessCBOR($$$)
|
217
|
+
{
|
218
|
+
my ($et, $dirInfo, $tagTablePtr) = @_;
|
219
|
+
my $dataPt = $$dirInfo{DataPt};
|
220
|
+
my $pos = $$dirInfo{DirStart};
|
221
|
+
my $end = $pos + $$dirInfo{DirLen};
|
222
|
+
$et->VerboseDir('CBOR', undef, $$dirInfo{DirLen});
|
223
|
+
my ($val, $err, $tag);
|
224
|
+
require Image::ExifTool::CBOR;
|
225
|
+
while ($pos < $end) {
|
226
|
+
($val, $err, $pos) = ReadCBORValue($et, $dataPt, $pos, $end);
|
227
|
+
$err and $et->Warn($err), last;
|
228
|
+
ref $val eq 'HASH' or $et->VPrint(1, "$$et{INDENT} CBOR end: Non-hash encountered\n"), last;
|
229
|
+
foreach $tag (@{$$val{_ordered_keys_}}) {
|
230
|
+
Image::ExifTool::JSON::ProcessTag($et, $tagTablePtr, $tag, $$val{$tag});
|
231
|
+
}
|
232
|
+
}
|
233
|
+
return 1;
|
234
|
+
}
|
235
|
+
|
236
|
+
1; # end
|
237
|
+
|
238
|
+
__END__
|
239
|
+
|
240
|
+
=head1 NAME
|
241
|
+
|
242
|
+
Image::ExifTool::CBOR - Read CBOR format metadata
|
243
|
+
|
244
|
+
=head1 SYNOPSIS
|
245
|
+
|
246
|
+
This module is used by Image::ExifTool
|
247
|
+
|
248
|
+
=head1 DESCRIPTION
|
249
|
+
|
250
|
+
This module contains definitions required by Image::ExifTool read Concise
|
251
|
+
Binary Object Representation (CBOR) formatted metadata, used by the C2PA
|
252
|
+
specification.
|
253
|
+
|
254
|
+
=head1 AUTHOR
|
255
|
+
|
256
|
+
Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
|
257
|
+
|
258
|
+
This library is free software; you can redistribute it and/or modify it
|
259
|
+
under the same terms as Perl itself.
|
260
|
+
|
261
|
+
=head1 REFERENCES
|
262
|
+
|
263
|
+
=over 4
|
264
|
+
|
265
|
+
=item L<https://c2pa.org/public-draft/>
|
266
|
+
|
267
|
+
=item L<https://datatracker.ietf.org/doc/html/rfc7049>
|
268
|
+
|
269
|
+
=back
|
270
|
+
|
271
|
+
=head1 SEE ALSO
|
272
|
+
|
273
|
+
L<Image::ExifTool::TagNames/CBOR Tags>,
|
274
|
+
L<Image::ExifTool(3pm)|Image::ExifTool>
|
275
|
+
|
276
|
+
=cut
|
277
|
+
|
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
|
|
88
88
|
sub ProcessExifInfo($$$);
|
89
89
|
sub SwapWords($);
|
90
90
|
|
91
|
-
$VERSION = '4.
|
91
|
+
$VERSION = '4.51';
|
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)
|
@@ -519,7 +519,8 @@ $VERSION = '4.47';
|
|
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.47';
|
|
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
|
@@ -579,19 +581,21 @@ $VERSION = '4.47';
|
|
579
581
|
61182.7 => 'Canon RF 15-35mm F2.8L IS USM',
|
580
582
|
61182.8 => 'Canon RF 24-240mm F4-6.3 IS USM',
|
581
583
|
61182.9 => 'Canon RF 70-200mm F2.8L IS USM',
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
584
|
+
'61182.10' => 'Canon RF 85mm F2 MACRO IS STM',
|
585
|
+
'61182.11' => 'Canon RF 600mm F11 IS STM',
|
586
|
+
'61182.12' => 'Canon RF 600mm F11 IS STM + RF1.4x',
|
587
|
+
'61182.13' => 'Canon RF 600mm F11 IS STM + RF2x',
|
588
|
+
'61182.14' => 'Canon RF 800mm F11 IS STM',
|
589
|
+
'61182.15' => 'Canon RF 800mm F11 IS STM + RF1.4x',
|
590
|
+
'61182.16' => 'Canon RF 800mm F11 IS STM + RF2x',
|
591
|
+
'61182.17' => 'Canon RF 24-105mm F4-7.1 IS STM',
|
592
|
+
'61182.18' => 'Canon RF 100-500mm F4.5-7.1L IS USM',
|
593
|
+
'61182.19' => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF1.4x',
|
594
|
+
'61182.20' => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
|
595
|
+
'61182.21' => 'Canon RF 70-200mm F4L IS USM', #42
|
596
|
+
'61182.22' => 'Canon RF 50mm F1.8 STM', #42
|
597
|
+
'61182.23' => 'Canon RF 14-35mm F4L IS USM', #IB
|
598
|
+
#'61182.xx' => 'Canon RF 100mm F2.8L MACRO IS USM',
|
595
599
|
65535 => 'n/a',
|
596
600
|
);
|
597
601
|
|
@@ -6760,6 +6764,8 @@ my %ciMaxFocal = (
|
|
6760
6764
|
277 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
|
6761
6765
|
278 => 'Canon RF 70-200mm F4L IS USM', #42
|
6762
6766
|
280 => 'Canon RF 50mm F1.8 STM', #42
|
6767
|
+
281 => 'Canon RF 14-35mm F4L IS USM', #42/IB
|
6768
|
+
#xxx => 'Canon RF 100mm F2.8L MACRO IS USM',
|
6763
6769
|
# Note: add new RF lenses to %canonLensTypes with ID 61182
|
6764
6770
|
},
|
6765
6771
|
},
|
@@ -9253,8 +9259,9 @@ sub PrintLensID(@)
|
|
9253
9259
|
push @likely, $tclens;
|
9254
9260
|
if ($maxAperture) {
|
9255
9261
|
# (not 100% sure that TC affects MaxAperture, but it should!)
|
9256
|
-
|
9257
|
-
next if $maxAperture
|
9262
|
+
# (RF 24-105mm F4L IS USM shows a MaxAperture of 4.177)
|
9263
|
+
next if $maxAperture < $sa * $tc - 0.18;
|
9264
|
+
next if $maxAperture > $la * $tc + 0.18;
|
9258
9265
|
}
|
9259
9266
|
push @matches, $tclens;
|
9260
9267
|
}
|
@@ -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]' },
|