exiftool_vendored 12.97.0 → 12.99.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 +28 -1
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +2 -2
- data/bin/config_files/example.config +2 -1
- data/bin/exiftool +235 -45
- data/bin/lib/File/RandomAccess.pm +5 -2
- data/bin/lib/Image/ExifTool/APP12.pm +3 -2
- data/bin/lib/Image/ExifTool/Canon.pm +2 -1
- data/bin/lib/Image/ExifTool/Import.pm +7 -3
- data/bin/lib/Image/ExifTool/InDesign.pm +4 -3
- data/bin/lib/Image/ExifTool/JSON.pm +3 -4
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +2 -1
- data/bin/lib/Image/ExifTool/Lytro.pm +2 -2
- data/bin/lib/Image/ExifTool/M2TS.pm +8 -0
- data/bin/lib/Image/ExifTool/QuickTime.pm +17 -6
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +19 -2
- data/bin/lib/Image/ExifTool/Sony.pm +6 -1
- data/bin/lib/Image/ExifTool/TagLookup.pm +3 -1
- data/bin/lib/Image/ExifTool/TagNames.pod +8 -6
- data/bin/lib/Image/ExifTool/WritePDF.pl +47 -21
- data/bin/lib/Image/ExifTool/WriteXMP.pl +16 -4
- data/bin/lib/Image/ExifTool/Writer.pl +16 -6
- data/bin/lib/Image/ExifTool/XMP.pm +8 -3
- data/bin/lib/Image/ExifTool/XMPStruct.pl +15 -7
- data/bin/lib/Image/ExifTool.pm +34 -9
- data/bin/lib/Image/ExifTool.pod +31 -8
- data/bin/perl-Image-ExifTool.spec +1 -1
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +2 -2
@@ -39,8 +39,7 @@ sub SerializeStruct($$;$)
|
|
39
39
|
|
40
40
|
if (ref $obj eq 'HASH') {
|
41
41
|
# support hashes with ordered keys
|
42
|
-
|
43
|
-
foreach $key (@keys) {
|
42
|
+
foreach $key (Image::ExifTool::OrderedKeys($obj)) {
|
44
43
|
my $hdr = $sfmt ? EscapeJSON($key) . ':' : $key . '=';
|
45
44
|
push @vals, $hdr . SerializeStruct($et, $$obj{$key}, '}');
|
46
45
|
}
|
@@ -218,7 +217,7 @@ sub DumpStruct($;$)
|
|
218
217
|
$indent or $indent = '';
|
219
218
|
if (ref $obj eq 'HASH') {
|
220
219
|
print "{\n";
|
221
|
-
foreach (
|
220
|
+
foreach (Image::ExifTool::OrderedKeys($obj)) {
|
222
221
|
print "$indent $_ = ";
|
223
222
|
DumpStruct($$obj{$_}, "$indent ");
|
224
223
|
}
|
@@ -253,8 +252,10 @@ sub CheckStruct($$$)
|
|
253
252
|
ref $struct eq 'HASH' or return wantarray ? (undef, "Expecting $strName structure") : undef;
|
254
253
|
|
255
254
|
my ($key, $err, $warn, %copy, $rtnVal, $val);
|
255
|
+
# copy the ordered keys if they exist
|
256
|
+
$copy{_ordered_keys_} = [ ] if $$struct{_ordered_keys_};
|
256
257
|
Key:
|
257
|
-
foreach $key (
|
258
|
+
foreach $key (Image::ExifTool::OrderedKeys($struct)) {
|
258
259
|
my $tag = $key;
|
259
260
|
# allow trailing '#' to disable print conversion on a per-field basis
|
260
261
|
my ($type, $fieldInfo);
|
@@ -377,6 +378,7 @@ Key:
|
|
377
378
|
$copy{$tag} = \@copy;
|
378
379
|
} elsif ($$fieldInfo{Struct}) {
|
379
380
|
$warn = "Improperly formed structure in $strName $tag";
|
381
|
+
next;
|
380
382
|
} else {
|
381
383
|
$et->Sanitize(\$$struct{$key});
|
382
384
|
($val,$err) = $et->ConvInv($$struct{$key},$fieldInfo,$tag,$strName,$type,'');
|
@@ -387,6 +389,7 @@ Key:
|
|
387
389
|
# turn this into a list if necessary
|
388
390
|
$copy{$tag} = $$fieldInfo{List} ? [ $val ] : $val;
|
389
391
|
}
|
392
|
+
push @{$copy{_ordered_keys_}}, $tag if $copy{_ordered_keys_}; # save ordered keys
|
390
393
|
}
|
391
394
|
if (%copy or not $warn) {
|
392
395
|
$rtnVal = \%copy;
|
@@ -562,7 +565,7 @@ sub AddNewStruct($$$$$$)
|
|
562
565
|
# after all valid structure fields, which is necessary when serializing the XMP later)
|
563
566
|
%$struct or $$struct{'~dummy~'} = '';
|
564
567
|
|
565
|
-
foreach $tag (
|
568
|
+
foreach $tag (Image::ExifTool::OrderedKeys($struct)) {
|
566
569
|
my $fieldInfo = $$strTable{$tag};
|
567
570
|
unless ($fieldInfo) {
|
568
571
|
next unless $tag eq '~dummy~'; # check for dummy field
|
@@ -652,7 +655,8 @@ sub ConvertStruct($$$$;$)
|
|
652
655
|
my (%struct, $key);
|
653
656
|
my $table = $$tagInfo{Table};
|
654
657
|
$parentID = $$tagInfo{TagID} unless $parentID;
|
655
|
-
|
658
|
+
$struct{_ordered_keys_} = [ ] if $$value{_ordered_keys_};
|
659
|
+
foreach $key (Image::ExifTool::OrderedKeys($value)) {
|
656
660
|
my $tagID = $parentID . ucfirst($key);
|
657
661
|
my $flatInfo = $$table{$tagID};
|
658
662
|
unless ($flatInfo) {
|
@@ -669,7 +673,11 @@ sub ConvertStruct($$$$;$)
|
|
669
673
|
} else {
|
670
674
|
$v = $et->GetValue($flatInfo, $type, $v);
|
671
675
|
}
|
672
|
-
|
676
|
+
if (defined $v) {
|
677
|
+
$struct{$key} = $v; # save the converted value
|
678
|
+
# maintain ordered keys if necessary
|
679
|
+
push @{$struct{_ordered_keys_}}, $key if $struct{_ordered_keys_};
|
680
|
+
}
|
673
681
|
}
|
674
682
|
return \%struct;
|
675
683
|
} elsif (ref $value eq 'ARRAY') {
|
data/bin/lib/Image/ExifTool.pm
CHANGED
@@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
|
|
29
29
|
%jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
|
30
30
|
%static_vars $advFmtSelf);
|
31
31
|
|
32
|
-
$VERSION = '12.
|
32
|
+
$VERSION = '12.99';
|
33
33
|
$RELEASE = '';
|
34
34
|
@ISA = qw(Exporter);
|
35
35
|
%EXPORT_TAGS = (
|
@@ -37,7 +37,7 @@ $RELEASE = '';
|
|
37
37
|
Public => [qw(
|
38
38
|
ImageInfo AvailableOptions GetTagName GetShortcuts GetAllTags
|
39
39
|
GetWritableTags GetAllGroups GetDeleteGroups GetFileType CanWrite
|
40
|
-
CanCreate AddUserDefinedTags
|
40
|
+
CanCreate AddUserDefinedTags OrderedKeys
|
41
41
|
)],
|
42
42
|
# exports not part of the public API, but used by ExifTool modules:
|
43
43
|
DataAccess => [qw(
|
@@ -1466,12 +1466,12 @@ my %systemTagsNotes = (
|
|
1466
1466
|
PrintConv => sub {
|
1467
1467
|
my ($mask, $val) = (0400, oct(shift));
|
1468
1468
|
my %types = (
|
1469
|
-
0010000 => 'p',
|
1470
|
-
0020000 => 'c',
|
1471
|
-
0040000 => 'd',
|
1472
|
-
0060000 => 'b',
|
1473
|
-
0120000 => 'l',
|
1474
|
-
0140000 => 's',
|
1469
|
+
0010000 => 'p', # FIFO
|
1470
|
+
0020000 => 'c', # character special file
|
1471
|
+
0040000 => 'd', # directory
|
1472
|
+
0060000 => 'b', # block special file
|
1473
|
+
0120000 => 'l', # sym link
|
1474
|
+
0140000 => 's', # socket link
|
1475
1475
|
);
|
1476
1476
|
my $str = $types{$val & 0170000} || '-';
|
1477
1477
|
while ($mask) {
|
@@ -2292,6 +2292,7 @@ sub new
|
|
2292
2292
|
$$self{PATH} = [ ]; # (this too)
|
2293
2293
|
$$self{DEL_GROUP} = { }; # lookup for groups to delete when writing
|
2294
2294
|
$$self{SAVE_COUNT} = 0; # count calls to SaveNewValues()
|
2295
|
+
$$self{NV_COUNT} = 0; # count of NEW_VALUE entries
|
2295
2296
|
$$self{FILE_SEQUENCE} = 0; # sequence number for files when reading
|
2296
2297
|
$$self{FILES_WRITTEN} = 0; # count of files successfully written
|
2297
2298
|
$$self{INDENT2} = ''; # indentation of verbose messages from SetNewValue
|
@@ -2517,6 +2518,8 @@ sub Options($$;@)
|
|
2517
2518
|
# set Compact and XMPShorthand options, preserving backward compatibility
|
2518
2519
|
my ($p, %compact);
|
2519
2520
|
foreach $p ('Compact','XMPShorthand') {
|
2521
|
+
# (allow setting from a HASH (undocumented)
|
2522
|
+
ref $newVal eq 'HASH' and %compact = %{$newVal}, next;
|
2520
2523
|
my $val = $param eq $p ? $newVal : $$options{Compact}{$p};
|
2521
2524
|
if (defined $val) {
|
2522
2525
|
my @v = ($val =~ /\w+/g);
|
@@ -4195,6 +4198,16 @@ sub CanCreate($)
|
|
4195
4198
|
return 0;
|
4196
4199
|
}
|
4197
4200
|
|
4201
|
+
#------------------------------------------------------------------------------
|
4202
|
+
# Return list of ordered keys if available, otherwise just sort alphabetically
|
4203
|
+
# Inputs: 0) hash ref
|
4204
|
+
# Returns: List of ordered/sorted keys
|
4205
|
+
sub OrderedKeys($)
|
4206
|
+
{
|
4207
|
+
my $hash = shift;
|
4208
|
+
return $$hash{_ordered_keys_} ? @{$$hash{_ordered_keys_}} : sort keys %$hash;
|
4209
|
+
}
|
4210
|
+
|
4198
4211
|
#==============================================================================
|
4199
4212
|
# Functions below this are not part of the public API
|
4200
4213
|
|
@@ -7290,7 +7303,10 @@ sub ProcessJPEG($$;$)
|
|
7290
7303
|
last; # all done parsing file
|
7291
7304
|
} elsif (defined $markerLenBytes{$marker}) {
|
7292
7305
|
# handle other stand-alone markers and segments we skipped over
|
7293
|
-
$verbose and $marker
|
7306
|
+
if ($verbose and $marker) {
|
7307
|
+
next if $verbose < 4 and ($marker & 0xf8) == 0xd0;
|
7308
|
+
print $out "${indent}JPEG $markerName\n";
|
7309
|
+
}
|
7294
7310
|
next;
|
7295
7311
|
} elsif ($marker == 0xdb and length($$segDataPt) and # DQT
|
7296
7312
|
# save the DQT data only if JPEGDigest has been requested
|
@@ -7901,8 +7917,17 @@ sub ProcessJPEG($$;$)
|
|
7901
7917
|
my $seq = Get32u($segDataPt, 4);
|
7902
7918
|
my $len = Get32u($segDataPt, 8);
|
7903
7919
|
my $type = substr($$segDataPt, 12, 4);
|
7920
|
+
# a Microsoft bug writes $len and $type incorrectly as little-endian
|
7921
|
+
if ($type eq 'bmuj') {
|
7922
|
+
$self->WarnOnce('Wrong byte order in C2PA APP11 JUMBF header');
|
7923
|
+
$type = 'jumb';
|
7924
|
+
$len = unpack('x8V', $$segDataPt);
|
7925
|
+
# fix the header
|
7926
|
+
substr($$segDataPt, 8, 8) = Set32u($len) . $type;
|
7927
|
+
}
|
7904
7928
|
my $hdrLen;
|
7905
7929
|
if ($len == 1 and length($$segDataPt) >= 24) {
|
7930
|
+
# (haven't seen this with the Microsoft bug)
|
7906
7931
|
$len = Get64u($$segDataPt, 16);
|
7907
7932
|
$hdrLen = 16;
|
7908
7933
|
} else {
|
data/bin/lib/Image/ExifTool.pod
CHANGED
@@ -332,13 +332,14 @@ L</ImageInfo>:
|
|
332
332
|
|
333
333
|
Values of the returned hash are usually simple scalars, but a scalar
|
334
334
|
reference is used to indicate binary data and an array reference may be used
|
335
|
-
to indicate a list. Also, a hash reference may be returned if the
|
336
|
-
option is used
|
337
|
-
|
338
|
-
enabled
|
339
|
-
|
340
|
-
|
341
|
-
|
335
|
+
to indicate a list. Also, a hash reference may be returned if the
|
336
|
+
L</Struct> option is used (see the L</OrderedKeys> option to obtain the hash
|
337
|
+
keys). Lists of values are joined by commas into a single string only if
|
338
|
+
the PrintConv option is enabled and the ListJoin option is enabled (which
|
339
|
+
are the defaults). Note that binary values are not necessarily extracted
|
340
|
+
unless specifically requested, or the Binary option is enabled and the tag
|
341
|
+
is not specifically excluded. If not extracted the value is a reference to
|
342
|
+
a string of the form "Binary data ##### bytes".
|
342
343
|
|
343
344
|
The code below gives an example of how to handle these return values, as
|
344
345
|
well as illustrating the use of other ExifTool functions:
|
@@ -1089,7 +1090,9 @@ values in standard format).
|
|
1089
1090
|
|
1090
1091
|
Flag to return XMP structures as hash references instead of flattening into
|
1091
1092
|
individual tags. Has no effect when writing since both flattened and
|
1092
|
-
structured tags may always be written.
|
1093
|
+
structured tags may always be written. A special "_ordered_keys_" element
|
1094
|
+
containing a list of ordered keys may exist if the structure elements are
|
1095
|
+
ordered (see the L<OrderedKeys> method). Possible values are:
|
1093
1096
|
|
1094
1097
|
undef - (default) Same as 0 for reading, 2 for copying
|
1095
1098
|
0 - Read/copy flattened tags
|
@@ -2749,6 +2752,26 @@ details on the elements of the tag information hash.
|
|
2749
2752
|
|
2750
2753
|
=back
|
2751
2754
|
|
2755
|
+
=head2 OrderedKeys [static]
|
2756
|
+
|
2757
|
+
Return a list of ordered keys from a tag value that is a HASH reference
|
2758
|
+
when the Struct option is used.
|
2759
|
+
|
2760
|
+
use Image::ExifTool ':Public';
|
2761
|
+
my @keys = OrderedKeys($structRef);
|
2762
|
+
|
2763
|
+
=over 4
|
2764
|
+
|
2765
|
+
=item Inputs:
|
2766
|
+
|
2767
|
+
0) Structure HASH reference
|
2768
|
+
|
2769
|
+
=item Return Value:
|
2770
|
+
|
2771
|
+
List of ordered keys, or sorted alphabetically if not ordered.
|
2772
|
+
|
2773
|
+
=back
|
2774
|
+
|
2752
2775
|
=head1 CHARACTER ENCODINGS
|
2753
2776
|
|
2754
2777
|
Certain meta information formats allow coded character sets other than plain
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exiftool_vendored
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.99.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew McEachen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: exiftool
|