Fix Flatpak source for .svgs

This commit is contained in:
kramo
2023-06-30 22:33:21 +02:00
parent 07960182c7
commit 8efb1c6c5e
2 changed files with 27 additions and 6 deletions

View File

@@ -21,7 +21,7 @@
from pathlib import Path
from shutil import copyfile
from gi.repository import Gio
from gi.repository import Gdk, Gio, GLib
from PIL import Image, ImageSequence, UnidentifiedImageError
from src import shared
@@ -63,7 +63,13 @@ def resize_cover(cover_path=None, pixbuf=None):
else "webp",
)
except UnidentifiedImageError:
return None
try:
Gdk.Texture.new_from_filename(str(cover_path)).save_to_tiff(
tmp_path := Gio.File.new_tmp("XXXXXX.tiff")[0].get_path()
)
return resize_cover(tmp_path)
except GLib.GError:
return None
return tmp_path