Subject: | Fixes TIFF.pm to allow it to correctly handle ACSII tags with a count of 4 or less |
=====================snip
This fixes TIFF.pm to allow it to correctly handle ACSII tags with a
count of 4 or less.
Code did not correctly handle this case.
See TIFF specification for details.
diff.txt needs to be applied to ../lib/Image/Info/TIFF.pm
***note*** there are two files in this distribution called TIFF.pm -
make sure you patch the correct file.
======================snip
38c38
< die "short read($len/$n)" unless $n == $len;
---
Show quoted text
> die "short read expected:$len found:$n at $offset)" unless $n ==
$len;
122c122,125
< if ($fieldtype == 3 && $count <= 1) {
---
Show quoted text> if ($fieldtype == 2 && $count <= 4) {
> # ASCII 4 or less bytes (inclusive of trailing null) -
value is the offset
Show quoted text> $offset = unpack("AAAA",my_read_order($fh,4,$byteorder));
> } elsif ($fieldtype == 3 && $count <= 1) {
126c129
< } else { # fieldtype == 4
---
Show quoted text> } else {
130c133,135
< if ($fieldtype == 2) {
---
Show quoted text> if ($fieldtype == 2 && $count <= 4) {
> $val = $offset;
> } elsif ($fieldtype == 2) {