Resize images asynchronously in the edit dialog

This commit is contained in:
kramo
2023-05-06 10:07:35 +02:00
parent f8c06a9e4d
commit bd0386bcba
3 changed files with 50 additions and 31 deletions

View File

@@ -36,8 +36,7 @@ def resize_cover(win, cover_path=None, pixbuf=None):
with Image.open(cover_path) as image:
if getattr(image, "is_animated", False):
frames = tuple(
frame.copy().resize((200, 300))
for frame in ImageSequence.Iterator(image)
frame.resize((200, 300)) for frame in ImageSequence.Iterator(image)
)
tmp_path = Path(Gio.File.new_tmp("XXXXXX.gif")[0].get_path())