1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +00:00

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
This commit is contained in:
Khaliulov
2022-07-28 09:15:54 +03:00
committed by GitHub
parent e96b0c0bce
commit f20e8b8b2a

View File

@@ -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)) inner_path = gen_inner_file_get_url(token, os.path.basename(path))
tmp_file = os.path.join(tempfile.gettempdir(), file_id) tmp_file = os.path.join(tempfile.gettempdir(), file_id)
urlretrieve(inner_path, tmp_file) 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) merged_image.save(tmp_img_path)
os.unlink(tmp_file) # remove origin psd file os.unlink(tmp_file) # remove origin psd file