Android Question GifDecoder Problem

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi,

I'm having some problems with gifdecoder... when trying to load big gif files with this, I'm get the error:

java.lang.OutOfMemoryError: Failed to allocate a 1920012 byte allocation with 242424 free bytes and 236KB until OOM


B4X:
    Dim EncGIF As AnimatedGifEncoder
    Dim DecGIF As GifDecoder

    File.Copy(sourcedir,sourcefile,File.DirInternal,"temp.gif")
    Log("gif size -> " & File.Size(File.DirInternal,"temp.gif"))
    DecGIF.Load(File.DirInternal,"temp.gif")'<< original gif path

It looks that is occurring because the library tries to load all the frames in the memory. If I had the source code could try to load the frame only when required, reducing a lot the memory use...

Does anybody can help?
 
Top