From f20e8b8b2a7f30d506a78f26ddc609600ed2ee16 Mon Sep 17 00:00:00 2001 From: Khaliulov Date: Thu, 28 Jul 2022 09:15:54 +0300 Subject: [PATCH] Fix preview PSD images (#5217) Fixed PSD image preview as modules in psd_tools module changed. https://psd-tools.readthedocs.io/en/latest/migration.html --- seahub/thumbnail/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/thumbnail/utils.py b/seahub/thumbnail/utils.py index 72cac1d71d..d05e9544a1 100644 --- a/seahub/thumbnail/utils.py +++ b/seahub/thumbnail/utils.py @@ -163,9 +163,9 @@ def create_psd_thumbnails(repo, file_id, path, size, thumbnail_file, file_size): inner_path = gen_inner_file_get_url(token, os.path.basename(path)) tmp_file = os.path.join(tempfile.gettempdir(), file_id) urlretrieve(inner_path, tmp_file) - psd = PSDImage.load(tmp_file) + psd = PSDImage.open(tmp_file) - merged_image = psd.as_PIL() + merged_image = psd.topil() merged_image.save(tmp_img_path) os.unlink(tmp_file) # remove origin psd file