BuildTagLookup.pm (Image-ExifTool-12.57) | : | BuildTagLookup.pm (Image-ExifTool-12.58) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
use Image::ExifTool::Shortcuts; | use Image::ExifTool::Shortcuts; | |||
use Image::ExifTool::HTML qw(EscapeHTML); | use Image::ExifTool::HTML qw(EscapeHTML); | |||
use Image::ExifTool::IPTC; | use Image::ExifTool::IPTC; | |||
use Image::ExifTool::XMP; | use Image::ExifTool::XMP; | |||
use Image::ExifTool::Canon; | use Image::ExifTool::Canon; | |||
use Image::ExifTool::Nikon; | use Image::ExifTool::Nikon; | |||
use Image::ExifTool::Sony; | use Image::ExifTool::Sony; | |||
use Image::ExifTool::Validate; | use Image::ExifTool::Validate; | |||
use Image::ExifTool::MacOS; | use Image::ExifTool::MacOS; | |||
$VERSION = '3.51'; | $VERSION = '3.52'; | |||
@ISA = qw(Exporter); | @ISA = qw(Exporter); | |||
sub NumbersFirst($$); | sub NumbersFirst($$); | |||
sub SortedTagTablekeys($); | sub SortedTagTablekeys($); | |||
my $createDate = 'Feb 15, 2005'; | my $createDate = 'Feb 15, 2005'; | |||
# global variables to control sorting order of table entries | # global variables to control sorting order of table entries | |||
my $numbersFirst = 1; # set to -1 to sort numbers last, or 2 to put negative n umbers last | my $numbersFirst = 1; # set to -1 to sort numbers last, or 2 to put negative n umbers last | |||
my $caseInsensitive; # flag to ignore case when sorting tag names | my $caseInsensitive; # flag to ignore case when sorting tag names | |||
skipping to change at line 187 | skipping to change at line 187 | |||
(B<#> is the multiplier for calculating a byte offset: B<1>, B<2>, B<4> or | (B<#> is the multiplier for calculating a byte offset: B<1>, B<2>, B<4> or | |||
B<8>). These offsets may have a decimal part which is used only to | B<8>). These offsets may have a decimal part which is used only to | |||
differentiate tags with values stored at the same position. (Note that | differentiate tags with values stored at the same position. (Note that | |||
writable tags within binary data blocks are not individually deletable, | writable tags within binary data blocks are not individually deletable, | |||
and the usual alternative is to set them to a value of zero.) B<Sequence> | and the usual alternative is to set them to a value of zero.) B<Sequence> | |||
gives the order of values for a serial data stream. | gives the order of values for a serial data stream. | |||
A B<Tag Name> is the handle by which the information is accessed in | A B<Tag Name> is the handle by which the information is accessed in | |||
ExifTool. In some instances, more than one name may correspond to a single | ExifTool. In some instances, more than one name may correspond to a single | |||
tag ID. In these cases, the actual name used depends on the context in | tag ID. In these cases, the actual name used depends on the context in | |||
which the information is found. Case is not significant for tag names. A | which the information is found. Valid characters in a tag name are A-Z, | |||
a-z, 0-9, hyphen (-) and underline (_). Case is not significant. A | ||||
question mark (C<?>) after a tag name indicates that the information is | question mark (C<?>) after a tag name indicates that the information is | |||
either not understood, not verified, or not very useful -- these tags are | either not understood, not verified, or not very useful -- these tags are | |||
not extracted by ExifTool unless the L<Unknown|../ExifTool.html#Unknown> (-u) op tion is enabled. Be | not extracted by ExifTool unless the L<Unknown|../ExifTool.html#Unknown> (-u) op tion is enabled. Be | |||
aware that some tag names are different than the descriptions printed out by | aware that some tag names are different than the descriptions printed out by | |||
default when extracting information with exiftool. To see the tag names | default when extracting information with exiftool. To see the tag names | |||
instead of the descriptions, use C<exiftool -s>. | instead of the descriptions, use C<exiftool -s>. | |||
The B<Writable> column indicates whether the tag is writable by ExifTool. | The B<Writable> column indicates whether the tag is writable by ExifTool. | |||
Anything but a C<no> in this column means the tag is writable. A C<yes> | Anything but a C<no> in this column means the tag is writable. A C<yes> | |||
indicates writable information that is either unformatted or written using | indicates writable information that is either unformatted or written using | |||
skipping to change at line 1209 | skipping to change at line 1210 | |||
if ($$tagInfo{SeparateTable}) { | if ($$tagInfo{SeparateTable}) { | |||
$subdir = 1; | $subdir = 1; | |||
my $s = $$tagInfo{SeparateTable}; | my $s = $$tagInfo{SeparateTable}; | |||
$s = $name if $s eq '1'; | $s = $name if $s eq '1'; | |||
# add module name if not specified | # add module name if not specified | |||
$s =~ / / or ($short =~ /^(\w+)/ and $s = "$1 $s"); | $s =~ / / or ($short =~ /^(\w+)/ and $s = "$1 $s"); | |||
push @values, $s; | push @values, $s; | |||
$sepTable{$s} = $printConv; | $sepTable{$s} = $printConv; | |||
# add PrintHex flag to PrintConv so we can check it later | # add PrintHex flag to PrintConv so we can check it later | |||
$$printConv{PrintHex} = 1 if $$tagInfo{PrintHex}; | $$printConv{PrintHex} = 1 if $$tagInfo{PrintHex}; | |||
$$printConv{PrintInt} = 1 if $$tagInfo{PrintInt}; | ||||
$$printConv{PrintString} = 1 if $$tagInfo{PrintStrin g}; | $$printConv{PrintString} = 1 if $$tagInfo{PrintStrin g}; | |||
} else { | } else { | |||
$caseInsensitive = 0; | $caseInsensitive = 0; | |||
my @pk; | my @pk; | |||
if ($$tagInfo{PrintSort}) { | if ($$tagInfo{PrintSort}) { | |||
@pk = sort { NumbersFirst($$printConv{$a},$$prin tConv{$b}) } keys %$printConv; | @pk = sort { NumbersFirst($$printConv{$a},$$prin tConv{$b}) } keys %$printConv; | |||
} else { | } else { | |||
@pk = sort { NumbersFirst($a,$b) } keys %$printC onv; | @pk = sort { NumbersFirst($a,$b) } keys %$printC onv; | |||
} | } | |||
my $n = scalar @values; | my $n = scalar @values; | |||
my ($bits, $i, $v); | my ($bits, $i, $v); | |||
foreach (@pk) { | foreach (@pk) { | |||
next if $_ eq '' and $$printConv{$_} eq ''; | next if $_ eq '' and $$printConv{$_} eq ''; | |||
$_ eq 'BITMASK' and $bits = $$printConv{$_}, nex t; | $_ eq 'BITMASK' and $bits = $$printConv{$_}, nex t; | |||
$_ eq 'OTHER' and next; | $_ eq 'OTHER' and next; | |||
my $index; | my $index = $_; | |||
if (($$tagInfo{PrintHex} or $$printConv{BITMASK} | $index =~ s/\.\d+$// if $$tagInfo{PrintInt}; | |||
) and /^-?\d+$/) { | if (($$tagInfo{PrintHex} or $$printConv{BITMASK} | |||
) and $index =~ /^-?\d+$/) { | ||||
my $dig = $$tagInfo{PrintHex} || 1; | my $dig = $$tagInfo{PrintHex} || 1; | |||
if ($_ >= 0) { | if ($index >= 0) { | |||
$index = sprintf('0x%.*x', $dig, $_); | $index = sprintf('0x%.*x', $dig, $index) | |||
; | ||||
} elsif ($format and $format =~ /int(16|32)/ ) { | } elsif ($format and $format =~ /int(16|32)/ ) { | |||
# mask off unused bits of signed integer hex value | # mask off unused bits of signed integer hex value | |||
my $mask = { 16 => 0xffff, 32 => 0xfffff fff }->{$1}; | my $mask = { 16 => 0xffff, 32 => 0xfffff fff }->{$1}; | |||
$index = sprintf('0x%.*x', $dig, $_ & $m | $index = sprintf('0x%.*x', $dig, $index | |||
ask); | & $mask); | |||
} else { | ||||
$index = $_; | ||||
} | } | |||
} elsif (/^[+-]?(?=\d|\.\d)\d*(\.\d*)?$/ and not | } elsif ($$tagInfo{PrintString} or not /^[+-]?(? | |||
$$tagInfo{PrintString}) { | =\d|\.\d)\d*(\.\d*)?$/) { | |||
$index = $_; | ||||
} else { | ||||
$index = $_; | ||||
# translate unprintable values | # translate unprintable values | |||
if ($index =~ s/([\x00-\x1f\x80-\xff])/sprin tf("\\x%.2x",ord $1)/eg) { | if ($index =~ s/([\x00-\x1f\x80-\xff])/sprin tf("\\x%.2x",ord $1)/eg) { | |||
$index = qq{"$index"}; | $index = qq{"$index"}; | |||
} else { | } else { | |||
$index = qq{'${index}'}; | $index = qq{'${index}'}; | |||
} | } | |||
} | } | |||
push @values, "$index = " . $$printConv{$_}; | push @values, "$index = " . $$printConv{$_}; | |||
if ($valueConvHash) { | if ($valueConvHash) { | |||
foreach $v (keys %$valueConvHash) { | foreach $v (keys %$valueConvHash) { | |||
skipping to change at line 2213 | skipping to change at line 2211 | |||
close HTMLFILE; | close HTMLFILE; | |||
if (OpenHtmlFile($htmldir, $tableName, 1)) { | if (OpenHtmlFile($htmldir, $tableName, 1)) { | |||
print HTMLFILE '<p>', Doc2Html($notes), "</p>\n" if $notes; | print HTMLFILE '<p>', Doc2Html($notes), "</p>\n" if $notes; | |||
print HTMLFILE "<blockquote>\n"; | print HTMLFILE "<blockquote>\n"; | |||
print HTMLFILE "<table class=frame><tr><td>\n"; | print HTMLFILE "<table class=frame><tr><td>\n"; | |||
print HTMLFILE "<table class='inner sep' cellspacing=1>\n"; | print HTMLFILE "<table class='inner sep' cellspacing=1>\n"; | |||
my $align = ' class=r'; | my $align = ' class=r'; | |||
my $wid = 0; | my $wid = 0; | |||
my @keys; | my @keys; | |||
foreach (sort { NumbersFirst($a,$b) } keys %$printConv) { | foreach (sort { NumbersFirst($a,$b) } keys %$printConv) { | |||
next if /^(Notes|PrintHex|PrintString|OTHER)$/; | next if /^(Notes|PrintHex|PrintInt|PrintString|OTHER)$/; | |||
$align = '' if $align and /[^\d]/; | $align = '' if $align and /[^\d]/; | |||
my $w = length($_) + length($$printConv{$_}); | my $w = length($_) + length($$printConv{$_}); | |||
$wid = $w if $wid < $w; | $wid = $w if $wid < $w; | |||
push @keys, $_; | push @keys, $_; | |||
if ($$printConv{$_} =~ /[\0-\x1f\x7f-\xff]/) { | if ($$printConv{$_} =~ /[\0-\x1f\x7f-\xff]/) { | |||
warn "Warning: Special characters in $tableName PrintCon v ($$printConv{$_})\n"; | warn "Warning: Special characters in $tableName PrintCon v ($$printConv{$_})\n"; | |||
} | } | |||
} | } | |||
$wid = length($tableName)+7 if $wid < length($tableName)+7; | $wid = length($tableName)+7 if $wid < length($tableName)+7; | |||
# print in multiple columns if there is room | # print in multiple columns if there is room | |||
skipping to change at line 2241 | skipping to change at line 2239 | |||
} | } | |||
print HTMLFILE "</tr>\n"; | print HTMLFILE "</tr>\n"; | |||
for ($r=0; $r<$rows; ++$r) { | for ($r=0; $r<$rows; ++$r) { | |||
print HTMLFILE '<tr>'; | print HTMLFILE '<tr>'; | |||
for ($c=0; $c<$cols; ++$c) { | for ($c=0; $c<$cols; ++$c) { | |||
my $key = $keys[$r + $c*$rows]; | my $key = $keys[$r + $c*$rows]; | |||
my ($index, $prt); | my ($index, $prt); | |||
if (defined $key) { | if (defined $key) { | |||
$index = $key; | $index = $key; | |||
$prt = '= ' . EscapeHTML($$printConv{$key}); | $prt = '= ' . EscapeHTML($$printConv{$key}); | |||
$index =~ s/\.\d+$// if $$printConv{PrintInt}; | ||||
if ($$printConv{PrintHex}) { | if ($$printConv{PrintHex}) { | |||
$index =~ s/(\.\d+)$//; # remove decimal | $index =~ s/(\.\d+)$//; # remove decimal | |||
$index = sprintf('0x%x',$index); | $index = sprintf('0x%x',$index); | |||
$index .= $1 if $1; # add back decimal | $index .= $1 if $1; # add back decimal | |||
} elsif ($$printConv{PrintString} or | } elsif ($$printConv{PrintString} or | |||
$index !~ /^[+-]?(?=\d|\.\d)\d*(\.\d*)?$/) | $index !~ /^[+-]?(?=\d|\.\d)\d*(\.\d*)?$/) | |||
{ | { | |||
$index = "'" . EscapeHTML($index) . "'"; | $index = "'" . EscapeHTML($index) . "'"; | |||
} | } | |||
} else { | } else { | |||
End of changes. 9 change blocks. | ||||
17 lines changed or deleted | 17 lines changed or added |