Skip Menu |

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

Report information
The Basics
Id: 18147
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Image-Info

People
Owner: Nobody in particular
Requestors: jpo [...] di.uminho.pt
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.19
Fixed in: 1.20

Attachments
Image-Info-1.20-beta2.patch
Image-Info-1.20-lib-Image-Info-TIFF.pm.patch
Image-Info-1.20-tiff-specification-url.patch



Subject: Image::Info - the TIFF testsuite may fail due to endianess problems
Tels, Several TIFF tests fail if tiff_image_endianess != machine_endianess More detailed info: * Every image file directory entry is exactly 12 bytes: tag[2] + type[2] + count[4] + value_offset[4]) * most of the times the value offset is a valid file offset (4 bytes) but if the size of the information is <= 4 it is stored directly in the value_offset field. * as several values of the tiff image are short integers (2 bytes) and by the standard they must be always stored in the lower bytes of the above field (the TIFF.pm code always assumes it has 4 bytes and if the image endianess doesn't match the system one we have problems - the wrong bytes will be used). The patch attached removes the excess bytes. /jpo
Subject: Image-Info-1.20-lib-Image-Info-TIFF.pm.patch
--- Image-Info-1.20-beta/lib/Image/Info/TIFF.pm 2006-03-05 09:10:51.000000000 +0000 +++ Image-Info-1.20/lib/Image/Info/TIFF.pm 2006-03-11 21:29:24.000000000 +0000 @@ -135,7 +135,13 @@ my $val; ## The 4 bytes of $value_offset may actually contains the value itself, ## if it fits into 4 bytes. - if ($typelen * $count <= 4) { + my $len = $typelen * $count; + if ($len <= 4) { + if (($byteorder ne $Config{byteorder}) && ($len != 4)) { + my @bytes = unpack("C4", $value_offset_orig); + for (my $i=0; $i < 4 - $len; $i++) { shift @bytes; } + $value_offset_orig = pack("C$len", @bytes); + } @$val = unpack($typepack x $count, $value_offset_orig); } elsif ($fieldtype == 5 || $fieldtype == 10) { ## Rationals
From: jpo [...] di.uminho.pt
Tels, There is apublic link for the TIFF spec. See the attached patch. jpo
diff -ruN Image-Info-1.20-beta/lib/Image/Info/TIFF.pm Image-Info-1.20/lib/Image/Info/TIFF.pm --- Image-Info-1.20-beta/lib/Image/Info/TIFF.pm 2006-03-05 09:10:51.000000000 +0000 +++ Image-Info-1.20/lib/Image/Info/TIFF.pm 2006-03-11 21:39:28.000000000 +0000 @@ -247,8 +247,8 @@ MAGIC: /^MM\x00\x2a/ MAGIC: /^II\x2a\x00/ -The C<TIFF> spec can be found at (requires a login): -L<http://partners.adobe.com/asn/developer/PDFS/TN/TIFF6.pdf> +The C<TIFF> spec can be found at: +L<http://partners.adobe.com/public/developer/tiff/> The EXIF spec can be found at: L<http://www.exif.org/>
Subject: Re: [rt.cpan.org #18147] Image::Info - the TIFF testsuite may fail due to endianess problems
Date: Mon, 13 Mar 2006 19:40:04 +0100
To: bug-Image-Info [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Moin, On Monday 13 March 2006 19:18, Guest via RT wrote: Show quoted text
> Queue: Image-Info > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18147 > > > Tels, > > There is apublic link for the TIFF spec. > See the attached patch.
I applied both patches and put a trial package to: http://bloodgate.com/perl/packages/devel/ Can you please test it, if it is ok, I will release it as v1.20. Thanx again, Tels -- Signed on Mon Mar 13 19:38:59 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Yeah, baby, yeah!"
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.

From: jpo [...] di.uminho.pt
Tels, On Mon Mar 13 13:40:26 2006, nospam-abuse@bloodgate.com wrote: Show quoted text
> > I applied both patches and put a trial package to: > > http://bloodgate.com/perl/packages/devel/ > > Can you please test it, if it is ok, I will release it as v1.20.
Tels, The test suite runs without problems here: even if I use a big-endian TIFF test image in a Intel system. The patch includes a couple of minor doc corrections: * the endianness problem would also bite big-endian machines * the new TIFF spec link doesn't need a login account * expanded my nick to fullname in the CREDITS file ;) jpo
diff -ruN Image-Info-1.20-beta2/Changes Image-Info-1.20/Changes --- Image-Info-1.20-beta2/Changes 2006-03-13 18:36:52.000000000 +0000 +++ Image-Info-1.20/Changes 2006-03-13 19:01:04.000000000 +0000 @@ -8,7 +8,8 @@ + read only 11 bytes to determine file format (tiny.pgm is 11 bytes long) + fix provided patch to really work * fix bug #18147: - + new TIFF code failed on little-endian machines - thanx jpo! + + new TIFF code failed if the system endianness didn't match the TIFF image + endianness - thanx jpo! * replace the link to the TIFF spec with a public link - thanx jpo! 2006-03-05 v1.19 Tels 74 tests diff -ruN Image-Info-1.20-beta2/CREDITS Image-Info-1.20/CREDITS --- Image-Info-1.20-beta2/CREDITS 2006-03-10 10:30:36.000000000 +0000 +++ Image-Info-1.20/CREDITS 2006-03-13 19:01:20.000000000 +0000 @@ -19,7 +19,7 @@ Gisle Aas Main author and contributor Jay Soffian <jay@loudcloud.com> Exif MakerNote decoding Jerrad Pierce <belg4mit@mit.edu> ASCII, BMP SVG, XPM and XBM support -jpo <jpo@di.uminho.pt> XBM/XPM bug reports and patches +Jose Pedro Oliveira <jpo@di.uminho.pt> XBM/XPM/TIFF bug reports and patches Phil Harvey <phil@ owl.phy.queensu.ca> Panasonic Exif MakerNotes Ralf Steines <metamonk@yahoo.com> GIF fixes <srezic@cpan.org> bug report #8522 diff -ruN Image-Info-1.20-beta2/lib/Image/Info/TIFF.pm Image-Info-1.20/lib/Image/Info/TIFF.pm --- Image-Info-1.20-beta2/lib/Image/Info/TIFF.pm 2006-03-13 18:33:19.000000000 +0000 +++ Image-Info-1.20/lib/Image/Info/TIFF.pm 2006-03-13 19:01:20.000000000 +0000 @@ -256,7 +256,7 @@ MAGIC: /^MM\x00\x2a/ MAGIC: /^II\x2a\x00/ -The C<TIFF> spec can be found at (requires a login): +The C<TIFF> spec can be found at: L<http://partners.adobe.com/public/developer/tiff/> The EXIF spec can be found at:
Subject: Re: [rt.cpan.org #18147] Image::Info - the TIFF testsuite may fail due to endianess problems
Date: Mon, 13 Mar 2006 21:37:30 +0100
To: bug-Image-Info [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
Helo Jose, On Monday 13 March 2006 20:10, Guest via RT wrote: Show quoted text
> Queue: Image-Info > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=18147 > > > Tels, > > On Mon Mar 13 13:40:26 2006, nospam-abuse@bloodgate.com wrote:
> > I applied both patches and put a trial package to: > > > > http://bloodgate.com/perl/packages/devel/ > > > > Can you please test it, if it is ok, I will release it as v1.20.
> > Tels, > > The test suite runs without problems here: > even if I use a big-endian TIFF test image in a Intel system. > > The patch includes a couple of minor doc corrections: > * the endianness problem would also bite big-endian machines > * the new TIFF spec link doesn't need a login account
Good catch! Show quoted text
> * expanded my nick to fullname in the CREDITS file ;)
Ok, I apply this, then release 1.20 ASAP. Big thanx for your assistance, Tels -- Signed on Mon Mar 13 21:36:54 2006 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "To be beautiful is enough! If a woman can do that well who should demand more from her? You don't want a rose to sing." -- Thackeray
Download (untitled)
application/pgp-signature 481b

Message body not shown because it is not plain text.