Table of Contents

Quick project: filtering out corrupted gifs [python]

Hi guys! So here is another “quick project” article, this time about filtering valid vs corrupted gif images from a given folder. The context is simple: I've been downloading a collection of gifs as a torrent, but unfortunately that download is stuck at 92% so I don't think I will ever get the full collection. Still some of the files in there are already completely downloaded, so technically I should be able to try to read each of those gif files, and then only keep the valid ones 😉

As usual now, I'm going to build this as a new python utility in my NervProj framework, let's get started!

Preparing the initial version of the utility component

Note that I'm not changing the CWD for the “gifs” script above: I want to be able to run that script from inside the input folder I need to process actually.

Writting the main function

I didn't even bother using the command line arguments '--input' and '--output' I defined above: default behavior is OK for my usage