Skip Menu |

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 44877
Status: open
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: chris.czub [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.73
Fixed in: (no value)



Subject: GIF not supporting all extension blocks
I was trying to parse a GIF image in my HTML file using PDF::API2::Resource::XObject::Image::GIF and it reported: unsupported graphic control extension (254) at /opt/ActivePerl-5.8/site/lib/PDF/API2/Resource/XObject/Image/GIF.pm line 229. 254 is of course 0xFE, which denotes a Comment Extension Block in the GIF format(http://www.onicos.com/staff/iz/formats/gif.html) The Comment Extension Blocks have the same introducer, 0x21, so PDF::API2::Resource::XObject::Image::GIF thought it was a malformed Graphic Control Extension and died. This will likely be present on all platforms.
More specifically, this is a GIF created with The GIMP... here are the hex contents of the comment extension block that is throwing it off: 21 FE 15 43 72 65 61 74 65 64 20 77 69 74 68 20 54 68 65 20 47 49 4D 50 00
Hi Chris, On Wed Apr 08 12:55:17 2009, chrisczub wrote: Show quoted text
> I was trying to parse a GIF image in my HTML file using > PDF::API2::Resource::XObject::Image::GIF and it reported: > > unsupported graphic control extension (254) at > /opt/ActivePerl-5.8/site/lib/PDF/API2/Resource/XObject/Image/GIF.pm line > 229. > > 254 is of course 0xFE, which denotes a Comment Extension Block in the > GIF format(http://www.onicos.com/staff/iz/formats/gif.html) > > The Comment Extension Blocks have the same introducer, 0x21, so > PDF::API2::Resource::XObject::Image::GIF thought it was a malformed > Graphic Control Extension and died.
I've just started maintaining PDF::API2, and am not familiar enough with the various graphics formats to be able to address this ticket. I wonder if it would make sense to use the Imager module or something similar to parse GIF (and other) images instead of having to include and maintain parsing code for each file format. Is this something you might be willing to look into? Thanks, Steve Simms
FYI, this is fixed in PDF::Builder (safely skips over extension blocks)