diff --git a/cista/preview.py b/cista/preview.py index cb541e3..0a82d2e 100644 --- a/cista/preview.py +++ b/cista/preview.py @@ -1,4 +1,5 @@ import asyncio +import gc import io import mimetypes import urllib.parse @@ -109,5 +110,7 @@ def process_video(path, *, maxsize, quality): img = img.rotate(rot, expand=True) img.save(imgdata, format="webp", quality=quality, method=4) del img - - return imgdata.getvalue() + ret = imgdata.getvalue() + del imgdata + gc.collect() + return ret