Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gif support #4

Closed
nudded opened this issue Jan 14, 2012 · 3 comments
Closed

Gif support #4

nudded opened this issue Jan 14, 2012 · 3 comments

Comments

@nudded
Copy link

nudded commented Jan 14, 2012

I created a haskell gif parser and writer a while back: https://bitbucket.org/nudded/gif-parser/

I thought you might be interested. It should be able to read any GIF87a file (and most of the GIF89a files). But the lzw code is there (it is quite hard to cover all the edge cases).

I'm having exams atm, so i will be looking into this after them.

@Twinside
Copy link
Owner

Hi,

Thanks for the information, I tried your decoder, but there is a HUGE problem of performance, I tried it with this huge Gif image and ran into a stack overflow and when launching with more stack space (./gif-parser +RTS -K30000000 -RTS huge.gif), it consumed 3.5 GB of memory while running, I had to kill it from then.

For a direct inclusion in the library, a partial rewrite to handle huge loads is needed, but don't worry, it's doable, and having a reference implementation is always good to have.

@nudded
Copy link
Author

nudded commented Jan 14, 2012

Yes this is mostly a problem with the lzw implementation since it uses a very inefficient Map. If you look into it, you will see why (it maps List on Int. so the key is a List which makes for very bad performance).

Also, my example main does load the same gif in memory 6 times (and i didn't test if it was garbage collected)

@Twinside
Copy link
Owner

Reimplemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants