exiftool_vendored 12.73.0 → 12.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/Changes +26 -1
- data/bin/META.json +1 -1
- data/bin/META.yml +1 -1
- data/bin/README +2 -2
- data/bin/exiftool +49 -40
- data/bin/lib/File/RandomAccess.pm +31 -5
- data/bin/lib/File/RandomAccess.pod +4 -4
- data/bin/lib/Image/ExifTool/7Z.pm +3 -3
- data/bin/lib/Image/ExifTool/AFCP.pm +2 -2
- data/bin/lib/Image/ExifTool/BZZ.pm +2 -2
- data/bin/lib/Image/ExifTool/BuildTagLookup.pm +5 -5
- data/bin/lib/Image/ExifTool/Canon.pm +3 -3
- data/bin/lib/Image/ExifTool/CanonVRD.pm +2 -2
- data/bin/lib/Image/ExifTool/DICOM.pm +2 -2
- data/bin/lib/Image/ExifTool/DNG.pm +4 -4
- data/bin/lib/Image/ExifTool/Exif.pm +2 -2
- data/bin/lib/Image/ExifTool/FLIR.pm +2 -2
- data/bin/lib/Image/ExifTool/Fixup.pm +3 -3
- data/bin/lib/Image/ExifTool/FlashPix.pm +3 -3
- data/bin/lib/Image/ExifTool/FujiFilm.pm +8 -3
- data/bin/lib/Image/ExifTool/Geotag.pm +3 -3
- data/bin/lib/Image/ExifTool/HtmlDump.pm +2 -2
- data/bin/lib/Image/ExifTool/ID3.pm +2 -2
- data/bin/lib/Image/ExifTool/Import.pm +5 -5
- data/bin/lib/Image/ExifTool/JSON.pm +2 -2
- data/bin/lib/Image/ExifTool/Jpeg2000.pm +2 -2
- data/bin/lib/Image/ExifTool/MIE.pm +3 -3
- data/bin/lib/Image/ExifTool/MinoltaRaw.pm +2 -2
- data/bin/lib/Image/ExifTool/Nikon.pm +3 -1
- data/bin/lib/Image/ExifTool/NikonCustom.pm +3 -3
- data/bin/lib/Image/ExifTool/Ogg.pm +2 -2
- data/bin/lib/Image/ExifTool/PLIST.pm +3 -3
- data/bin/lib/Image/ExifTool/PanasonicRaw.pm +3 -3
- data/bin/lib/Image/ExifTool/PhaseOne.pm +2 -2
- data/bin/lib/Image/ExifTool/Photoshop.pm +3 -3
- data/bin/lib/Image/ExifTool/PostScript.pm +2 -2
- data/bin/lib/Image/ExifTool/QuickTime.pm +40 -107
- data/bin/lib/Image/ExifTool/QuickTimeStream.pl +8 -6
- data/bin/lib/Image/ExifTool/RSRC.pm +2 -2
- data/bin/lib/Image/ExifTool/Samsung.pm +4 -4
- data/bin/lib/Image/ExifTool/Shift.pl +1 -1
- data/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -3
- data/bin/lib/Image/ExifTool/Sony.pm +3 -3
- data/bin/lib/Image/ExifTool/TagInfoXML.pm +2 -2
- data/bin/lib/Image/ExifTool/TagLookup.pm +5 -5
- data/bin/lib/Image/ExifTool/TagNames.pod +5 -1
- data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
- data/bin/lib/Image/ExifTool/WriteExif.pl +15 -15
- data/bin/lib/Image/ExifTool/WritePDF.pl +1 -1
- data/bin/lib/Image/ExifTool/WriteQuickTime.pl +1 -1
- data/bin/lib/Image/ExifTool/WriteXMP.pl +4 -2
- data/bin/lib/Image/ExifTool/Writer.pl +66 -42
- data/bin/lib/Image/ExifTool/ZIP.pm +6 -6
- data/bin/lib/Image/ExifTool.pm +27 -23
- data/bin/lib/Image/ExifTool.pod +7 -6
- data/bin/perl-Image-ExifTool.spec +1 -1
- data/lib/exiftool_vendored/version.rb +1 -1
- metadata +2 -2
@@ -1083,6 +1083,8 @@ sub WriteXMP($$;$)
|
|
1083
1083
|
# delete all structure (or pseudo-structure) elements
|
1084
1084
|
require 'Image/ExifTool/XMPStruct.pl';
|
1085
1085
|
($deleted, $added, $existed) = DeleteStruct($et, \%capture, \$path, $nvHash, \$changed);
|
1086
|
+
# don't add if it didn't exist and not IsCreating and Avoid
|
1087
|
+
undef $added if not $existed and not $$nvHash{IsCreating} and $$tagInfo{Avoid};
|
1086
1088
|
next unless $deleted or $added or $et->IsOverwriting($nvHash);
|
1087
1089
|
next if $existed and $$nvHash{CreateOnly};
|
1088
1090
|
} elsif ($cap) {
|
@@ -1262,8 +1264,8 @@ sub WriteXMP($$;$)
|
|
1262
1264
|
# check to see if we want to create this tag
|
1263
1265
|
# (create non-avoided tags in XMP data files by default)
|
1264
1266
|
my $isCreating = ($$nvHash{IsCreating} or (($isStruct or
|
1265
|
-
($preferred and not $$
|
1266
|
-
|
1267
|
+
($preferred and not defined $$nvHash{Shift})) and
|
1268
|
+
not $$tagInfo{Avoid} and not $$nvHash{EditOnly}));
|
1267
1269
|
|
1268
1270
|
# don't add new values unless...
|
1269
1271
|
# ...tag existed before and was deleted, or we added it to a list
|
@@ -26,6 +26,7 @@ sub RemoveNewValuesForGroup($$);
|
|
26
26
|
sub GetWriteGroup1($$);
|
27
27
|
sub Sanitize($$);
|
28
28
|
sub ConvInv($$$$$;$$);
|
29
|
+
sub PushValue($$$;$);
|
29
30
|
|
30
31
|
my $loadedAllTables; # flag indicating we loaded all tables
|
31
32
|
my $advFmtSelf; # ExifTool object during evaluation of advanced formatting expr
|
@@ -1260,7 +1261,7 @@ sub SetNewValuesFromFile($$;@)
|
|
1260
1261
|
}
|
1261
1262
|
# expand shortcuts
|
1262
1263
|
@setTags and ExpandShortcuts(\@setTags);
|
1263
|
-
my $srcExifTool =
|
1264
|
+
my $srcExifTool = Image::ExifTool->new;
|
1264
1265
|
# set flag to indicate we are being called from inside SetNewValuesFromFile()
|
1265
1266
|
$$srcExifTool{TAGS_FROM_FILE} = 1;
|
1266
1267
|
# synchronize and increment the file sequence number
|
@@ -1582,7 +1583,7 @@ SET: foreach $set (@setList) {
|
|
1582
1583
|
my $opts = $$set[3];
|
1583
1584
|
# handle expressions
|
1584
1585
|
if ($$opts{EXPR}) {
|
1585
|
-
my $val = $srcExifTool->InsertTagValues(
|
1586
|
+
my $val = $srcExifTool->InsertTagValues($$set[1], \@tags, 'Error');
|
1586
1587
|
my $err = $$srcExifTool{VALUE}{Error};
|
1587
1588
|
if ($err) {
|
1588
1589
|
# pass on any error as a warning unless it is suppressed
|
@@ -2432,7 +2433,7 @@ sub WriteInfo($$;$$)
|
|
2432
2433
|
#
|
2433
2434
|
until ($$self{VALUE}{Error}) {
|
2434
2435
|
# create random access file object (disable seek test in case of straight copy)
|
2435
|
-
$raf or $raf =
|
2436
|
+
$raf or $raf = File::RandomAccess->new($inRef, 1);
|
2436
2437
|
$raf->BinMode();
|
2437
2438
|
if ($numNew == $numPseudo) {
|
2438
2439
|
$rtnVal = 1;
|
@@ -2703,7 +2704,7 @@ sub GetAllTags(;$)
|
|
2703
2704
|
my (%allTags, @groups);
|
2704
2705
|
@groups = split ':', $group if $group;
|
2705
2706
|
|
2706
|
-
my $et =
|
2707
|
+
my $et = Image::ExifTool->new;
|
2707
2708
|
LoadAllTables(); # first load all our tables
|
2708
2709
|
my @tableNames = keys %allTables;
|
2709
2710
|
|
@@ -2748,7 +2749,7 @@ sub GetWritableTags(;$)
|
|
2748
2749
|
my (%writableTags, @groups);
|
2749
2750
|
@groups = split ':', $group if $group;
|
2750
2751
|
|
2751
|
-
my $et =
|
2752
|
+
my $et = Image::ExifTool->new;
|
2752
2753
|
LoadAllTables();
|
2753
2754
|
my @tableNames = keys %allTables;
|
2754
2755
|
|
@@ -3124,11 +3125,37 @@ Conv: for (;;) {
|
|
3124
3125
|
return($val, $err);
|
3125
3126
|
}
|
3126
3127
|
|
3128
|
+
#------------------------------------------------------------------------------
|
3129
|
+
# Dereference value and push onto list
|
3130
|
+
# Inputs: 0) ExifTool ref, 1) value, 2) list ref, 3) flag to push MissingTagValue for undef value
|
3131
|
+
sub PushValue($$$;$)
|
3132
|
+
{
|
3133
|
+
local $_;
|
3134
|
+
my ($self, $val, $list, $missing) = @_;
|
3135
|
+
if (ref $val eq 'ARRAY' and ref $$val[0] ne 'HASH') {
|
3136
|
+
$self->PushValue($_, $list, $missing) foreach @$val;
|
3137
|
+
} elsif (ref $val eq 'SCALAR') {
|
3138
|
+
if ($$self{OPTIONS}{Binary} or $$val =~ /^Binary data/) {
|
3139
|
+
push @$list, $$val;
|
3140
|
+
} else {
|
3141
|
+
push @$list, 'Binary data ' . length($$val) . ' bytes';
|
3142
|
+
}
|
3143
|
+
} elsif (ref $val eq 'HASH' or ref $val eq 'ARRAY') {
|
3144
|
+
require 'Image/ExifTool/XMPStruct.pl';
|
3145
|
+
push @$list, Image::ExifTool::XMP::SerializeStruct($self, $val);
|
3146
|
+
} elsif (not defined $val) {
|
3147
|
+
my $mval = $$self{OPTIONS}{MissingTagValue};
|
3148
|
+
push @$list, $mval if $missing and defined $mval;
|
3149
|
+
} else {
|
3150
|
+
push @$list, $val;
|
3151
|
+
}
|
3152
|
+
}
|
3153
|
+
|
3127
3154
|
#------------------------------------------------------------------------------
|
3128
3155
|
# Convert tag names to values or variables in a string
|
3129
3156
|
# (eg. '${EXIF:ISO}x $$' --> '100x $' without hash ref, or "$info{'EXIF:ISO'}x $" with)
|
3130
|
-
# Inputs: 0) ExifTool object ref, 1)
|
3131
|
-
# 2)
|
3157
|
+
# Inputs: 0) ExifTool object ref, 1) string with embedded tag names,
|
3158
|
+
# 2) reference to list of found tags or undef to use FOUND_TAGS, 3) Options:
|
3132
3159
|
# undef - set missing tags to ''
|
3133
3160
|
# 'Error' - issue minor error on missing tag (and return undef)
|
3134
3161
|
# 'Warn' - issue minor warning on missing tag (and return undef)
|
@@ -3145,20 +3172,22 @@ Conv: for (;;) {
|
|
3145
3172
|
# - advanced feature allows Perl expressions inside braces (eg. '${model;tr/ //d}')
|
3146
3173
|
# - an error/warning in an advanced expression ("${TAG;EXPR}") generates an error
|
3147
3174
|
# if option set to 'Error', or a warning otherwise
|
3148
|
-
sub InsertTagValues(
|
3175
|
+
sub InsertTagValues($$;$$$$)
|
3149
3176
|
{
|
3150
3177
|
local $_;
|
3151
|
-
my ($self, $
|
3178
|
+
my ($self, $line, $foundTags, $opt, $docGrp, $cache) = @_;
|
3152
3179
|
my $rtnStr = '';
|
3153
3180
|
my ($docNum, $tag);
|
3181
|
+
|
3154
3182
|
if ($docGrp) {
|
3155
3183
|
$docNum = $docGrp =~ /(\d+)$/ ? $1 : 0;
|
3156
3184
|
} else {
|
3157
3185
|
undef $cache; # no cache if no document groups
|
3158
3186
|
}
|
3187
|
+
$foundTags or $foundTags = $$self{FOUND_TAGS} || [];
|
3159
3188
|
while ($line =~ s/(.*?)\$(\{\s*)?([-\w]*\w|\$|\/)//s) {
|
3160
3189
|
my ($pre, $bra, $var) = ($1, $2, $3);
|
3161
|
-
my (@tags, $
|
3190
|
+
my (@tags, $tg, $val, @val, $type, $expr, $didExpr, $level, $asList);
|
3162
3191
|
# "$$" represents a "$" symbol, and "$/" is a newline
|
3163
3192
|
if ($var eq '$' or $var eq '/') {
|
3164
3193
|
$line =~ s/^\s*\}// if $bra;
|
@@ -3261,15 +3290,24 @@ sub InsertTagValues($$$;$$$)
|
|
3261
3290
|
} elsif (defined $$et{OPTIONS}{UserParam}{$lcTag}) {
|
3262
3291
|
$val = $$et{OPTIONS}{UserParam}{$lcTag};
|
3263
3292
|
} elsif ($tag =~ /(.*):(.+)/) {
|
3264
|
-
my $group;
|
3293
|
+
my ($group, @matches);
|
3265
3294
|
($group, $tag) = ($1, $2);
|
3266
|
-
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3295
|
+
# join values of all matching tags if "All" group is used
|
3296
|
+
# (and remove "All" from group prefix)
|
3297
|
+
if ($group =~ s/(^|:)(all|\*)(:|$)/$1 and $3/ei) {
|
3298
|
+
if (lc $tag eq 'all') {
|
3299
|
+
@matches = $group ? $et->GroupMatches($group, $fileTags) : @$fileTags;
|
3300
|
+
} else {
|
3301
|
+
@matches = grep /^$tag(\s|$)/i, @$fileTags;
|
3302
|
+
@matches = $et->GroupMatches($group, \@matches) if $group;
|
3303
|
+
}
|
3304
|
+
$self->PushValue(scalar $et->GetValue($_, $type), \@val) foreach @matches;
|
3305
|
+
} elsif (lc $tag eq 'all') {
|
3306
|
+
# return "1" if any tag from the specified group exists
|
3307
|
+
$val = $et->GroupMatches($group, $fileTags) ? 1 : 0;
|
3270
3308
|
} else {
|
3271
3309
|
# find the specified tag
|
3272
|
-
|
3310
|
+
@matches = grep /^$tag(\s|$)/i, @$fileTags;
|
3273
3311
|
@matches = $et->GroupMatches($group, \@matches);
|
3274
3312
|
foreach $tg (@matches) {
|
3275
3313
|
if (defined $val and $tg =~ / \((\d+)\)$/) {
|
@@ -3298,31 +3336,15 @@ sub InsertTagValues($$$;$$$)
|
|
3298
3336
|
}
|
3299
3337
|
}
|
3300
3338
|
$self->Options(ListJoin => $oldListJoin) if $asList;
|
3301
|
-
|
3302
|
-
push @val, @$val;
|
3303
|
-
undef $val;
|
3304
|
-
last unless @tags;
|
3305
|
-
} elsif (ref $val eq 'SCALAR') {
|
3306
|
-
if ($$self{OPTIONS}{Binary} or $$val =~ /^Binary data/) {
|
3307
|
-
$val = $$val;
|
3308
|
-
} else {
|
3309
|
-
$val = 'Binary data ' . length($$val) . ' bytes';
|
3310
|
-
}
|
3311
|
-
} elsif (ref $val eq 'HASH') {
|
3312
|
-
require 'Image/ExifTool/XMPStruct.pl';
|
3313
|
-
$val = Image::ExifTool::XMP::SerializeStruct($self, $val);
|
3314
|
-
} elsif (not defined $val) {
|
3315
|
-
$val = $$self{OPTIONS}{MissingTagValue} if $asList;
|
3316
|
-
}
|
3317
|
-
last unless @tags;
|
3318
|
-
push @val, $val if defined $val;
|
3339
|
+
$self->PushValue($val, \@val, $asList);
|
3319
3340
|
undef $val;
|
3341
|
+
last unless @tags;
|
3320
3342
|
}
|
3321
3343
|
if (@val) {
|
3322
|
-
|
3344
|
+
$self->PushValue($val, \@val) if defined $val;
|
3323
3345
|
$val = join $$self{OPTIONS}{ListSep}, @val;
|
3324
|
-
}
|
3325
|
-
|
3346
|
+
} elsif (defined $val) {
|
3347
|
+
$self->PushValue($val, \@val); # (so the eval has access to @val if required)
|
3326
3348
|
}
|
3327
3349
|
# evaluate advanced formatting expression if given (eg. "${TAG;EXPR}")
|
3328
3350
|
if (defined $expr and defined $val) {
|
@@ -3395,6 +3417,7 @@ sub InsertTagValues($$$;$$$)
|
|
3395
3417
|
#------------------------------------------------------------------------------
|
3396
3418
|
# Reformat date/time value in $_ based on specified format string
|
3397
3419
|
# Inputs: 0) date/time format string
|
3420
|
+
# Returns: Reformatted date/time string
|
3398
3421
|
sub DateFmt($)
|
3399
3422
|
{
|
3400
3423
|
my $et = bless { OPTIONS => { DateFormat => shift, StrictDate => 1 } };
|
@@ -3406,6 +3429,7 @@ sub DateFmt($)
|
|
3406
3429
|
$_ = $et->ConvertDateTime($_);
|
3407
3430
|
defined $_ or warn "Error converting date/time\n";
|
3408
3431
|
$$advFmtSelf{GLOBAL_TIME_OFFSET} = $$et{GLOBAL_TIME_OFFSET} if $shift;
|
3432
|
+
return $_;
|
3409
3433
|
}
|
3410
3434
|
|
3411
3435
|
#------------------------------------------------------------------------------
|
@@ -3515,7 +3539,7 @@ sub CreateDirectory($$)
|
|
3515
3539
|
}
|
3516
3540
|
unless ($k32CreateDir) {
|
3517
3541
|
return -1 if defined $k32CreateDir;
|
3518
|
-
$k32CreateDir =
|
3542
|
+
$k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
|
3519
3543
|
unless ($k32CreateDir) {
|
3520
3544
|
$self->Warn('Error calling Win32::API::CreateDirectoryW');
|
3521
3545
|
$k32CreateDir = 0;
|
@@ -6233,7 +6257,7 @@ sub WriteJPEG($$)
|
|
6233
6257
|
last unless $$editDirs{CIFF};
|
6234
6258
|
my $newData = '';
|
6235
6259
|
my %dirInfo = (
|
6236
|
-
RAF =>
|
6260
|
+
RAF => File::RandomAccess->new($segDataPt),
|
6237
6261
|
OutFile => \$newData,
|
6238
6262
|
);
|
6239
6263
|
require Image::ExifTool::CanonRaw;
|
@@ -6952,7 +6976,7 @@ sub SetFileTime($$;$$$$)
|
|
6952
6976
|
}
|
6953
6977
|
unless ($k32SetFileTime) {
|
6954
6978
|
return 0 if defined $k32SetFileTime;
|
6955
|
-
$k32SetFileTime =
|
6979
|
+
$k32SetFileTime = Win32::API->new('KERNEL32', 'SetFileTime', 'NPPP', 'I');
|
6956
6980
|
unless ($k32SetFileTime) {
|
6957
6981
|
$self->Warn('Error calling Win32::API::SetFileTime');
|
6958
6982
|
$k32SetFileTime = 0;
|
@@ -7196,7 +7220,7 @@ sub WriteBinaryData($$$)
|
|
7196
7220
|
$$self{HiddenData} = {
|
7197
7221
|
Offset => $offset,
|
7198
7222
|
Size => $size,
|
7199
|
-
Fixup =>
|
7223
|
+
Fixup => Image::ExifTool::Fixup->new,
|
7200
7224
|
Base => $$dirInfo{Base},
|
7201
7225
|
};
|
7202
7226
|
next;
|
@@ -7205,7 +7229,7 @@ sub WriteBinaryData($$$)
|
|
7205
7229
|
next unless $$tagInfo{DataTag} eq 'PreviewImage' and $$self{FILE_TYPE} eq 'JPEG';
|
7206
7230
|
my $previewInfo = $$self{PREVIEW_INFO};
|
7207
7231
|
$previewInfo or $previewInfo = $$self{PREVIEW_INFO} = {
|
7208
|
-
Fixup =>
|
7232
|
+
Fixup => Image::ExifTool::Fixup->new,
|
7209
7233
|
};
|
7210
7234
|
# set flag indicating we are using short pointers
|
7211
7235
|
$$previewInfo{IsShort} = 1 unless $format eq 'int32u';
|
@@ -20,7 +20,7 @@ use strict;
|
|
20
20
|
use vars qw($VERSION $warnString);
|
21
21
|
use Image::ExifTool qw(:DataAccess :Utils);
|
22
22
|
|
23
|
-
$VERSION = '1.
|
23
|
+
$VERSION = '1.31';
|
24
24
|
|
25
25
|
sub WarnProc($) { $warnString = $_[0]; }
|
26
26
|
|
@@ -367,7 +367,7 @@ sub ProcessRAR($$)
|
|
367
367
|
# read the header and create new RAF object for reading it
|
368
368
|
my $header;
|
369
369
|
$raf->Read($header, $headSize) == $headSize or last;
|
370
|
-
my $rafHdr =
|
370
|
+
my $rafHdr = File::RandomAccess->new(\$header);
|
371
371
|
my $headType = ReadULEB($rafHdr); # get header type
|
372
372
|
|
373
373
|
if ($headType == 4) { # encryption block
|
@@ -550,14 +550,14 @@ sub ProcessZIP($$)
|
|
550
550
|
} elsif (eval { require IO::String }) {
|
551
551
|
# read the whole file into memory (what else can I do?)
|
552
552
|
$raf->Slurp();
|
553
|
-
$fh =
|
553
|
+
$fh = IO::String->new(${$raf->{BUFF_PT}});
|
554
554
|
} else {
|
555
555
|
my $type = $raf->{FILE_PT} ? 'pipe or socket' : 'scalar reference';
|
556
556
|
$et->Warn("Install IO::String to decode compressed ZIP information from a $type");
|
557
557
|
last;
|
558
558
|
}
|
559
559
|
$et->VPrint(1, " --- using Archive::Zip ---\n");
|
560
|
-
$zip =
|
560
|
+
$zip = Archive::Zip->new;
|
561
561
|
# catch all warnings! (Archive::Zip is bad for this)
|
562
562
|
local $SIG{'__WARN__'} = \&WarnProc;
|
563
563
|
my $status = $zip->readFromFileHandle($fh);
|
@@ -568,8 +568,8 @@ sub ProcessZIP($$)
|
|
568
568
|
# a failed test with Perl 5.6.2 GNU/Linux 2.6.32-5-686 i686-linux-64int-ld
|
569
569
|
$raf->Seek(0,0);
|
570
570
|
$raf->Slurp();
|
571
|
-
$fh =
|
572
|
-
$zip =
|
571
|
+
$fh = IO::String->new(${$raf->{BUFF_PT}});
|
572
|
+
$zip = Archive::Zip->new;
|
573
573
|
$status = $zip->readFromFileHandle($fh);
|
574
574
|
}
|
575
575
|
if ($status) {
|
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);
|
31
31
|
|
32
|
-
$VERSION = '12.
|
32
|
+
$VERSION = '12.74';
|
33
33
|
$RELEASE = '';
|
34
34
|
@ISA = qw(Exporter);
|
35
35
|
%EXPORT_TAGS = (
|
@@ -77,7 +77,7 @@ sub GetDeleteGroups();
|
|
77
77
|
sub AddUserDefinedTags($%);
|
78
78
|
sub SetAlternateFile($$$);
|
79
79
|
# non-public routines below
|
80
|
-
sub InsertTagValues(
|
80
|
+
sub InsertTagValues($$;$$$$);
|
81
81
|
sub IsWritable($);
|
82
82
|
sub IsSameFile($$$);
|
83
83
|
sub IsRawType($);
|
@@ -2196,7 +2196,7 @@ sub new
|
|
2196
2196
|
# use Image::ExifTool 'ImageInfo';
|
2197
2197
|
# my $info = ImageInfo($file, 'DateTimeOriginal', 'ImageSize');
|
2198
2198
|
# - or -
|
2199
|
-
# my $et =
|
2199
|
+
# my $et = Image::ExifTool->new;
|
2200
2200
|
# my $info = $et->ImageInfo($file, \@tagList, {Sort=>'Group0'} );
|
2201
2201
|
sub ImageInfo($;@)
|
2202
2202
|
{
|
@@ -2206,7 +2206,7 @@ sub ImageInfo($;@)
|
|
2206
2206
|
if (ref $_[0] and UNIVERSAL::isa($_[0],'Image::ExifTool')) {
|
2207
2207
|
$self = shift;
|
2208
2208
|
} else {
|
2209
|
-
$self =
|
2209
|
+
$self = Image::ExifTool->new;
|
2210
2210
|
}
|
2211
2211
|
my %saveOptions = %{$$self{OPTIONS}}; # save original options
|
2212
2212
|
|
@@ -2529,7 +2529,7 @@ sub ExtractInfo($;@)
|
|
2529
2529
|
FILE_TYPE => $$self{FILE_TYPE},
|
2530
2530
|
};
|
2531
2531
|
$saveOrder = GetByteOrder(),
|
2532
|
-
$$self{RAF} =
|
2532
|
+
$$self{RAF} = File::RandomAccess->new($_[0]);
|
2533
2533
|
$$self{PROCESSED} = { };
|
2534
2534
|
delete $$self{EXIF_DATA};
|
2535
2535
|
delete $$self{EXIF_POS};
|
@@ -2636,7 +2636,7 @@ sub ExtractInfo($;@)
|
|
2636
2636
|
# open the file
|
2637
2637
|
if ($self->Open(\*EXIFTOOL_FILE, $filename)) {
|
2638
2638
|
# create random access file object
|
2639
|
-
$raf =
|
2639
|
+
$raf = File::RandomAccess->new(\*EXIFTOOL_FILE);
|
2640
2640
|
# patch to force pipe to be buffered because seek returns success
|
2641
2641
|
# in Windows cmd shell pipe even though it really failed
|
2642
2642
|
$$raf{TESTED} = -1 if $filename eq '-' or $filename =~ /\|$/;
|
@@ -2767,12 +2767,16 @@ sub ExtractInfo($;@)
|
|
2767
2767
|
$raf->BinMode(); # set binary mode before we start reading
|
2768
2768
|
my $pos = $raf->Tell(); # get file position so we can rewind
|
2769
2769
|
# loop through list of file types to test
|
2770
|
-
my ($buff, $
|
2770
|
+
my ($buff, $err);
|
2771
2771
|
my %dirInfo = ( RAF => $raf, Base => $pos, TestBuff => \$buff );
|
2772
2772
|
# read start of file for testing
|
2773
|
-
$raf->Read($buff, $testLen)
|
2774
|
-
|
2775
|
-
|
2773
|
+
if ($raf->Read($buff, $testLen)) {
|
2774
|
+
$raf->Seek($pos, 0) or $err = 'Error seeking in file';
|
2775
|
+
} else {
|
2776
|
+
$err = $$raf{ERROR};
|
2777
|
+
$buff = '';
|
2778
|
+
}
|
2779
|
+
until ($err) {
|
2776
2780
|
my $unkHeader;
|
2777
2781
|
$type = shift @fileTypeList;
|
2778
2782
|
if ($type) {
|
@@ -2795,7 +2799,7 @@ sub ExtractInfo($;@)
|
|
2795
2799
|
$type = ($1 eq "\xff\xd8\xff") ? 'JPEG' : 'TIFF';
|
2796
2800
|
my $skip = pos($buff) - length($1);
|
2797
2801
|
$dirInfo{Base} = $pos + $skip;
|
2798
|
-
$raf->Seek($pos + $skip, 0) or $
|
2802
|
+
$raf->Seek($pos + $skip, 0) or $err = 'Error seeking in file', last;
|
2799
2803
|
$self->Warn("Processing $type-like data after unknown $skip-byte header");
|
2800
2804
|
$unkHeader = 1 unless $$self{DOC_NUM};
|
2801
2805
|
}
|
@@ -2841,14 +2845,13 @@ sub ExtractInfo($;@)
|
|
2841
2845
|
last;
|
2842
2846
|
}
|
2843
2847
|
# seek back to try again from the same position in the file
|
2844
|
-
$raf->Seek($pos, 0) or $
|
2848
|
+
$raf->Seek($pos, 0) or $err = 'Error seeking in file';
|
2845
2849
|
}
|
2846
|
-
if (not defined $type and not $$self{DOC_NUM}) {
|
2850
|
+
if (not $err and not defined $type and not $$self{DOC_NUM}) {
|
2847
2851
|
# if we were given a single image with a known type there
|
2848
2852
|
# must be a format error since we couldn't read it, otherwise
|
2849
2853
|
# it is likely we don't support images of this type
|
2850
2854
|
my $fileType = GetFileType($realname) || '';
|
2851
|
-
my $err;
|
2852
2855
|
if (not length $buff) {
|
2853
2856
|
$err = 'File is empty';
|
2854
2857
|
} else {
|
@@ -2889,10 +2892,9 @@ sub ExtractInfo($;@)
|
|
2889
2892
|
}
|
2890
2893
|
}
|
2891
2894
|
}
|
2892
|
-
$self->Error($err);
|
2893
2895
|
}
|
2894
|
-
if ($
|
2895
|
-
$self->Error(
|
2896
|
+
if ($err) {
|
2897
|
+
$self->Error($err);
|
2896
2898
|
} elsif ($self->Options('ScanForXMP') and (not defined $type or
|
2897
2899
|
(not $fast and not $$self{FoundXMP})))
|
2898
2900
|
{
|
@@ -4114,7 +4116,7 @@ sub Init($)
|
|
4114
4116
|
$$self{FileType} = ''; # identified file type
|
4115
4117
|
if ($self->Options('HtmlDump')) {
|
4116
4118
|
require Image::ExifTool::HtmlDump;
|
4117
|
-
$$self{HTML_DUMP} =
|
4119
|
+
$$self{HTML_DUMP} = Image::ExifTool::HtmlDump->new;
|
4118
4120
|
}
|
4119
4121
|
# make sure our TextOut is a file reference
|
4120
4122
|
$$self{OPTIONS}{TextOut} = \*STDOUT unless ref $$self{OPTIONS}{TextOut};
|
@@ -4177,7 +4179,7 @@ sub ExtractAltInfo($)
|
|
4177
4179
|
# (eg. -file1 '$originalfilename')
|
4178
4180
|
if ($fileName =~ /\$/) {
|
4179
4181
|
my @tags = reverse sort keys %{$$self{VALUE}};
|
4180
|
-
$fileName = $self->InsertTagValues(\@tags,
|
4182
|
+
$fileName = $self->InsertTagValues($fileName, \@tags, 'Warn');
|
4181
4183
|
next unless defined $fileName;
|
4182
4184
|
}
|
4183
4185
|
$altExifTool->ExtractInfo($fileName);
|
@@ -4504,7 +4506,7 @@ sub GetFileTime($$)
|
|
4504
4506
|
$atime = $mtime = $ctime = pack 'LL', 0, 0;
|
4505
4507
|
unless ($k32GetFileTime) {
|
4506
4508
|
return () if defined $k32GetFileTime;
|
4507
|
-
$k32GetFileTime =
|
4509
|
+
$k32GetFileTime = Win32::API->new('KERNEL32', 'GetFileTime', 'NPPP', 'I');
|
4508
4510
|
unless ($k32GetFileTime) {
|
4509
4511
|
$self->Warn('Error calling Win32::API::GetFileTime');
|
4510
4512
|
$k32GetFileTime = 0;
|
@@ -4583,7 +4585,7 @@ sub ParseArguments($;@)
|
|
4583
4585
|
my $buff = $@ ? pack('C*',unpack($] < 5.010000 ? 'U0C*' : 'C0C*',$$arg)) : Encode::encode('utf8',$$arg);
|
4584
4586
|
$arg = \$buff;
|
4585
4587
|
}
|
4586
|
-
$$self{RAF} =
|
4588
|
+
$$self{RAF} = File::RandomAccess->new($arg);
|
4587
4589
|
# set filename to empty string to indicate that
|
4588
4590
|
# we have a file but we didn't open it
|
4589
4591
|
$$self{FILENAME} = '';
|
@@ -6981,7 +6983,7 @@ sub ProcessJPEG($$)
|
|
6981
6983
|
} elsif ($$segDataPt =~ /^(II|MM).{4}HEAPJPGM/s) {
|
6982
6984
|
next if $fast > 1; # skip processing for very fast
|
6983
6985
|
$dumpType = 'CIFF';
|
6984
|
-
my %dirInfo = ( RAF =>
|
6986
|
+
my %dirInfo = ( RAF => File::RandomAccess->new($segDataPt) );
|
6985
6987
|
$$self{SET_GROUP1} = 'CIFF';
|
6986
6988
|
push @{$$self{PATH}}, 'CIFF';
|
6987
6989
|
require Image::ExifTool::CanonRaw;
|
@@ -7506,6 +7508,8 @@ sub ProcessJPEG($$)
|
|
7506
7508
|
} elsif ($$segDataPt =~ /^AROT\0/ and $length > 10) {
|
7507
7509
|
# iPhone "AROT" segment containing integrated intensity per 16 scan lines
|
7508
7510
|
# (with number of elements N = ImageHeight / 16 - 1, ref PH/NealKrawetz)
|
7511
|
+
# "Absolute ROTational difference between two frames"
|
7512
|
+
# (see https://www.hackerfactor.com/blog/index.php?/archives/822-Apple-Rot.html)
|
7509
7513
|
$xtra = 'segment (N=' . unpack('x6N', $$segDataPt) . ')';
|
7510
7514
|
}
|
7511
7515
|
} elsif ($marker == 0xeb) { # APP11 (JPEG-HDR, JUMBF)
|
@@ -8005,7 +8009,7 @@ sub DoProcessTIFF($$;$)
|
|
8005
8009
|
}
|
8006
8010
|
}
|
8007
8011
|
# update FileType if necessary now that we know more about the file
|
8008
|
-
if ($$self{DNGVersion} and $$self{FileType} !~ /^(DNG|GPR)$/) {
|
8012
|
+
if ($$self{DNGVersion} and $$self{FILE_TYPE} eq 'TIFF' and $$self{FileType} !~ /^(DNG|GPR)$/) {
|
8009
8013
|
# override whatever FileType we set since we now know it is DNG
|
8010
8014
|
$self->OverrideFileType($$self{TIFF_TYPE} = 'DNG');
|
8011
8015
|
}
|
data/bin/lib/Image/ExifTool.pod
CHANGED
@@ -619,7 +619,8 @@ DateFormat of "%Y:%m:%d %H:%M:%S").
|
|
619
619
|
=item Duplicates
|
620
620
|
|
621
621
|
Flag to return values from tags with duplicate names when extracting
|
622
|
-
information. Default is 1.
|
622
|
+
information. Default is 1. Forced to 1 when copying tags with
|
623
|
+
L</SetNewValuesFromFile>.
|
623
624
|
|
624
625
|
=item Escape
|
625
626
|
|
@@ -824,11 +825,11 @@ Default is undef.
|
|
824
825
|
|
825
826
|
=item LimitLongValues
|
826
827
|
|
827
|
-
When extracting some
|
828
|
-
length-limited and the value is truncated with an
|
829
|
-
exceeds a specified length. This option specifies
|
830
|
-
these tags. A setting of 4 or less disables the limit
|
831
|
-
string is longer than this). Default is 60.
|
828
|
+
When extracting values for some specific tags (usually Unknown tags), the
|
829
|
+
PrintConv values are length-limited and the value is truncated with an
|
830
|
+
ellipsis ("[...]") if it exceeds a specified length. This option specifies
|
831
|
+
the length limit for these tags. A setting of 4 or less disables the limit
|
832
|
+
(because the ellipsis string is longer than this). Default is 60.
|
832
833
|
|
833
834
|
=item ListItem
|
834
835
|
|
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.74.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-01-
|
12
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: exiftool
|