Skip Menu |

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

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

People
Owner: TELS [...] cpan.org
Requestors: DON [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.16
Fixed in: 1.17



Subject: libimage-info-perl: dies at JPEGInterchangeFormatLngth parsing section with some images
A Debian user reported the following bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=281967 Package: libimage-info-perl Version: 1.16-1 Severity: normal End-user supplied image (apparently from a Sony CyberShot) causes: error - Died at /usr/share/perl5/Image/Info/JPEG.pm line 260 Commenting out the the thumbnail section allows a successful parse, but may affect other functionality. The offending JPEG can be found here: http://deeper.emphasys.net/libimage-info-perl-bug.jpg
libimage-info-perl-bug.jpg
From: srezic [...] cpan.org
[DON - Fri Nov 19 02:54:40 2004]: Show quoted text
> A Debian user reported the following bug: > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=281967 > > Package: libimage-info-perl > Version: 1.16-1 > Severity: normal > > End-user supplied image (apparently from a Sony CyberShot) causes: > error - Died at /usr/share/perl5/Image/Info/JPEG.pm line 260 > > Commenting out the the thumbnail section allows a successful parse, but > may affect other functionality. > > The offending JPEG can be found here: > http://deeper.emphasys.net/libimage-info-perl-bug.jpg >
While not a perfect solution, an easy workaround is just to ignore the offending section if the returned length is zero. I think most people are not interested in the thumbnail info, so this might be sufficient. See the attached patch. Regards, Slaven
--- Image/Info/JPEG.pm.orig 2005-02-01 17:34:31.000000000 +0100 +++ Image/Info/JPEG.pm 2005-02-01 17:35:26.000000000 +0100 @@ -257,13 +257,14 @@ # information of this (thumbnail) image file... if (my($ipos) = $info->get_info($i, "JPEGInterchangeFormat", 1)) { my($ilen) = $info->get_info($i, "JPEGInterchangeFormatLngth", 1); - die unless $ilen; + if ($ilen) { my $jdata = substr($data, $ipos, $ilen); #$info->push_info($i, "JPEGImage" => $jdata); with_io_string { _process_file($info, $_, $i); } $jdata; + } } # Turn XResolution/YResolution into 'resolution'
I fixed the offending part of the code in v1.17 - and also corrected the name of the section to "..Length" (was incorrectly "...Lngth"). Thanx for the bugreport and suggestion. Tels