Skip Menu |

This queue is for tickets about the Image-Info CPAN distribution.

Report information
The Basics
Id: 18525
Status: resolved
Estimated: 30 min
Priority: 0/
Queue: Image-Info

People
Owner: TELS [...] cpan.org
Requestors: dan [...] datacomit.com.au
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.16
Fixed in: 1.20



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) {
patch as attachment
38c38 < die "short read($len/$n)" unless $n == $len; --- > die "short read expected:$len found:$n at $offset)" unless $n == $len; 122c122,125 < if ($fieldtype == 3 && $count <= 1) { --- > if ($fieldtype == 2 && $count <= 4) { > # ASCII 4 or less bytes (inclusive of trailing null) - value is the offset > $offset = unpack("AAAA",my_read_order($fh,4,$byteorder)); > } elsif ($fieldtype == 3 && $count <= 1) { 126c129 < } else { # fieldtype == 4 --- > } else { 130c133,135 < if ($fieldtype == 2) { --- > if ($fieldtype == 2 && $count <= 4) { > $val = $offset; > } elsif ($fieldtype == 2) {
Subject: Re: [rt.cpan.org #18525] Fixes TIFF.pm to allow it to correctly handle ACSII tags with a count of 4 or less
Date: Tue, 4 Apr 2006 18:59:14 +0200
To: bug-Image-Info [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Moin, On Tuesday 04 April 2006 11:49, Guest via RT wrote: Show quoted text
> Queue: Image-Info > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18525 > > > > patch as attachment
Thanx for the report and patch. Could you please resend it as unified diff (aka diff -u)? best wishes, tels -- Signed on Tue Apr 4 18:58:45 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Die deutsche Zensoren - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dummköpfe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -." Heinrich Heine
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

Show quoted text
> (aka diff -u)?
attached
diff U3b N:\CodeDevelopment\internal\Image-Info_1.16_patched\Image-Info-1.16\lib\Image\Info\TIFF.pm N:\CodeDevelopment\internal\Image-Info_1.16_patched\TIFF_with_changes.pm --- N:\CodeDevelopment\internal\Image-Info_1.16_patched\Image-Info-1.16\lib\Image\Info\TIFF.pm Wed Jan 07 22:41:12 2004 +++ N:\CodeDevelopment\internal\Image-Info_1.16_patched\TIFF_with_changes.pm Tue Jan 10 12:16:13 2006 @@ -35,7 +35,7 @@ my $buf; seek($fh,$offset,0); my $n = read($fh,$buf,$len); - die "short read($len/$n)" unless $n == $len; + die "short read expected:$len found:$n at $offset)" unless $n == $len; # back to before. seek($fh,$curoffset,0); return $buf; @@ -119,15 +119,20 @@ my $fieldtype = unpack("S",my_read_order($fh,2,$byteorder)); my $count = unpack("L",my_read_order($fh,4,$byteorder)); my $offset; - if ($fieldtype == 3 && $count <= 1) { + if ($fieldtype == 2 && $count <= 4) { + # ASCII 4 or less bytes (inclusive of trailing null) - value is the offset + $offset = unpack("AAAA",my_read_order($fh,4,$byteorder)); + } elsif ($fieldtype == 3 && $count <= 1) { $offset = unpack("S",my_read_order($fh,2,$byteorder)); # skip rest my_read_order($fh,2,$byteorder); - } else { # fieldtype == 4 + } else { $offset = unpack("L",my_read_order($fh,4,$byteorder)); } my $val = ""; - if ($fieldtype == 2) { + if ($fieldtype == 2 && $count <= 4) { + $val = $offset; + } elsif ($fieldtype == 2) { $val = my_readbytes($fh,$offset,$count); } elsif (($fieldtype == 3 || $fieldtype == 4) && $count == 1) {
From: dan [...] jumbuk.com
On Tue Apr 04 21:49:10 2006, guest wrote: Show quoted text
>
> > (aka diff -u)?
> > attached
is the diff ok?
Subject: Re: [rt.cpan.org #18525] Fixes TIFF.pm to allow it to correctly handle ACSII tags with a count of 4 or less
Date: Wed, 19 Apr 2006 00:52:55 +0200
To: bug-Image-Info [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Moin, On Tuesday 18 April 2006 23:52, Guest via RT wrote: Show quoted text
> Queue: Image-Info > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18525 > > > On Tue Apr 04 21:49:10 2006, guest wrote:
> > > (aka diff -u)?
> > > > attached
> > is the diff ok?
Yes, thank you very much! I was overloaded and did not have time for Image::Info. There are a few other issues I wanted to kill at the same time, too. I will release a new version this weekend, no matter how far I get :) best wishes, Tels -- Signed on Wed Apr 19 00:52:06 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "What is fair use? Fair use is not a law. There's nothing in law. Right now, any professor can show a complete movie in his classroom without paying a dime - that's fair use. What is not fair use is making a copy of an encrypted DVD, because once you're able to break the encryption, you've undermined the encryption itself." - Jack Valenti
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #18525] Fixes TIFF.pm to allow it to correctly handle ACSII tags with a count of 4 or less
Date: Sat, 29 Apr 2006 17:45:46 +0200
To: bug-Image-Info [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Moin, On Tuesday 18 April 2006 23:52, Guest via RT wrote: Show quoted text
> Queue: Image-Info > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18525 > > > On Tue Apr 04 21:49:10 2006, guest wrote:
> > > (aka diff -u)?
> > > > attached
> > is the diff ok?
Looking at the code and the diff, I noticed that your patch is against 1.16. It fails when applied to 1.20 (rejected). Can you please use first v1.20 and see if the problem still persists, and if so, make a new patch against it? Also, having a test image would help very much. My hunch is the problem is already fixed in 1.20 (the latest version), but I am not sure. best wishes, tels -- Signed on Sat Apr 29 17:44:35 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Wo die Schoschonen schön wohnen."
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

Show quoted text
> My hunch is the problem is already fixed in 1.20 (the latest
1.20 appears to address the issue. Thanks!