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

People
Owner: Nobody in particular
Requestors: futuramedium [...] yandex.ru
Cc:
AdminCc:

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
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 http://en.wikipedia.org/wiki/File:Sunflower_as_gif_websafe.gif, 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.
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