Variable size gifs?

So, I have code that works with 64x64 gifs and uses
GifDecoder<64, 64, lzwMaxBits> decoder;

Later, I have a 320x96 gif I’d like to decode and scroll on my screen.
Because of templates, I can’t reset the decoder object to be 320x96, correct?
If so, it seems that I need to make a separate decoder2, which sadly will allocate its own memory, and then go back and forth between decoder and decoder2 as needed.
Still correct?

If so, given that I already modified my fork of the library to use malloc instead of arrays to make ESP32 happy, I suppose I can add a new method in it to free the memory allocated.

Does this sound like the most reasonable way to do this?
(and yes, before you ask, 320x96 gif uses close to 90KB of RAM once decoded)

Malloc stack in GifDecoder startDecoding. Requested bytes: 4096
Malloc prefix in GifDecoder startDecoding. Requested bytes: 8192
Malloc suffix in GifDecoder startDecoding. Requested bytes: 4096
Malloc imageData in GifDecoder startDecoding. Requested bytes: 30720
Malloc imageDataBU in GifDecoder startDecoding. Requested bytes: 30720
Malloc palette in GifDecoder startDecoding. Requested bytes: 768
Malloc tempBuffer in GifDecoder startDecoding. Requested bytes: 260

By the way, here is what it looks like when you scroll something that big:

It’s quite inefficient, it renders the full gif and displays it at an offset with the off screen pixels being discarded when they get drawn, but enough to render for this proof of concept.
Long story short, I’m not going to keep this, it’s too awkward visually speaking not counting the refresh artifacts because if the amount of bright pixels, causing the phone to take frames that are too quick, and capture refresh artifacts.

Have you considered resizing the GIF to fit your display? Might be easier than modifying the decoder to do something special.

Well, the gif I was scrolling as 320x96, it was already resized to 96 height and I’m scrolling the 320 across 64 width visible.
My other gifs are 64x64 and I’m resizing them at display time to 64x96 so that I don’t use more memory needlessly.
Seems that basically what I’m doing is just a bit too off what I was supposed to, so I’ll stick to simpler stuff :slight_smile: