Menu

Animated GIF bugs

Developers
tom
2009-01-09
2013-05-02
  • tom

    tom - 2009-01-09

    Hi Devil team,

    I found error when calling ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE) for animated gif files. It seems that this problem occurs since version 1.7.3 (1.7.2 works). Test source:

    int main(int argc, char* argv[])
    {
        ILuint imageId;
        ILboolean success;
       
        if(argc < 2)
        {
            printf("no file\n");
            return -1;
        }

        ilInit();
        ilGenImages(1, &imageId);
        ilBindImage(imageId);
        success = ilLoadImage(argv[1]);
        if(!success)
        {
            printf("error while openning file\n");
            return -1;
        }
       
        success = ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE);
        if(!success)
        {
            printf("error while converting image\n");
            return -1;
        }
    ...

    Otherwise, saving all images of the animation in separate png files (using ilActiveImage and ilSave(IL_PNG, ...)) works well but resulting files are bad. I found this problem only for optimized GIF files (if they use transparency to avoid duplication of similar part of the image).

    When i've enough time, i will try to find more details (or fix) to help you debugging this problem.

    Thanks,

    Tom

     
    • Denton Woods

      Denton Woods - 2009-01-09

      Do you have an example GIF that this fails on?

       
    • tom

      tom - 2009-01-09
       
    • Denton Woods

      Denton Woods - 2009-01-10

      Okay, I think I found the source of the problem.  One was in ilConvertImage when it converts the palette.  Another was in the GIF-loading code where the x and y offsets were not being properly applied for a frame.  The version in CVS is able to load the Newton's cradle image just fine now.

       
    • tom

      tom - 2009-01-10

      Good ! i will try it, thanks !

       

Log in to post a comment.