Skip Menu |

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

Report information
The Basics
Id: 91822
Status: resolved
Priority: 0/
Queue: PDF-API2

Owner: Nobody in particular
Requestors: futuramedium [...]

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.021

Subject: Bug in deGIF sub -- LZW code size should not exceed 12
Download (untitled) / with headers
text/plain 795b
Test: use PDF::API2; my $pdf = PDF::API2->new; my $page = $pdf->page(); my $gfx = $page->gfx(); my $gif = $pdf->image_gif('Sunflower_as_gif_websafe.gif'); my $img = $gfx->image($gif,0,0); $pdf->saveas('test_api2-gif.pdf'); Resulting PDF is broken, Adobe Reader says 'Insufficient data for an image.' Image source is, but any GIF image will do, that's large enough to reach code 4096 in compression table. Uncommenting debugging output, that's present in deGIF, shows that compression size gets to 13 bits for one iteration, that can not be with GIF compression. To fix, condition to increase code size can be changed to $bits++ if $nextcode == 1<<$bits and $bits < 12; It looks like this bug has been there for quite some time.
Download (untitled) / with headers
text/plain 145b
This is now fixed, and will be included in the next release. Thanks for including clear instructions on how to reproduce and fix the bug. Steve

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to