Skip to content

Commit 60695c2

Browse files
Merge pull request #126 from woss/v13.52
Update exiftool to version v13.52
2 parents 842c237 + ddea12f commit 60695c2

35 files changed

+942
-227
lines changed

exiftool/exiftool

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use strict;
1111
use warnings;
1212
require 5.004;
1313

14-
my $version = '13.50';
14+
my $version = '13.52';
1515

1616
$^W = 1; # enable global warnings
1717

@@ -5530,7 +5530,7 @@ C<E<lt>> to avoid confusion with the C<E<lt>=> operator which sets the tag
55305530
value from the contents of a file. A single space at the start of the
55315531
string is removed if it exists, but all other whitespace in the string is
55325532
preserved. See note 8 below about using the redirection feature with
5533-
list-type stags, shortcuts or when using wildcards in tag names.
5533+
list-type tags, shortcuts or when using wildcards in tag names.
55345534
55355535
See L</COPYING EXAMPLES> for examples using B<-tagsFromFile>.
55365536
@@ -6136,7 +6136,7 @@ with this command:
61366136
61376137
produces output like this:
61386138
6139-
-- Generated by ExifTool 13.50 --
6139+
-- Generated by ExifTool 13.52 --
61406140
File: a.jpg - 2003:10:31 15:44:19
61416141
(f/5.6, 1/60s, ISO 100)
61426142
File: b.jpg - 2006:05:23 11:57:38

exiftool/lib/Image/ExifTool.pm

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
2929
%jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
3030
%static_vars $advFmtSelf $configFile @configFiles $noConfig);
3131

32-
$VERSION = '13.50';
32+
$VERSION = '13.52';
3333
$RELEASE = '';
3434
@ISA = qw(Exporter);
3535
%EXPORT_TAGS = (
@@ -1202,7 +1202,7 @@ my @availableOptions = (
12021202
[ 'UserParam', { }, 'user parameters for additional user-defined tag values' ],
12031203
[ 'Validate', undef, 'perform additional validation' ],
12041204
[ 'Verbose', 0, 'print verbose messages (0-5, higher # = more verbose)' ],
1205-
[ 'WindowsLongPath', 1, 'enable support for long pathnames (enables WindowsWideFile)' ],
1205+
[ 'WindowsLongPath', 0, 'enable support for long pathnames (enables WindowsWideFile)' ],
12061206
[ 'WindowsWideFile', undef, 'force the use of Windows wide-character file routines' ], # (see forum15208)
12071207
[ 'WriteMode', 'wcg', 'enable all write modes by default' ],
12081208
[ 'XAttrTags', undef, 'extract MacOS extended attribute tags' ],
@@ -2674,11 +2674,13 @@ sub ClearOptions($)
26742674
{
26752675
local $_;
26762676
my $self = shift;
2677-
2678-
$$self{OPTIONS} = { }; # clear all options
2677+
my $opts = $$self{OPTIONS} = { }; # clear all options
26792678

26802679
# load default options
2681-
$$self{OPTIONS}{$$_[0]} = $$_[1] foreach @availableOptions;
2680+
$$opts{$$_[0]} = $$_[1] foreach @availableOptions;
2681+
2682+
# enable WindowsLongPath if Win32::API is available
2683+
$$opts{WindowsLongPath} = 1 if $^O eq 'MSWin32' and eval { require Win32::API };
26822684

26832685
# keep necessary member variables in sync with options
26842686
delete $$self{CUR_LANG};
@@ -8223,7 +8225,7 @@ sub ProcessJPEG($$;$)
82238225
} elsif ($marker == 0xea) { # APP10 (PhotoStudio Unicode comments, HDR gain curve)
82248226
if ($$segDataPt =~ /^UNICODE\0/) {
82258227
$dumpType = 'PhotoStudio';
8226-
my $comment = $self->Decode(substr($$segDataPt,8), 'UCS2', 'MM');
8228+
my $comment = $self->Decode(substr($$segDataPt,8), 'UTF16', 'MM');
82278229
$self->FoundTag('Comment', $comment);
82288230
} elsif ($$segDataPt =~ /^AROT\0\0.{4}/s) {
82298231
$dumpType = 'AROT', # (HDR gain curve? PH guess)
@@ -9864,7 +9866,7 @@ sub ProcessBinaryData($$$)
98649866
my $nextIndex = 0;
98659867
my $varSize = 0;
98669868
foreach $index (@tags) {
9867-
my ($tagInfo, $val, $saveNextIndex, $len, $mask, $wasVar, $rational);
9869+
my ($tagInfo, $val, $saveNextIndex, $len, $mask, $wasVar, $rational, $offAdj);
98689870
if ($$tagTablePtr{$index}) {
98699871
$tagInfo = $self->GetTagInfo($tagTablePtr, $index);
98709872
unless ($tagInfo) {
@@ -9974,7 +9976,7 @@ sub ProcessBinaryData($$$)
99749976
$varSize += $count; # shift subsequent indices
99759977
unless (defined $val) {
99769978
$val = substr($$dataPt, $entry+$dirStart, $count);
9977-
$val = $self->Decode($val, 'UCS2') if $format eq 'ustring' or $format eq 'ustr32';
9979+
$val = $self->Decode($val, 'UTF16') if $format eq 'ustring' or $format eq 'ustr32';
99789980
$val =~ s/\0.*//s unless $format eq 'undef'; # truncate at null
99799981
}
99809982
$binVal = substr($$dataPt, $entry+$dirStart, $count) if $$self{OPTIONS}{SaveBin};
@@ -9998,7 +10000,7 @@ sub ProcessBinaryData($$$)
999810000
} elsif ($varSize != $oldVarSize and $verbose > 2) {
999910001
my ($tmp, $sign) = ($varSize, '+');
1000010002
$tmp < 0 and $tmp = -$tmp, $sign = '-';
10001-
$self->VPrint(2, sprintf("$$self{INDENT}\[offsets adjusted by ${sign}0x%.4x after 0x%.4x $$tagInfo{Name}]\n", $tmp, $index));
10003+
$offAdj = sprintf("$$self{INDENT}\[offsets adjusted by ${sign}0x%.4x after 0x%.4x $$tagInfo{Name}]\n", $tmp, $index);
1000210004
}
1000310005
}
1000410006
if ($unknown > 1) {
@@ -10037,6 +10039,7 @@ sub ProcessBinaryData($$$)
1003710039
Extra => $mask ? sprintf(', mask 0x%.2x',$mask) : undef,
1003810040
);
1003910041
}
10042+
$offAdj and $self->VPrint(2, $offAdj);
1004010043
# parse nested BinaryData directories
1004110044
if ($$tagInfo{SubDirectory}) {
1004210045
my $subdir = $$tagInfo{SubDirectory};

exiftool/lib/Image/ExifTool.pod

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,8 @@ on tag values and JPEG segment data respectively.
12781278
=item WindowsLongPath
12791279

12801280
Support long path names in Windows. Enabling this option automatically
1281-
enables the WindowsWideFile feature. Default is 1.
1281+
enables the WindowsWideFile feature. Default is 1 if Win32::API is
1282+
available, or 0 otherwise.
12821283

12831284
=item WindowsWideFile
12841285

@@ -2879,7 +2880,7 @@ Win32API::File is available.
28792880

28802881
Note that setting the L</WindowsWideFile> or L</WindowsLongPath> option
28812882
causes L</CharsetFileName> to default to 'UTF8' in Windows if not defined,
2882-
and L</WindowsLongPath> is set by default in ExifTool 13.07 and later.
2883+
and L</WindowsLongPath> is set by default if Win32::API is available.
28832884

28842885
=item Internal Character Sets:
28852886

exiftool/lib/Image/ExifTool/APP12.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use strict;
1414
use vars qw($VERSION);
1515
use Image::ExifTool qw(:DataAccess :Utils);
1616

17-
$VERSION = '1.14';
17+
$VERSION = '1.15';
1818

1919
sub ProcessAPP12($$$);
2020
sub ProcessDucky($$$);
@@ -114,17 +114,17 @@ sub WriteDucky($$$);
114114
Priority => 0,
115115
Avoid => 1,
116116
# (ignore 4-byte character count at start of value)
117-
ValueConv => '$self->Decode(substr($val,4),"UCS2","MM")',
118-
ValueConvInv => 'pack("N",length $val) . $self->Encode($val,"UCS2","MM")',
117+
ValueConv => '$self->Decode(substr($val,4),"UTF16","MM")',
118+
ValueConvInv => 'pack("N",length $val) . $self->Encode($val,"UTF16","MM")',
119119
},
120120
3 => { #PH
121121
Name => 'Copyright',
122122
Priority => 0,
123123
Avoid => 1,
124124
Groups => { 2 => 'Author' },
125125
# (ignore 4-byte character count at start of value)
126-
ValueConv => '$self->Decode(substr($val,4),"UCS2","MM")',
127-
ValueConvInv => 'pack("N",length $val) . $self->Encode($val,"UCS2","MM")',
126+
ValueConv => '$self->Decode(substr($val,4),"UTF16","MM")',
127+
ValueConvInv => 'pack("N",length $val) . $self->Encode($val,"UTF16","MM")',
128128
},
129129
);
130130

exiftool/lib/Image/ExifTool/ASF.pm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
1717
use Image::ExifTool::Exif;
1818
use Image::ExifTool::RIFF;
1919

20-
$VERSION = '1.26';
20+
$VERSION = '1.27';
2121

2222
sub ProcessASF($$;$);
2323
sub ProcessContentDescription($$$);
@@ -549,7 +549,7 @@ sub ProcessContentDescription($$$)
549549
my $len = shift @len;
550550
next unless $len;
551551
return 0 if $pos + $len > $dirLen;
552-
my $val = $et->Decode(substr($$dataPt,$pos,$len),'UCS2','II');
552+
my $val = $et->Decode(substr($$dataPt,$pos,$len),'UTF16','II');
553553
$et->HandleTag($tagTablePtr, $tag, $val);
554554
$pos += $len;
555555
}
@@ -594,7 +594,7 @@ sub ReadASF($$$$$)
594594
my ($et, $dataPt, $pos, $format, $size) = @_;
595595
my @vals;
596596
if ($format == 0) { # unicode string
597-
$vals[0] = $et->Decode(substr($$dataPt,$pos,$size),'UCS2','II');
597+
$vals[0] = $et->Decode(substr($$dataPt,$pos,$size),'UTF16','II');
598598
} elsif ($format == 2) { # 4-byte boolean
599599
@vals = ReadValue($dataPt, $pos, 'int32u', undef, $size);
600600
foreach (@vals) {
@@ -631,7 +631,7 @@ sub ProcessExtendedContentDescription($$$)
631631
my $nameLen = unpack("x${pos}v", $$dataPt);
632632
$pos += 2;
633633
return 0 if $pos + $nameLen + 4 > $dirLen;
634-
my $tag = Image::ExifTool::Decode(undef,substr($$dataPt,$pos,$nameLen),'UCS2','II','Latin');
634+
my $tag = Image::ExifTool::Decode(undef,substr($$dataPt,$pos,$nameLen),'UTF16','II','Latin');
635635
$tag =~ s/^WM\///; # remove leading "WM/"
636636
$pos += $nameLen;
637637
my ($dType, $dLen) = unpack("x${pos}v2", $$dataPt);
@@ -667,7 +667,7 @@ sub ProcessMetadata($$$)
667667
my ($index, $stream, $nameLen, $dType, $dLen) = unpack("x${pos}v4V", $$dataPt);
668668
$pos += 12;
669669
return 0 if $pos + $nameLen + $dLen > $dirLen;
670-
my $tag = Image::ExifTool::Decode(undef,substr($$dataPt,$pos,$nameLen),'UCS2','II','Latin');
670+
my $tag = Image::ExifTool::Decode(undef,substr($$dataPt,$pos,$nameLen),'UTF16','II','Latin');
671671
$tag =~ s/^WM\///; # remove leading "WM/"
672672
$pos += $nameLen;
673673
my $val = ReadASF($et,$dataPt,$pos,$dType,$dLen);
@@ -702,8 +702,8 @@ sub ProcessPicture($$$)
702702
my $str = substr($$dataPt, $dirStart+5, $n);
703703
if ($str =~ /^((?:..)*?)\0\0((?:..)*?)\0\0/s) {
704704
my ($mime, $desc) = ($1, $2);
705-
$et->HandleTag($tagTablePtr, 1, $et->Decode($mime,'UCS2','II'));
706-
$et->HandleTag($tagTablePtr, 2, $et->Decode($desc,'UCS2','II')) if length $desc;
705+
$et->HandleTag($tagTablePtr, 1, $et->Decode($mime,'UTF16','II'));
706+
$et->HandleTag($tagTablePtr, 2, $et->Decode($desc,'UTF16','II')) if length $desc;
707707
}
708708
$et->HandleTag($tagTablePtr, 3, substr($$dataPt, $dirStart+5+$n, $picLen));
709709
return 1;
@@ -731,12 +731,12 @@ sub ProcessCodecList($$$)
731731
my $nameLen = Get16u($dataPt, $pos + 2) * 2;
732732
$pos += 4;
733733
return 0 if $pos + $nameLen + 2 > $dirLen;
734-
my $name = $et->Decode(substr($$dataPt,$pos,$nameLen),'UCS2','II');
734+
my $name = $et->Decode(substr($$dataPt,$pos,$nameLen),'UTF16','II');
735735
$et->HandleTag($tagTablePtr, "${type}Name", $name);
736736
my $descLen = Get16u($dataPt, $pos + $nameLen) * 2;
737737
$pos += $nameLen + 2;
738738
return 0 if $pos + $descLen + 2 > $dirLen;
739-
my $desc = $et->Decode(substr($$dataPt,$pos,$descLen),'UCS2','II');
739+
my $desc = $et->Decode(substr($$dataPt,$pos,$descLen),'UTF16','II');
740740
$et->HandleTag($tagTablePtr, "${type}Description", $desc);
741741
my $infoLen = Get16u($dataPt, $pos + $descLen);
742742
$pos += $descLen + 2 + $infoLen;

exiftool/lib/Image/ExifTool/BuildTagLookup.pm

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use Image::ExifTool::Sony;
3535
use Image::ExifTool::Validate;
3636
use Image::ExifTool::MacOS;
3737

38-
$VERSION = '3.65';
38+
$VERSION = '3.66';
3939
@ISA = qw(Exporter);
4040

4141
sub NumbersFirst($$);
@@ -2262,22 +2262,33 @@ sub WriteTagNames($$)
22622262
print HTMLFILE "<table class='inner sep' cellspacing=1>\n";
22632263
my $align = ' class=r';
22642264
my $wid = 0;
2265-
my @keys;
2265+
my (@keys, @bits);
22662266
foreach (sort { NumbersFirst($a,$b) } keys %$printConv) {
2267-
next if /^(Notes|PrintHex|PrintInt|PrintString|OTHER)$/;
2267+
next if /^(Notes|PrintHex|PrintInt|PrintString|OTHER|BITMASK)$/;
22682268
$align = '' if $align and /[^\d]/;
22692269
my $w = length($_) + length($$printConv{$_});
22702270
$wid = $w if $wid < $w;
22712271
push @keys, $_;
2272-
if ($$printConv{$_} =~ /[\0-\x1f\x7f-\xff]/) {
2273-
warn "Warning: Special characters in $tableName PrintConv ($$printConv{$_})\n";
2272+
next unless $$printConv{$_} =~ /[\0-\x1f\x7f-\xff]/;
2273+
warn "Warning: Special characters in $tableName PrintConv ($$printConv{$_})\n";
2274+
}
2275+
my $bits = $$printConv{BITMASK};
2276+
if ($bits) {
2277+
$align = '';
2278+
foreach (sort { NumbersFirst($a,$b) } keys %$bits) {
2279+
my $w = length($_) + length($$bits{$_}) + 4;
2280+
$wid = $w if $wid < $w;
2281+
push @bits, $_;
2282+
next unless $$bits{$_} =~ /[\0-\x1f\x7f-\xff]/;
2283+
warn "Warning: Special characters in $tableName PrintConv BITMASK ($$bits{$_})\n";
22742284
}
22752285
}
22762286
$wid = length($tableName)+7 if $wid < length($tableName)+7;
22772287
# print in multiple columns if there is room
22782288
my $cols = int(110 / ($wid + 4));
2279-
$cols = 1 if $cols < 1 or $cols > @keys or @keys < 4;
2280-
my $rows = int((scalar(@keys) + $cols - 1) / $cols);
2289+
my $items = @keys + @bits;
2290+
$cols = 1 if $cols < 1 or $cols > $items or $items < 4;
2291+
my $rows = int(($items + $cols - 1) / $cols);
22812292
my ($r, $c);
22822293
print HTMLFILE '<tr class=h>';
22832294
for ($c=0; $c<$cols; ++$c) {
@@ -2287,11 +2298,18 @@ sub WriteTagNames($$)
22872298
for ($r=0; $r<$rows; ++$r) {
22882299
print HTMLFILE '<tr>';
22892300
for ($c=0; $c<$cols; ++$c) {
2290-
my $key = $keys[$r + $c*$rows];
2291-
my ($index, $prt);
2301+
my ($key, $val, $index, $prt);
2302+
my $n = $r + $c * $rows;
2303+
if ($n < @keys) {
2304+
$key = $keys[$n];
2305+
$val = $$printConv{$key};
2306+
} elsif ($n < $items) {
2307+
$key = 'Bit ' . $bits[$n - @keys];
2308+
$val = $$bits{$bits[$n - @keys]};
2309+
}
22922310
if (defined $key) {
22932311
$index = $key;
2294-
$prt = '= ' . EscapeHTML($$printConv{$key});
2312+
$prt = '= ' . EscapeHTML($val);
22952313
$index =~ s/\.\d+$// if $$printConv{PrintInt};
22962314
if ($$printConv{PrintHex}) {
22972315
$index =~ s/(\.\d+)$//; # remove decimal

0 commit comments

Comments
 (0)