exiftool_vendored 12.18.0 → 12.33.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +236 -4
  3. data/bin/MANIFEST +23 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +45 -43
  7. data/bin/arg_files/xmp2exif.args +2 -1
  8. data/bin/config_files/acdsee.config +193 -6
  9. data/bin/config_files/convert_regions.config +25 -14
  10. data/bin/config_files/cuepointlist.config +70 -0
  11. data/bin/config_files/example.config +2 -9
  12. data/bin/exiftool +152 -97
  13. data/bin/fmt_files/gpx.fmt +2 -2
  14. data/bin/fmt_files/gpx_wpt.fmt +2 -2
  15. data/bin/fmt_files/kml.fmt +1 -1
  16. data/bin/fmt_files/kml_track.fmt +1 -1
  17. data/bin/lib/Image/ExifTool/Apple.pm +3 -2
  18. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +31 -13
  19. data/bin/lib/Image/ExifTool/CBOR.pm +331 -0
  20. data/bin/lib/Image/ExifTool/Canon.pm +44 -19
  21. data/bin/lib/Image/ExifTool/DJI.pm +6 -6
  22. data/bin/lib/Image/ExifTool/DPX.pm +13 -2
  23. data/bin/lib/Image/ExifTool/DjVu.pm +6 -5
  24. data/bin/lib/Image/ExifTool/Exif.pm +124 -13
  25. data/bin/lib/Image/ExifTool/FITS.pm +13 -2
  26. data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
  27. data/bin/lib/Image/ExifTool/FujiFilm.pm +19 -8
  28. data/bin/lib/Image/ExifTool/GPS.pm +22 -11
  29. data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
  30. data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
  31. data/bin/lib/Image/ExifTool/ICC_Profile.pm +2 -2
  32. data/bin/lib/Image/ExifTool/ID3.pm +15 -3
  33. data/bin/lib/Image/ExifTool/JPEG.pm +74 -4
  34. data/bin/lib/Image/ExifTool/JSON.pm +30 -5
  35. data/bin/lib/Image/ExifTool/Jpeg2000.pm +395 -16
  36. data/bin/lib/Image/ExifTool/LIF.pm +153 -0
  37. data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
  38. data/bin/lib/Image/ExifTool/M2TS.pm +137 -5
  39. data/bin/lib/Image/ExifTool/MIE.pm +4 -3
  40. data/bin/lib/Image/ExifTool/MRC.pm +341 -0
  41. data/bin/lib/Image/ExifTool/MWG.pm +3 -3
  42. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  43. data/bin/lib/Image/ExifTool/MacOS.pm +3 -3
  44. data/bin/lib/Image/ExifTool/Microsoft.pm +298 -82
  45. data/bin/lib/Image/ExifTool/Nikon.pm +18 -5
  46. data/bin/lib/Image/ExifTool/NikonSettings.pm +19 -2
  47. data/bin/lib/Image/ExifTool/Olympus.pm +10 -3
  48. data/bin/lib/Image/ExifTool/Other.pm +93 -0
  49. data/bin/lib/Image/ExifTool/PDF.pm +9 -12
  50. data/bin/lib/Image/ExifTool/PNG.pm +8 -7
  51. data/bin/lib/Image/ExifTool/Panasonic.pm +28 -3
  52. data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
  53. data/bin/lib/Image/ExifTool/PhaseOne.pm +4 -3
  54. data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
  55. data/bin/lib/Image/ExifTool/QuickTime.pm +234 -75
  56. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +283 -141
  57. data/bin/lib/Image/ExifTool/README +5 -2
  58. data/bin/lib/Image/ExifTool/RIFF.pm +89 -12
  59. data/bin/lib/Image/ExifTool/Samsung.pm +48 -10
  60. data/bin/lib/Image/ExifTool/Shortcuts.pm +9 -0
  61. data/bin/lib/Image/ExifTool/Sony.pm +230 -69
  62. data/bin/lib/Image/ExifTool/TagInfoXML.pm +1 -0
  63. data/bin/lib/Image/ExifTool/TagLookup.pm +4145 -4029
  64. data/bin/lib/Image/ExifTool/TagNames.pod +671 -287
  65. data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
  66. data/bin/lib/Image/ExifTool/WriteExif.pl +1 -1
  67. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  68. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  69. data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
  70. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -0
  71. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +55 -21
  72. data/bin/lib/Image/ExifTool/WriteXMP.pl +7 -3
  73. data/bin/lib/Image/ExifTool/Writer.pl +47 -10
  74. data/bin/lib/Image/ExifTool/XMP.pm +45 -15
  75. data/bin/lib/Image/ExifTool/XMP2.pl +3 -1
  76. data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
  77. data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
  78. data/bin/lib/Image/ExifTool.pm +233 -81
  79. data/bin/lib/Image/ExifTool.pod +114 -93
  80. data/bin/perl-Image-ExifTool.spec +43 -42
  81. data/lib/exiftool_vendored/version.rb +1 -1
  82. metadata +28 -13
@@ -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.41';
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',
@@ -141,6 +142,9 @@ my %formatOK = (
141
142
  signed => 1,
142
143
  unsigned => 1,
143
144
  utf8 => 1,
145
+ Unicode => 1, # (Microsoft Xtra)
146
+ GUID => 1, # (Microsoft Xtra)
147
+ vt_filetime => 1, # (Microsoft Xtra)
144
148
  );
145
149
 
146
150
  # Descriptions for the TagNames documentation
@@ -431,11 +435,13 @@ L<UserData|Image::ExifTool::TagNames/QuickTime UserData Tags>, and
431
435
  finally in L<Keys|Image::ExifTool::TagNames/QuickTime Keys Tags>,
432
436
  but this order may be changed by setting the PREFERRED level of the
433
437
  appropriate table in the config file (see
434
- L<example.config|../config.html#PREF> in the full distribution for
435
- an example). ExifTool currently writes only top-level metadata in
436
- QuickTime-based files; it extracts other track-specific and timed
437
- metadata, but can not yet edit tags in these locations (with the
438
- exception of track-level date/time tags).
438
+ L<example.config|../config.html#PREF> in the full distribution for an
439
+ example). Note that some tags with the same name but different ID's may
440
+ exist in the same location, but the family 7 group names may be used to
441
+ differentiate these. ExifTool currently writes only top-level metadata in
442
+ QuickTime-based files; it extracts other track-specific and timed metadata,
443
+ but can not yet edit tags in these locations (with the exception of
444
+ track-level date/time tags).
439
445
 
440
446
  Alternate language tags may be accessed for
441
447
  L<ItemList|Image::ExifTool::TagNames/QuickTime ItemList Tags> and
@@ -454,14 +460,14 @@ According to the specification, integer-format QuickTime date/time tags
454
460
  should be stored as UTC. Unfortunately, digital cameras often store local
455
461
  time values instead (presumably because they don't know the time zone). For
456
462
  this reason, by default ExifTool does not assume a time zone for these
457
- values. However, if the L<QuickTimeUTC|../ExifTool.html#QuickTimeUTC> API option is set, then ExifTool will
463
+ values. However, if the API L<QuickTimeUTC|../ExifTool.html#QuickTimeUTC> option is set, then ExifTool will
458
464
  assume these values are properly stored as UTC, and will convert them to
459
465
  local time when extracting.
460
466
 
461
467
  When writing string-based date/time tags, the system time zone is added if
462
468
  the PrintConv option is enabled and no time zone is specified. This is
463
- because Apple software may display a crazy values if the time zone is
464
- missing for some tags.
469
+ because Apple software may display crazy values if the time zone is missing
470
+ for some tags.
465
471
 
466
472
  See
467
473
  L<https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/>
@@ -634,7 +640,7 @@ overlapping EXIF, IPTC and XMP tags to be reconciled when reading, and
634
640
  synchronized when writing. The MWG Composite tags below are designed to aid
635
641
  in the implementation of these recommendations. As well, the MWG defines
636
642
  new XMP tags which are listed in the subsequent tables below. See
637
- L<https://web.archive.org/web/20181006115950/http://www.metadataworkinggroup.org/specs/>
643
+ L<https://web.archive.org/web/20180919181934/http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf>
638
644
  for the official MWG specification.
639
645
  },
640
646
  MacOS => q{
@@ -699,10 +705,14 @@ my %shortcutNotes = (
699
705
  large binary data tags which may be excluded to reduce memory usage if
700
706
  memory limitations are a problem
701
707
  },
708
+ 'ls-l' => q{
709
+ mimics columns shown by Unix "ls -l" command. Includes some tags which are
710
+ extracted only if the API L<SystemTags|../ExifTool.html#SystemTags> option
711
+ is enabled
712
+ },
702
713
  );
703
714
 
704
-
705
- # same thing for RIFF INFO tags found in the EXIF spec
715
+ # lookup for RIFF INFO tags which are found in the EXIF spec
706
716
  my %riffSpec = (
707
717
  IARL => 1, ICRD => 1, IGNR => 1, IPLT => 1, ISRC => 1,
708
718
  IART => 1, ICRP => 1, IKEY => 1, IPRD => 1, ISRF => 1,
@@ -1320,6 +1330,7 @@ TagID: foreach $tagID (@keys) {
1320
1330
  my $count = $$tagInfo{Count} || 1;
1321
1331
  # adjust count to Writable size if different than Format
1322
1332
  if ($writable and $format and $writable ne $format and
1333
+ $writable ne 'string' and $format ne 'string' and
1323
1334
  $Image::ExifTool::Exif::formatNumber{$writable} and
1324
1335
  $Image::ExifTool::Exif::formatNumber{$format})
1325
1336
  {
@@ -2107,7 +2118,7 @@ sub WriteTagNames($$)
2107
2118
  $short = $$shortName{$tableName};
2108
2119
  my @names = split ' ', $short;
2109
2120
  my $class = shift @names;
2110
- if (@names) {
2121
+ if (@names and $class ne 'Other') {
2111
2122
  # add heading for tables without a Main
2112
2123
  unless ($heading eq $class) {
2113
2124
  $heading = $class;
@@ -2135,6 +2146,13 @@ sub WriteTagNames($$)
2135
2146
  $short = $$shortName{$tableName};
2136
2147
  $short = $tableName unless $short;
2137
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
+ }
2138
2156
  print HTMLFILE "<a href='${url}'>$short</a>";
2139
2157
  ++$count;
2140
2158
  }
@@ -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.44';
91
+ $VERSION = '4.52';
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.44';
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
@@ -473,7 +473,8 @@ $VERSION = '4.44';
473
473
  253 => 'Canon EF 70-200mm f/2.8L IS II USM + 2x', #PH (NC)
474
474
  253.1 => 'Canon EF 70-200mm f/2.8L IS III USM + 2x', #PH (NC)
475
475
  # 253.2 => 'Tamron SP 70-200mm f/2.8 Di VC USD G2 (A025) + 2x', #forum9367
476
- 254 => 'Canon EF 100mm f/2.8L Macro IS USM', #42
476
+ 254 => 'Canon EF 100mm f/2.8L Macro IS USM or Tamron Lens', #42
477
+ 254.1 => 'Tamron SP 90mm f/2.8 Di VC USD 1:1 Macro (F017)', #PH
477
478
  255 => 'Sigma 24-105mm f/4 DG OS HSM | A or Other Lens', #50
478
479
  255.1 => 'Sigma 180mm f/2.8 EX DG OS HSM APO Macro', #50
479
480
  255.2 => 'Tamron SP 70-200mm f/2.8 Di VC USD', #exiv issue 1202 (A009)
@@ -518,7 +519,8 @@ $VERSION = '4.44';
518
519
  507 => 'Canon EF 16-35mm f/4L IS USM', #42
519
520
  508 => 'Canon EF 11-24mm f/4L USM or Tamron Lens', #PH
520
521
  508.1 => 'Tamron 10-24mm f/3.5-4.5 Di II VC HLD (B023)', #PH
521
- 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
522
524
  747 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM or Tamron Lens', #JR
523
525
  747.1 => 'Tamron SP 150-600mm f/5-6.3 Di VC USD G2', #50
524
526
  748 => 'Canon EF 100-400mm f/4.5-5.6L IS II USM + 1.4x or Tamron Lens', #JR (1.4x Mk III)
@@ -556,7 +558,8 @@ $VERSION = '4.44';
556
558
  4158 => 'Canon EF-S 18-55mm f/4-5.6 IS STM', #PH
557
559
  4159 => 'Canon EF-M 32mm f/1.4 STM', #42
558
560
  4160 => 'Canon EF-S 35mm f/2.8 Macro IS STM', #42
559
- 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)
560
563
  # (Nano USM lenses - 0x90xx)
561
564
  36910 => 'Canon EF 70-300mm f/4-5.6 IS II USM', #42
562
565
  36912 => 'Canon EF-S 18-135mm f/3.5-5.6 IS USM', #42
@@ -578,17 +581,22 @@ $VERSION = '4.44';
578
581
  61182.7 => 'Canon RF 15-35mm F2.8L IS USM',
579
582
  61182.8 => 'Canon RF 24-240mm F4-6.3 IS USM',
580
583
  61182.9 => 'Canon RF 70-200mm F2.8L IS USM',
581
- 61182.10 => 'Canon RF 85mm F2 MACRO IS STM',
582
- 61182.11 => 'Canon RF 600mm F11 IS STM',
583
- 61182.12 => 'Canon RF 600mm F11 IS STM + RF1.4x',
584
- 61182.13 => 'Canon RF 600mm F11 IS STM + RF2x',
585
- 61182.14 => 'Canon RF 800mm F11 IS STM',
586
- 61182.15 => 'Canon RF 800mm F11 IS STM + RF1.4x',
587
- 61182.16 => 'Canon RF 800mm F11 IS STM + RF2x',
588
- 61182.17 => 'Canon RF 24-105mm F4-7.1 IS STM',
589
- 61182.18 => 'Canon RF 100-500mm F4.5-7.1L IS USM',
590
- 61182.19 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF1.4x',
591
- 61182.20 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
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.24' => 'Canon RF 16mm F2.8 STM', #42
599
+ #'61182.xx' => 'Canon RF 100mm F2.8L MACRO IS USM',
592
600
  65535 => 'n/a',
593
601
  );
594
602
 
@@ -945,6 +953,7 @@ $VERSION = '4.44';
945
953
  0x80000437 => 'EOS 90D', #IB
946
954
  0x80000453 => 'EOS R6', #PH
947
955
  0x80000467 => 'PowerShot ZOOM',
956
+ 0x80000468 => 'EOS M50 Mark II / Kiss M2', #IB
948
957
  0x80000520 => 'EOS D2000C', #IB
949
958
  0x80000560 => 'EOS D6000C', #PH (guess)
950
959
  );
@@ -6723,7 +6732,17 @@ my %ciMaxFocal = (
6723
6732
  PrintConvInv => '$val =~ s/ ?m$//; IsFloat($val) ? $val : 655.35',
6724
6733
  },
6725
6734
  # 22 - values: 0, 1
6726
- # 23 - values: 0, 21, 22
6735
+ 23 => { #JohnMoyer (forum12925)
6736
+ Name => 'ShutterMode',
6737
+ PrintConv => {
6738
+ 0 => 'Mechanical',
6739
+ 1 => 'Electronic First Curtain',
6740
+ 2 => 'Electronic',
6741
+ # 3 => ?
6742
+ # 21 => ?
6743
+ # 22 => ?
6744
+ },
6745
+ },
6727
6746
  25 => { #PH
6728
6747
  Name => 'FlashExposureLock',
6729
6748
  PrintConv => \%offOn,
@@ -6754,6 +6773,11 @@ my %ciMaxFocal = (
6754
6773
  275 => 'Canon RF 100-500mm F4.5-7.1L IS USM',
6755
6774
  276 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF1.4x',
6756
6775
  277 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
6776
+ 278 => 'Canon RF 70-200mm F4L IS USM', #42
6777
+ 280 => 'Canon RF 50mm F1.8 STM', #42
6778
+ 281 => 'Canon RF 14-35mm F4L IS USM', #42/IB
6779
+ 288 => 'Canon RF 16mm F2.8 STM', #42
6780
+ #xxx => 'Canon RF 100mm F2.8L MACRO IS USM',
6757
6781
  # Note: add new RF lenses to %canonLensTypes with ID 61182
6758
6782
  },
6759
6783
  },
@@ -9247,8 +9271,9 @@ sub PrintLensID(@)
9247
9271
  push @likely, $tclens;
9248
9272
  if ($maxAperture) {
9249
9273
  # (not 100% sure that TC affects MaxAperture, but it should!)
9250
- next if $maxAperture < $sa * $tc - 0.15;
9251
- next if $maxAperture > $la * $tc + 0.15;
9274
+ # (RF 24-105mm F4L IS USM shows a MaxAperture of 4.177)
9275
+ next if $maxAperture < $sa * $tc - 0.18;
9276
+ next if $maxAperture > $la * $tc + 0.18;
9252
9277
  }
9253
9278
  push @matches, $tclens;
9254
9279
  }
@@ -15,7 +15,7 @@ use Image::ExifTool::Exif;
15
15
  use Image::ExifTool::XMP;
16
16
  use Image::ExifTool::GPS;
17
17
 
18
- $VERSION = '1.03';
18
+ $VERSION = '1.04';
19
19
 
20
20
  my %convFloat2 = (
21
21
  PrintConv => 'sprintf("%+.2f", $val)',
@@ -90,20 +90,20 @@ my %convFloat2 = (
90
90
  Writable => 'real',
91
91
  Avoid => 1,
92
92
  PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "N")',
93
- PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1)',
93
+ PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1, "lat")',
94
94
  },
95
95
  GpsLongtitude => { # (sic)
96
96
  Name => 'GPSLongtitude',
97
97
  Writable => 'real',
98
98
  PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")',
99
- PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1)',
99
+ PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1, "lon")',
100
100
  },
101
101
  GpsLongitude => { #PH (NC)
102
102
  Name => 'GPSLongitude',
103
103
  Writable => 'real',
104
104
  Avoid => 1,
105
105
  PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")',
106
- PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1)',
106
+ PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1, "lon")',
107
107
  },
108
108
  FlightXSpeed => { Writable => 'real' },
109
109
  FlightYSpeed => { Writable => 'real' },
@@ -124,13 +124,13 @@ my %convFloat2 = (
124
124
  Name => 'Latitude',
125
125
  Writable => 'real',
126
126
  PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "N")',
127
- PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1)',
127
+ PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1, "lat")',
128
128
  },
129
129
  Longitude => {
130
130
  Name => 'Longitude',
131
131
  Writable => 'real',
132
132
  PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1, "E")',
133
- PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1)',
133
+ PrintConvInv => 'Image::ExifTool::GPS::ToDegrees($val, 1, "lon")',
134
134
  },
135
135
  );
136
136
 
@@ -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.05';
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 => 'AspectRatio', Format => 'int32u' },
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]' },