From 5237e3b7ccf3afc925924ed7e8f2a62b7cdf3885 Mon Sep 17 00:00:00 2001 From: Mathias Markl Date: Thu, 26 Jul 2018 14:39:10 +0200 Subject: [PATCH] update --- muk_thumbnails/service/thumbnail.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/muk_thumbnails/service/thumbnail.py b/muk_thumbnails/service/thumbnail.py index 64ec5c0..dcdda3f 100644 --- a/muk_thumbnails/service/thumbnail.py +++ b/muk_thumbnails/service/thumbnail.py @@ -19,6 +19,7 @@ import os import io +import sys import PyPDF2 import base64 import shutil @@ -62,7 +63,7 @@ FORMATS = [ ] VIDEO_IMPORTS = [ - "mp4", "ogv", "webm" + "mp4", "mov", "wav", "avi", "mpg", "flv", "wmv", "webm" ] PDF_IMPORTS = [ @@ -202,6 +203,9 @@ def create_thumbnail(binary, mimetype=None, filename=None, export="binary", form except Exception as e: sys.exc_clear() finally: - shutil.rmtree(tmp_dir) + try: + shutil.rmtree(tmp_dir) + except PermissionError: + _logger.warn("Temporary directory could not be deleted.") else: raise ValueError("No output could be generated.") \ No newline at end of file