The other week, I had a feature request on one of my open-source Python libraries:
https://github.com/waikato-datamining/python-image-complete
For the last few years, I’ve doing a lot of image processing using deep learning. One way of interfacing with my docker images is via file-polling: look for image files in a directory, process them and spit them out in another directory. Now, on Linux you can have the problem that an image is still being written when the docker process is trying to read it and then fails to load it properly. In order not to load images that are not yet complete, I’m checking the EOF markers in the images whether I can load them or not. In order to avoid copy/pasting the code around my ever growing list of maintained docker images, I decided to push out a little library to PyPI, making it easy to install via pip. Of course, always in the hope that other people might find it useful, too.
Well, here we are, four years later and somebody DID actually find it useful!
It was easy enough adding the feature request for WebP files. This (sort of) wider application of the library also unearthed short-comings/restrictions. Apparently, it happens every now and then that images have junk data after the actual data. My library was operating in a strict mode and didn’t allow any of that. Apart from adding a lenient mode, I also extended it to support processing bytes-like/BytesIO data structures, rather than just files.
All in all a fruitful interaction! 🙂