exiftool_vendored 12.32.0 → 12.36.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 +77 -3
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +2 -2
- data/bin/exiftool +57 -39
- data/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -2
- data/bin/lib/Image/ExifTool/CBOR.pm +85 -31
- data/bin/lib/Image/ExifTool/Canon.pm +28 -3
- data/bin/lib/Image/ExifTool/Charset.pm +2 -0
- data/bin/lib/Image/ExifTool/Exif.pm +109 -3
- data/bin/lib/Image/ExifTool/FLIR.pm +33 -8
- data/bin/lib/Image/ExifTool/ICC_Profile.pm +96 -4
- data/bin/lib/Image/ExifTool/JSON.pm +4 -2
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +111 -12
- data/bin/lib/Image/ExifTool/MacOS.pm +2 -2
- data/bin/lib/Image/ExifTool/Nikon.pm +637 -16
- data/bin/lib/Image/ExifTool/NikonCustom.pm +5 -1
- data/bin/lib/Image/ExifTool/NikonSettings.pm +67 -11
- data/bin/lib/Image/ExifTool/Olympus.pm +5 -1
- data/bin/lib/Image/ExifTool/PDF.pm +5 -3
- data/bin/lib/Image/ExifTool/QuickTime.pm +21 -2
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +2 -2
- data/bin/lib/Image/ExifTool/README +6 -2
- data/bin/lib/Image/ExifTool/Sony.pm +31 -11
- data/bin/lib/Image/ExifTool/TagInfoXML.pm +9 -4
- data/bin/lib/Image/ExifTool/TagLookup.pm +5054 -4455
- data/bin/lib/Image/ExifTool/TagNames.pod +1185 -23
- data/bin/lib/Image/ExifTool/WriteQuickTime.pl +10 -0
- data/bin/lib/Image/ExifTool/Writer.pl +45 -3
- data/bin/lib/Image/ExifTool/XMP.pm +111 -25
- data/bin/lib/Image/ExifTool/XMP2.pl +3 -1
- data/bin/lib/Image/ExifTool.pm +83 -19
- data/bin/lib/Image/ExifTool.pod +9 -1
- data/bin/perl-Image-ExifTool.spec +1 -1
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +2 -2
@@ -11,6 +11,7 @@
|
|
11
11
|
# 4) http://www.color.org/privatetag2007-01.pdf
|
12
12
|
# 5) http://www.color.org/icc_specs2.xalter (approved revisions, 2010-07-16)
|
13
13
|
# 6) Eef Vreeland private communication
|
14
|
+
# 7) https://color.org/specification/ICC.2-2019.pdf
|
14
15
|
#
|
15
16
|
# Notes: The ICC profile information is different: the format of each
|
16
17
|
# tag is embedded in the information instead of in the directory
|
@@ -24,7 +25,7 @@ use strict;
|
|
24
25
|
use vars qw($VERSION);
|
25
26
|
use Image::ExifTool qw(:DataAccess :Utils);
|
26
27
|
|
27
|
-
$VERSION = '1.
|
28
|
+
$VERSION = '1.38';
|
28
29
|
|
29
30
|
sub ProcessICC($$);
|
30
31
|
sub ProcessICC_Profile($$$);
|
@@ -52,6 +53,11 @@ my %profileClass = (
|
|
52
53
|
abst => 'Abstract Profile',
|
53
54
|
nmcl => 'NamedColor Profile',
|
54
55
|
nkpf => 'Nikon Input Device Profile (NON-STANDARD!)', # (written by Nikon utilities)
|
56
|
+
# additions in v5 (ref 7)
|
57
|
+
cenc => 'ColorEncodingSpace Profile',
|
58
|
+
'mid '=> 'MultiplexIdentification Profile',
|
59
|
+
mlnk => 'MultiplexLink Profile',
|
60
|
+
mvis => 'MultiplexVisualization Profile',
|
55
61
|
);
|
56
62
|
my %manuSig = ( #6
|
57
63
|
'NONE' => 'none',
|
@@ -539,6 +545,90 @@ my %manuSig = ( #6
|
|
539
545
|
Binary => 1, # (NC)
|
540
546
|
},
|
541
547
|
|
548
|
+
# new tags in v5 (ref 7)
|
549
|
+
A2B3 => 'AToB3',
|
550
|
+
A2M0 => 'AToM0',
|
551
|
+
B2A3 => 'BToA3',
|
552
|
+
bcp0 => 'BRDFColorimetricParam0',
|
553
|
+
bcp1 => 'BRDFColorimetricParam1',
|
554
|
+
bcp2 => 'BRDFColorimetricParam2',
|
555
|
+
bcp3 => 'BRDFColorimetricParam3',
|
556
|
+
bsp0 => 'BRDFSpectralParam0',
|
557
|
+
bsp1 => 'BRDFSpectralParam1',
|
558
|
+
bsp2 => 'BRDFSpectralParam2',
|
559
|
+
bsp3 => 'BRDFSpectralParam3',
|
560
|
+
bAB0 => 'BRDFAToB0',
|
561
|
+
bAB1 => 'BRDFAToB1',
|
562
|
+
bAB2 => 'BRDFAToB2',
|
563
|
+
bAB3 => 'BRDFAToB3',
|
564
|
+
bBA0 => 'BRDFBToA0',
|
565
|
+
bBA1 => 'BRDFBToA1',
|
566
|
+
bBA2 => 'BRDFBToA2',
|
567
|
+
bBA3 => 'BRDFBToA3',
|
568
|
+
bBD0 => 'BRDFBToD0',
|
569
|
+
bBD1 => 'BRDFBToD1',
|
570
|
+
bBD2 => 'BRDFBToD2',
|
571
|
+
bBD3 => 'BRDFBToD3',
|
572
|
+
bDB0 => 'BRDFDToB0',
|
573
|
+
bDB1 => 'BRDFDToB1',
|
574
|
+
bDB2 => 'BRDFDToB2',
|
575
|
+
bDB3 => 'BRDFDToB3',
|
576
|
+
bMB0 => 'BRDFMToB0',
|
577
|
+
bMB1 => 'BRDFMToB1',
|
578
|
+
bMB2 => 'BRDFMToB2',
|
579
|
+
bMB3 => 'BRDFMToB3',
|
580
|
+
bMS0 => 'BRDFMToS0',
|
581
|
+
bMS1 => 'BRDFMToS1',
|
582
|
+
bMS2 => 'BRDFMToS2',
|
583
|
+
bMS3 => 'BRDFMToS3',
|
584
|
+
dAB0 => 'DirectionalAToB0',
|
585
|
+
dAB1 => 'DirectionalAToB1',
|
586
|
+
dAB2 => 'DirectionalAToB2',
|
587
|
+
dAB3 => 'DirectionalAToB3',
|
588
|
+
dBA0 => 'DirectionalBToA0',
|
589
|
+
dBA1 => 'DirectionalBToA1',
|
590
|
+
dBA2 => 'DirectionalBToA2',
|
591
|
+
dBA3 => 'DirectionalBToA3',
|
592
|
+
dBD0 => 'DirectionalBToD0',
|
593
|
+
dBD1 => 'DirectionalBToD1',
|
594
|
+
dBD2 => 'DirectionalBToD2',
|
595
|
+
dBD3 => 'DirectionalBToD3',
|
596
|
+
dDB0 => 'DirectionalDToB0',
|
597
|
+
dDB1 => 'DirectionalDToB1',
|
598
|
+
dDB2 => 'DirectionalDToB2',
|
599
|
+
dDB3 => 'DirectionalDToB3',
|
600
|
+
gdb0 => 'GamutBoundaryDescription0',
|
601
|
+
gdb1 => 'GamutBoundaryDescription1',
|
602
|
+
gdb2 => 'GamutBoundaryDescription2',
|
603
|
+
gdb3 => 'GamutBoundaryDescription3',
|
604
|
+
'mdv '=> 'MultiplexDefaultValues',
|
605
|
+
mcta => 'MultiplexTypeArray',
|
606
|
+
minf => 'MeasurementInfo',
|
607
|
+
miin => 'MeasurementInputInfo',
|
608
|
+
M2A0 => 'MToA0',
|
609
|
+
M2B0 => 'MToB0',
|
610
|
+
M2B1 => 'MToB1',
|
611
|
+
M2B2 => 'MToB2',
|
612
|
+
M2B3 => 'MToB3',
|
613
|
+
M2S0 => 'MToS0',
|
614
|
+
M2S1 => 'MToS1',
|
615
|
+
M2S2 => 'MToS2',
|
616
|
+
M2S3 => 'MToS3',
|
617
|
+
cept => 'ColorEncodingParams',
|
618
|
+
csnm => 'ColorSpaceName',
|
619
|
+
cloo => 'ColorantOrderOut',
|
620
|
+
clio => 'ColorantInfoOut',
|
621
|
+
c2sp => 'CustomToStandardPcc',
|
622
|
+
'CxF '=> 'CXF',
|
623
|
+
nmcl => 'NamedColor',
|
624
|
+
psin => 'ProfileSequenceInfo',
|
625
|
+
rfnm => 'ReferenceName',
|
626
|
+
svcn => 'SpectralViewingConditions',
|
627
|
+
swpt => 'SpectralWhitePoint',
|
628
|
+
s2cp => 'StandardToCustomPcc',
|
629
|
+
smap => 'SurfaceMap',
|
630
|
+
# smwp ? (seen in some v5 samples)
|
631
|
+
|
542
632
|
# the following entry represents the ICC profile header, and doesn't
|
543
633
|
# exist as a tag in the directory. It is only in this table to provide
|
544
634
|
# a link so ExifTool can locate the header tags
|
@@ -850,7 +940,7 @@ sub FormatICCTag($$$)
|
|
850
940
|
# dataType
|
851
941
|
if ($type eq 'data' and $size >= 12) {
|
852
942
|
my $form = Get32u($dataPt, $offset+8);
|
853
|
-
# format 0 is
|
943
|
+
# format 0 is UTF-8 data
|
854
944
|
$form == 0 and return substr($$dataPt, $offset+12, $size-12);
|
855
945
|
# binary data and other data types treat as binary (ie. don't format)
|
856
946
|
}
|
@@ -1022,7 +1112,7 @@ sub ValidateICC($)
|
|
1022
1112
|
$profileClass{substr($$valPtr, 12, 4)} or $err = 'profile class';
|
1023
1113
|
my $col = substr($$valPtr, 16, 4); # ColorSpaceData
|
1024
1114
|
my $con = substr($$valPtr, 20, 4); # ConnectionSpace
|
1025
|
-
my $match = '(XYZ |Lab |Luv |YCbr|Yxy |RGB |GRAY|HSV |HLS |CMYK|CMY |[2-9A-F]CLR)';
|
1115
|
+
my $match = '(XYZ |Lab |Luv |YCbr|Yxy |RGB |GRAY|HSV |HLS |CMYK|CMY |[2-9A-F]CLR|nc..|\0{4})';
|
1026
1116
|
$col =~ /$match/ or $err = 'color space';
|
1027
1117
|
$con =~ /$match/ or $err = 'connection space';
|
1028
1118
|
return $err ? "Invalid ICC profile (bad $err)" : undef;
|
@@ -1134,7 +1224,7 @@ sub ProcessICC_Profile($$$)
|
|
1134
1224
|
my $tagInfo = $et->GetTagInfo($tagTablePtr, $tagID);
|
1135
1225
|
# unknown tags aren't generated automatically by GetTagInfo()
|
1136
1226
|
# if the tagID's aren't numeric, so we must do this manually:
|
1137
|
-
if (not $tagInfo and $$et{OPTIONS}{Unknown}) {
|
1227
|
+
if (not $tagInfo and ($$et{OPTIONS}{Unknown} or $verbose)) {
|
1138
1228
|
$tagInfo = { Unknown => 1 };
|
1139
1229
|
AddTagToTable($tagTablePtr, $tagID, $tagInfo);
|
1140
1230
|
}
|
@@ -1277,6 +1367,8 @@ under the same terms as Perl itself.
|
|
1277
1367
|
|
1278
1368
|
=item L<http://developer.apple.com/documentation/GraphicsImaging/Reference/ColorSync_Manager/ColorSync_Manager.pdf>
|
1279
1369
|
|
1370
|
+
=item L<https://color.org/specification/ICC.2-2019.pdf>
|
1371
|
+
|
1280
1372
|
=back
|
1281
1373
|
|
1282
1374
|
=head1 SEE ALSO
|
@@ -14,7 +14,7 @@ use vars qw($VERSION);
|
|
14
14
|
use Image::ExifTool qw(:DataAccess :Utils);
|
15
15
|
use Image::ExifTool::Import;
|
16
16
|
|
17
|
-
$VERSION = '1.
|
17
|
+
$VERSION = '1.05';
|
18
18
|
|
19
19
|
sub ProcessJSON($$);
|
20
20
|
sub ProcessTag($$$$%);
|
@@ -86,7 +86,9 @@ sub ProcessTag($$$$%)
|
|
86
86
|
# support hashes with ordered keys
|
87
87
|
my @keys = $$val{_ordered_keys_} ? @{$$val{_ordered_keys_}} : sort keys %$val;
|
88
88
|
foreach (@keys) {
|
89
|
-
|
89
|
+
my $tg = $tag . ((/^\d/ and $tag =~ /\d$/) ? '_' : '') . ucfirst;
|
90
|
+
$tg =~ s/([^a-zA-Z])([a-z])/$1\U$2/g;
|
91
|
+
ProcessTag($et, $tagTablePtr, $tg, $$val{$_}, %flags, Flat => 1);
|
90
92
|
}
|
91
93
|
} elsif (ref $val eq 'ARRAY') {
|
92
94
|
foreach (@$val) {
|
@@ -16,7 +16,7 @@ use strict;
|
|
16
16
|
use vars qw($VERSION);
|
17
17
|
use Image::ExifTool qw(:DataAccess :Utils);
|
18
18
|
|
19
|
-
$VERSION = '1.
|
19
|
+
$VERSION = '1.32';
|
20
20
|
|
21
21
|
sub ProcessJpeg2000Box($$$);
|
22
22
|
sub ProcessJUMD($$$);
|
@@ -42,8 +42,9 @@ my %jp2Map = (
|
|
42
42
|
'UUID-IPTC' => 'JP2',
|
43
43
|
'UUID-EXIF' => 'JP2',
|
44
44
|
'UUID-XMP' => 'JP2',
|
45
|
-
|
46
|
-
|
45
|
+
jp2h => 'JP2',
|
46
|
+
colr => 'jp2h',
|
47
|
+
ICC_Profile => 'colr',
|
47
48
|
IFD1 => 'IFD0',
|
48
49
|
EXIF => 'IFD0', # to write EXIF as a block
|
49
50
|
ExifIFD => 'IFD0',
|
@@ -340,12 +341,14 @@ my %j2cMarker = (
|
|
340
341
|
},
|
341
342
|
{
|
342
343
|
Name => 'UUID-Signature', # (seen in JUMB data of JPEG images)
|
344
|
+
# (may be able to remove this when JUMBF specification is finalized)
|
343
345
|
Condition => '$$valPt=~/^casg\x00\x11\x00\x10\x80\x00\x00\xaa\x00\x38\x9b\x71/',
|
344
346
|
Format => 'undef',
|
345
347
|
ValueConv => 'substr($val,16)',
|
346
348
|
},
|
347
349
|
{
|
348
|
-
Name => 'UUID-C2PAClaimSignature', # (seen in JUMB data of JPEG images)
|
350
|
+
Name => 'UUID-C2PAClaimSignature', # (seen in incorrectly-formatted JUMB data of JPEG images)
|
351
|
+
# (may be able to remove this when JUMBF specification is finalized)
|
349
352
|
Condition => '$$valPt=~/^c2cs\x00\x11\x00\x10\x80\x00\x00\xaa\x00\x38\x9b\x71/',
|
350
353
|
SubDirectory => {
|
351
354
|
TagTable => 'Image::ExifTool::CBOR::Main',
|
@@ -558,11 +561,34 @@ my %j2cMarker = (
|
|
558
561
|
|
559
562
|
%Image::ExifTool::Jpeg2000::ColorSpec = (
|
560
563
|
PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
564
|
+
WRITE_PROC => \&Image::ExifTool::WriteBinaryData, # (we don't actually call this)
|
561
565
|
GROUPS => { 2 => 'Image' },
|
562
566
|
FORMAT => 'int8s',
|
567
|
+
WRITABLE => 1,
|
568
|
+
# (Note: 'colr' is not a real group, but is used as a hack to write the
|
569
|
+
# necessary colr box. This hack necessitated another hack in TagInfoXML.pm
|
570
|
+
# to avoid reporting this fake group in the XML output)
|
571
|
+
WRITE_GROUP => 'colr',
|
572
|
+
DATAMEMBER => [ 0 ],
|
573
|
+
IS_SUBDIR => [ 3 ],
|
574
|
+
NOTES => q{
|
575
|
+
The table below contains tags in the color specification (colr) box. This
|
576
|
+
box may be rewritten by writing either ICC_Profile, ColorSpace or
|
577
|
+
ColorSpecData. When writing, any existing colr boxes are replaced with the
|
578
|
+
newly created colr box.
|
579
|
+
|
580
|
+
B<NOTE>: Care must be taken when writing this color specification because
|
581
|
+
writing a specification that is incompatible with the image data may make
|
582
|
+
the image undisplayable.
|
583
|
+
},
|
563
584
|
0 => {
|
564
585
|
Name => 'ColorSpecMethod',
|
565
586
|
RawConv => '$$self{ColorSpecMethod} = $val',
|
587
|
+
Protected => 1,
|
588
|
+
Notes => q{
|
589
|
+
default for writing is 2 when writing ICC_Profile, 1 when writing
|
590
|
+
ColorSpace, or 4 when writing ColorSpecData
|
591
|
+
},
|
566
592
|
PrintConv => {
|
567
593
|
1 => 'Enumerated',
|
568
594
|
2 => 'Restricted ICC',
|
@@ -570,9 +596,15 @@ my %j2cMarker = (
|
|
570
596
|
4 => 'Vendor Color',
|
571
597
|
},
|
572
598
|
},
|
573
|
-
1 =>
|
599
|
+
1 => {
|
600
|
+
Name => 'ColorSpecPrecedence',
|
601
|
+
Notes => 'default for writing is 0',
|
602
|
+
Protected => 1,
|
603
|
+
},
|
574
604
|
2 => {
|
575
605
|
Name => 'ColorSpecApproximation',
|
606
|
+
Notes => 'default for writing is 0',
|
607
|
+
Protected => 1,
|
576
608
|
PrintConv => {
|
577
609
|
0 => 'Not Specified',
|
578
610
|
1 => 'Accurate',
|
@@ -597,6 +629,7 @@ my %j2cMarker = (
|
|
597
629
|
Name => 'ColorSpace',
|
598
630
|
Condition => '$$self{ColorSpecMethod} == 1',
|
599
631
|
Format => 'int32u',
|
632
|
+
Protected => 1,
|
600
633
|
PrintConv => { # ref 15444-2 2002-05-15
|
601
634
|
0 => 'Bi-level',
|
602
635
|
1 => 'YCbCr(1)',
|
@@ -626,6 +659,8 @@ my %j2cMarker = (
|
|
626
659
|
{
|
627
660
|
Name => 'ColorSpecData',
|
628
661
|
Format => 'undef[$size-3]',
|
662
|
+
Writable => 'undef',
|
663
|
+
Protected => 1,
|
629
664
|
Binary => 1,
|
630
665
|
},
|
631
666
|
],
|
@@ -815,6 +850,48 @@ sub CreateNewBoxes($$)
|
|
815
850
|
return 1;
|
816
851
|
}
|
817
852
|
|
853
|
+
#------------------------------------------------------------------------------
|
854
|
+
# Create Color Specification Box
|
855
|
+
# Inputs: 0) ExifTool object ref, 1) Output file or scalar ref
|
856
|
+
# Returns: 1 on success
|
857
|
+
sub CreateColorSpec($$)
|
858
|
+
{
|
859
|
+
my ($et, $outfile) = @_;
|
860
|
+
my $meth = $et->GetNewValue('Jpeg2000:ColorSpecMethod');
|
861
|
+
my $prec = $et->GetNewValue('Jpeg2000:ColorSpecPrecedence') || 0;
|
862
|
+
my $approx = $et->GetNewValue('Jpeg2000:ColorSpecApproximation') || 0;
|
863
|
+
my $icc = $et->GetNewValue('ICC_Profile');
|
864
|
+
my $space = $et->GetNewValue('Jpeg2000:ColorSpace');
|
865
|
+
my $cdata = $et->GetNewValue('Jpeg2000:ColorSpecData');
|
866
|
+
unless ($meth) {
|
867
|
+
if ($icc) {
|
868
|
+
$meth = 2;
|
869
|
+
} elsif (defined $space) {
|
870
|
+
$meth = 1;
|
871
|
+
} elsif (defined $cdata) {
|
872
|
+
$meth = 4;
|
873
|
+
} else {
|
874
|
+
$et->Warn('Color space not defined'), return 0;
|
875
|
+
}
|
876
|
+
}
|
877
|
+
if ($meth eq '1') {
|
878
|
+
defined $space or $et->Warn('Must specify ColorSpace'), return 0;
|
879
|
+
$cdata = pack('N', $space);
|
880
|
+
} elsif ($meth eq '2' or $meth eq '3') {
|
881
|
+
defined $icc or $et->Warn('Must specify ICC_Profile'), return 0;
|
882
|
+
$cdata = $icc;
|
883
|
+
} elsif ($meth eq '4') {
|
884
|
+
defined $cdata or $et->Warn('Must specify ColorSpecData'), return 0;
|
885
|
+
} else {
|
886
|
+
$et->Warn('Unknown ColorSpecMethod'), return 0;
|
887
|
+
}
|
888
|
+
my $boxhdr = pack('N', length($cdata) + 11) . 'colr';
|
889
|
+
Write($outfile, $boxhdr, pack('CCC',$meth,$prec,$approx), $cdata) or return 0;
|
890
|
+
++$$et{CHANGED};
|
891
|
+
$et->VPrint(1, " + Jpeg2000:ColorSpec\n");
|
892
|
+
return 1;
|
893
|
+
}
|
894
|
+
|
818
895
|
#------------------------------------------------------------------------------
|
819
896
|
# Process JPEG 2000 box
|
820
897
|
# Inputs: 0) ExifTool object reference, 1) dirInfo reference, 2) Pointer to tag table
|
@@ -832,7 +909,7 @@ sub ProcessJpeg2000Box($$$)
|
|
832
909
|
my $raf = $$dirInfo{RAF};
|
833
910
|
my $outfile = $$dirInfo{OutFile};
|
834
911
|
my $dirEnd = $dirStart + $dirLen;
|
835
|
-
my ($err, $outBuff, $verbose);
|
912
|
+
my ($err, $outBuff, $verbose, $doColour);
|
836
913
|
|
837
914
|
if ($outfile) {
|
838
915
|
unless ($raf) {
|
@@ -840,13 +917,19 @@ sub ProcessJpeg2000Box($$$)
|
|
840
917
|
$outBuff = '';
|
841
918
|
$outfile = \$outBuff;
|
842
919
|
}
|
920
|
+
# determine if we will be writing colr box
|
921
|
+
if ($$dirInfo{DirName} and $$dirInfo{DirName} eq 'JP2Header') {
|
922
|
+
$doColour = 2 if defined $et->GetNewValue('ColorSpecMethod') or $et->GetNewValue('ICC_Profile') or
|
923
|
+
defined $et->GetNewValue('ColorSpecPrecedence') or defined $et->GetNewValue('ColorSpace') or
|
924
|
+
defined $et->GetNewValue('ColorSpecApproximation') or defined $et->GetNewValue('ColorSpecData');
|
925
|
+
}
|
843
926
|
} else {
|
844
927
|
# (must not set verbose flag when writing!)
|
845
928
|
$verbose = $$et{OPTIONS}{Verbose};
|
846
929
|
$et->VerboseDir($$dirInfo{DirName}) if $verbose;
|
847
930
|
}
|
848
931
|
# loop through all contained boxes
|
849
|
-
my ($pos, $boxLen);
|
932
|
+
my ($pos, $boxLen, $lastBox);
|
850
933
|
for ($pos=$dirStart; ; $pos+=$boxLen) {
|
851
934
|
my ($boxID, $buff, $valuePtr);
|
852
935
|
my $hdrLen = 8; # the box header length
|
@@ -855,9 +938,7 @@ sub ProcessJpeg2000Box($$$)
|
|
855
938
|
my $n = $raf->Read($buff,$hdrLen);
|
856
939
|
unless ($n == $hdrLen) {
|
857
940
|
$n and $err = '', last;
|
858
|
-
|
859
|
-
CreateNewBoxes($et, $outfile) or $err = 1;
|
860
|
-
}
|
941
|
+
CreateNewBoxes($et, $outfile) or $err = 1 if $outfile;
|
861
942
|
last;
|
862
943
|
}
|
863
944
|
$dataPt = \$buff;
|
@@ -869,6 +950,17 @@ sub ProcessJpeg2000Box($$$)
|
|
869
950
|
}
|
870
951
|
$boxLen = unpack("x$pos N",$$dataPt); # (length includes header and data)
|
871
952
|
$boxID = substr($$dataPt, $pos+4, 4);
|
953
|
+
# remove old colr boxes if necessary
|
954
|
+
if ($doColour and $boxID eq 'colr') {
|
955
|
+
if ($doColour == 1) { # did we successfully write the new colr box?
|
956
|
+
$et->VPrint(1," - Jpeg2000:ColorSpec\n");
|
957
|
+
++$$et{CHANGED};
|
958
|
+
next;
|
959
|
+
}
|
960
|
+
$et->Warn('Out-of-order colr box encountered');
|
961
|
+
undef $doColour;
|
962
|
+
}
|
963
|
+
$lastBox = $boxID;
|
872
964
|
$pos += $hdrLen; # move to end of box header
|
873
965
|
if ($boxLen == 1) {
|
874
966
|
# box header contains an additional 8-byte integer for length
|
@@ -1007,8 +1099,10 @@ sub ProcessJpeg2000Box($$$)
|
|
1007
1099
|
# remove this directory from our create list
|
1008
1100
|
delete $$et{AddJp2Dirs}{$$tagInfo{Name}};
|
1009
1101
|
my $newdir;
|
1010
|
-
# only edit writable UUID and
|
1011
|
-
if ($uuid or $boxID eq 'Exif' or ($boxID eq 'xml ' and $$et{IsJXL})
|
1102
|
+
# only edit writable UUID, Exif and jp2h boxes
|
1103
|
+
if ($uuid or $boxID eq 'Exif' or ($boxID eq 'xml ' and $$et{IsJXL}) or
|
1104
|
+
($boxID eq 'jp2h' and $$et{EDIT_DIRS}{jp2h}))
|
1105
|
+
{
|
1012
1106
|
$newdir = $et->WriteDirectory(\%subdirInfo, $subTable, $$subdir{WriteProc});
|
1013
1107
|
next if defined $newdir and not length $newdir; # next if deleting the box
|
1014
1108
|
} elsif (defined $uuid) {
|
@@ -1020,6 +1114,11 @@ sub ProcessJpeg2000Box($$$)
|
|
1020
1114
|
my $boxhdr = pack('N', length($newdir) + 8 + $prefixLen) . $boxID;
|
1021
1115
|
$boxhdr .= substr($$dataPt, $valuePtr, $prefixLen) if $prefixLen;
|
1022
1116
|
Write($outfile, $boxhdr, $newdir) or $err = 1;
|
1117
|
+
# write new colr box immediately after ihdr
|
1118
|
+
if ($doColour and $boxID eq 'ihdr') {
|
1119
|
+
# (shouldn't be multiple ihdr boxes, but just in case, write only 1)
|
1120
|
+
$doColour = $doColour==2 ? CreateColorSpec($et, $outfile) : 0;
|
1121
|
+
}
|
1023
1122
|
} else {
|
1024
1123
|
# extract as a block if specified
|
1025
1124
|
$subdirInfo{BlockInfo} = $tagInfo if $$tagInfo{BlockExtract};
|
@@ -52,7 +52,7 @@ my %mdDateInfo = (
|
|
52
52
|
NOTES => q{
|
53
53
|
MDItem tags are extracted using the "mdls" utility. They are extracted if
|
54
54
|
any "MDItem*" tag or the MacOS group is specifically requested, or by
|
55
|
-
setting the L<MDItemTags|../ExifTool.html#MDItemTags>
|
55
|
+
setting the API L<MDItemTags|../ExifTool.html#MDItemTags> option to 1 or the API L<RequestAll|../ExifTool.html#RequestAll> option to 2 or
|
56
56
|
higher. Note that these tags do not necessarily reflect the current
|
57
57
|
metadata of a file -- it may take some time for the MacOS mdworker daemon to
|
58
58
|
index the file after a metadata change.
|
@@ -244,7 +244,7 @@ my %mdDateInfo = (
|
|
244
244
|
NOTES => q{
|
245
245
|
XAttr tags are extracted using the "xattr" utility. They are extracted if
|
246
246
|
any "XAttr*" tag or the MacOS group is specifically requested, or by setting
|
247
|
-
the L<XAttrTags|../ExifTool.html#XAttrTags>
|
247
|
+
the API L<XAttrTags|../ExifTool.html#XAttrTags> option to 1 or the API L<RequestAll|../ExifTool.html#RequestAll> option to 2 or higher.
|
248
248
|
And they are extracted by default from MacOS "._" files when reading
|
249
249
|
these files directly.
|
250
250
|
},
|