From 8ce627ee748c1c275bc0af0d1cada95c601d6af1 Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Tue, 6 Jul 2021 20:13:11 +0200 Subject: [PATCH] [preview] Catch errors when closing pixbuf loader --- url_image_preview/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url_image_preview/utils.py b/url_image_preview/utils.py index a8ec495..425b69f 100644 --- a/url_image_preview/utils.py +++ b/url_image_preview/utils.py @@ -136,11 +136,11 @@ def create_thumbnail_with_pixbuf(data, size): loader = GdkPixbuf.PixbufLoader() try: loader.write(data) + loader.close() except GLib.Error as error: log.warning('making pixbuf failed: %s', error) return None - loader.close() pixbuf = loader.get_pixbuf() if size > pixbuf.get_width() and size > pixbuf.get_height():