Always resize images
This commit is contained in:
@@ -24,9 +24,9 @@ import time
|
||||
|
||||
from gi.repository import Adw, Gio, GLib, GObject, Gtk
|
||||
|
||||
from .game_cover import GameCover
|
||||
from .create_dialog import create_dialog
|
||||
from .save_cover import save_cover
|
||||
from .game_cover import GameCover
|
||||
from .save_cover import resize_animation, save_cover
|
||||
from .save_game import save_game
|
||||
from .steamgriddb import SGDBSave
|
||||
|
||||
@@ -229,7 +229,11 @@ def create_details_window(parent_widget, game_id=None):
|
||||
|
||||
cover_button_delete_revealer.set_reveal_child(True)
|
||||
cover_deleted = True
|
||||
game_cover.new_pixbuf(path=path)
|
||||
game_cover.new_pixbuf(
|
||||
path=resize_animation(path)
|
||||
if str(path).rsplit(".", maxsplit=1)[-1] == "gif"
|
||||
else path
|
||||
)
|
||||
|
||||
def close_window(_widget, _callback=None):
|
||||
window.close()
|
||||
|
||||
@@ -31,7 +31,7 @@ def resize_animation(cover_path):
|
||||
frame.copy().resize((200, 300)) for frame in ImageSequence.Iterator(image)
|
||||
)
|
||||
|
||||
tmp_path = Path(Gio.File.new_tmp(None)[0].get_path())
|
||||
tmp_path = Path(Gio.File.new_tmp("XXXXXX.gif")[0].get_path())
|
||||
frames[0].save(
|
||||
tmp_path,
|
||||
format="gif",
|
||||
|
||||
Reference in New Issue
Block a user