in reply to Re: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
in thread Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)

Going back to the original post, there does appear to be a bug in the GIF reader in PDF::API2, which causes it to decompress larger size GIF files incorrectly. I managed to trace through and fix it for my project. The relevant library file GIF.pm, version 2.0, 2005/11/16 contains an error in line 135. The patch is as follows:
C<< 135c135 < $bits++ if($nextcode == (1<<$bits)); --- > $bits++ if($nextcode == (1<<$bits) and $bits<12); >>
I will submit this bug/fix to the package maintainer but in the meantime this post should help people who are stuck get their program working again.
  • Comment on Re^2: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
  • Download Code

Replies are listed 'Best First'.
Re^3: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
by MidLifeXis (Monsignor) on Apr 30, 2010 at 16:30 UTC

    When generating submitting your patch, can you generate a .t file as well that exhibits the incorrect behavior in the original, but not the patched version.

    Not certain how you would do this, but there may be an example in the source .t files.

    --MidLifeXis

      there may be an example in the source .t files.

      JFYI, PDF::API2 test suite contains one file and it is called t/00use.t :)

        Eww, eww, eww, eww, eww, eww, eww. Thanks for the FYI. Once more, eew.

        --MidLifeXis

Re^3: Including GIF image into PDF (using GD::Graph and PDF::API2 libraries)
by Anonymous Monk on Jun 18, 2013 at 15:24 UTC
    thanks a lot. works for me also.