Hi all, right now I'm developing a project using webp animations on embedded chip, so I have pretty strict memory limitations. As decoding library I'm using libwebp, and I've come across the problem that as far as I could see, there's no way to init WebPAnimDecoder and start playing the animation without having full webp file in the buffer.
Are there any workarounds that can be used?
To do this you will need to use the libwebpdemux interface along with the decoder (incremental or otherwise). The demuxer has a WebPDemuxPartial() function [1] that can be used for this purpose. Note your application will also need to handle the composition (blending / disposal) of the image to the full canvas. Chrome uses this method [2].
The only limitation to the WebPDemuxPartial() function is that it will reparse the buffer provided. There is no way to continue demuxing at this point. It would be possible to do this, and has come up in the context of Chrome in the past, but it hasn't been a priority.