GNOME Bugzilla – Bug 71267
implement a loader for MNG animations
Last modified: 2011-12-16 23:44:45 UTC
based on libmng
The problem is that libmng allows only one iterator at a time for each animation, which means you can't implement the GdkPixbufAnimation API without copying the entire image data structure for each iterator.
For how many potential users of that API do you expect the restriction to a single iterator to be a problem ? I would guess that 90% of them are quite happy with a single iterator, considering that they're using libmng directly now. The remaining 10% will probably have to suffer the overhead of copying the whole animation for every other iterator. If only libmng offered a way to do that conveniently ! All I can see now is that you would have to extract each frame and reconstruct an animation from these full frames, which would of course be a huge memory hog.
Sure, most people will only display the animation one time. But the GdkPixbufAnimation API does have to be implemented in such a way that it works, and it'll be a pain with libmng.
Displaying it multiple times wouldn't even a problem, or would it ? My understanding of the problematic case was: displaying the same animation in two places at the same time, e.g. one window plays the animation at full speed while another one single-steps through it. Are there any alternatives to libmng ? You have talked to the libmng maintainer about this problem, haven't you ? What was the outcome, will there be a non-multiple-iterator-impaired libmng sometime ?
Displaying it two places at once conceptually means two positions in the anim at once (look at how GtkImage works) I think I intended to talk to the libmng maintainers but never did.
Simple things first: Here is a first cut at an mng loader which only loads still images. I've only implemented incremental loading, non-incremental loading can be provided by the generic_image_load implementation which is attached to some other bug. Loading animations is left as an excercise for the reader.
Created attachment 7640 [details] the loader
Created attachment 7641 [details] [review] necessary glue
Created attachment 7658 [details] this file is probably needed, too
*** Bug 113077 has been marked as a duplicate of this bug. ***
I see this is marked as "needs-work" but even a static loader would be really useful (release early release often) so I'm hoping someone could clarify if the needs work means you are waiting for minor cleanup of the patches or if for some reason you thought it was a good idea to wait until it had full animation support?
Anything happening on this bug?
I don't think adding an mng loader that can only display the first frame is useful, and the libmng api cannot really support the iterator concept that GdkPixbufAnimation requires.
Sure, but as gtk supports gif, why not mng? Isn't it just like a list of pngs? If it can't be supported, GdkPixbufAnimation should at least have a constructor, which takes an array of pngs.
*** Bug 167718 has been marked as a duplicate of this bug. ***
Nothing happening here, and mng has not really made it as an animation file format anyway. Not worth keeping a bug open.