I'm receiving files from an input via a POST request. I'd like to take to those create a GIF from them and store it directly in a sqlite database.
I have found various ways in python to create GIFs out of images and save them to the file system like the one here
VALID_EXTENSIONS = ('png', 'jpg')
def createGIF(data, duration=0.2):
images = []
for d in data:
images.append(imageio.imread(d))
output_file = 'Gif-%s.gif' % datetime.datetime.now().strftime('%Y-%M-%d-%H-%M-%S')
imageio.mimsave(output_file, images, duration=duration)
but I was not able to find a way of creating the GIF and either store it into variable or save it into the DB directly. Is there any way of creating a GIF and not have to save it to disk first before putting it in a DB?