Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--url_image_preview/utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/url_image_preview/utils.py b/url_image_preview/utils.py
index 2cd515f..a8ec495 100644
--- a/url_image_preview/utils.py
+++ b/url_image_preview/utils.py
@@ -150,9 +150,10 @@ def create_thumbnail_with_pixbuf(data, size):
thumbnail = pixbuf.scale_simple(width,
height,
GdkPixbuf.InterpType.BILINEAR)
- has_error, bytes_ = thumbnail.save_to_bufferv('png', [], [])
- if has_error:
- log.warning('saving pixbuf to buffer failed')
+ try:
+ _error, bytes_ = thumbnail.save_to_bufferv('png', [], [])
+ except GLib.Error as err:
+ log.warning('Saving pixbuf to buffer failed: %s', err)
return None
return bytes_