New AnimatedGifs with FFat support on ESP32

My fork of AnimatedGifs added support for SPIFFS so that you don’t need an sdcard, but sadly when you add too many files, it caused some inefficiencies in seeks that caused the GIF animations to hang at times.

The fix was to switch to the new FatFS/FFAT support that was added recently. I’ve just added it in GitHub - marcmerlin/AnimatedGIFs: Animated GIFs on Teensy, ESP8266, ESP32 on top of FastLED::NeoMatrix, SmartMatrix::GFX, and SmartMatrix, using Sdcard, SPIFFS, and FatFS (FFAT) and now it nicely animates up to 3MB of animated Gifs on ESP32 without any hangs.

More FatFS/FFAT details: http://marc.merlins.org/perso/arduino/post_2019-03-30_Using-FatFS-FFat-on-ESP32-Flash-With-Arduino.html
esp32_fatfsimage/README.md at master · marcmerlin/esp32_fatfsimage · GitHub

Good improvements Marc!

Adafruit took the AnimatedGIFs sketch and turned it into an Arcada platform specific library with some nice improvements. I forked their library and made it generic again, adding the original AnimatedGIFs sketch as an example. Right now it just has Teensy and ESP32 SD support.

The library just has (mostly) generic code, platform specific code like FilenameFunctions will go into sketches.

For ESP* SPIFFS, I’d like to add a separate example to keep the FilenameFunctions.* files manageable without a lot of #ifdefs. Check out the link to AnimatedGIFs_SD that’s credited in the README for some ESP* specific code that got stripped out before Adafruit’s latest library releases.

I thought you’d be interested in migrating your AnimatedGIFs sketch to use the new library to get the improvements and bug fixes. There’s some new stuff you can do with the library, like seek to specific frames of GIFs (see Adafruit’s Arcada crankyGIFs example), pause on a frame, and get data from the GifDecoder class that normally would be private.

1 Like

Oh, thanks for that. Not sure when I’ll have time, but definitely hope to have a look.

Luckily most of the changes were under the hood, and you can see how few changes I had to make to the example to get it to work with the library, so hopefully it’s an easy upgrade for you when you find time

So, I’ve been distracted by other work, and to be honest, the old library works well enough for me, that migrating to the new one is cleanup work which will definitely require some migration effort from me, with no obvious benefit for now :slight_smile:
Doesn’t mean I won’t do it, just that I need a bit of incentive :slight_smile:
That said, I just got the old library working with my ArduinoOnPC port, so I can now use it to display a GIF on rPi and Linux

I know that it’s totally pointless on its own since both platforms can display GIFS just fine, but it had value to me because it meant I can continue using the same exact cross platform code between ESP8266/ESP32/Teensy NeoMatrix/SmartMatrix/rpi-rgb-panel/SDL on linux :slight_smile:

Makes sense to run everything including GifDecoder on the ArduinoOnPC port.

BTW, there’s a new library for decoding GIFs that was just released, and people have been posting good things about it on Twitter. It’s unfortunate timing for me as I just put a decent amount of work into releasing the GifDecoder library. I probably won’t take a look at it until after SmartLED Shield for Teensy 4 is released, but it may become the default library I use with SmartMatrix if it’s faster has all the features I need, and is being maintained:

Louis, there is always something else, always something new :slight_smile:
First question is, does it matter? :slight_smile:
Is there anything wrong with the library you currently have? If not, don’t worry, be happy :slight_smile: