Commit f5ed3d17 authored by nekk's avatar nekk
Browse files

[preview] interpret save_to_bufferv err correctly

First boolean returned by thumbnail.save_to_bufferv indicates whether
function succeeded, True being successful status.
Documentation is confusing about this, but inspecting
https://gitlab.gnome.org/GNOME/gdk-pixbuf/blob/2.42.2/gdk-pixbuf/gdk-pixbuf-io.c#L2845
makes it obvious that True means success.
parent 479c49a1
Pipeline #7725 failed with stage
......@@ -150,10 +150,9 @@ def create_thumbnail_with_pixbuf(data, size):
thumbnail = pixbuf.scale_simple(width,
height,
GdkPixbuf.InterpType.BILINEAR)
try:
_error, bytes_ = thumbnail.save_to_bufferv('png', [], [])
except GLib.Error as err:
log.warning('Saving pixbuf to buffer failed: %s', err)
ok, bytes_ = thumbnail.save_to_bufferv('png', [], [])
if not ok:
log.warning('saving pixbuf to buffer failed')
return None
return bytes_
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment