Menu

#2 GifBuilder: Ressources not freed

closed-fixed
5
2009-11-05
2009-11-04
Bill BOQUET
No

I think this is a bug.

Here are the steps to reproduce the problem :
Lets add 3 frames, and encode a gif. On my machine it takes 2 or 3 seconds. -> great
Now, i add 50 frames and encode a new gif -> it works, and it takes around 50-60 seconds.
And finaly, i remove all the frames using the _frames.Clear() method, and add 3 frames again.

When i encode the new 3 frames gif, it takes more than 60 seconds !

Discussion

  • Simon Bridewell

    Simon Bridewell - 2009-11-04

    Clearing the _frames collection in GifBuilder doesn't clear the frames already added to the AnimatedGifEncoder so I suspect your 3rd GIF will contain all 50 frames from the 2nd GIF plus the 3 new ones.

    I'm working on a change to AnimatedGifEncoder which exposes its own Frames property, removing the need for the _frames member in GifBuilder - if you call Clear() on this new property then it seems to remove all the old frames OK.

     
  • Simon Bridewell

    Simon Bridewell - 2009-11-04
    • assigned_to: nobody --> sbridewell
    • status: open --> pending
     
  • Simon Bridewell

    Simon Bridewell - 2009-11-04

    The change is checked into the code repository now, along with a test case AnimatedGifEncoderTest.Bug2892015

     
  • Bill BOQUET

    Bill BOQUET - 2009-11-05

    those changes are great ! thank you :)

     
  • Simon Bridewell

    Simon Bridewell - 2009-11-05
    • status: pending --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB