Commit 8b7d7a8b authored by Suhas's avatar Suhas Committed by Alexandru Băluț

medialibrary: Create the image thumbnail out of the image

Previously, thumbnails for images were simply
falling back to image-x-generic

Fixes T7668
Reviewed-by: Alexandru Băluț's avatarAlex Băluț <>
Differential Revision:
parent 67794ff6
......@@ -213,7 +213,22 @@ class AssetThumbnail(Loggable):
small_thumb, large_thumb = self.__get_thumbnails_from_xdg_cache(real_uri)
if not small_thumb:
if self.__asset.is_image():
small_thumb, large_thumb = self.__get_icons("image-x-generic")
path = Gst.uri_get_location(real_uri)
pixbuf = GdkPixbuf.Pixbuf.new_from_file(path)
width = pixbuf.props.width
height = pixbuf.props.height
small_thumb = pixbuf.scale_simple(
SMALL_THUMB_WIDTH * height / width,
large_thumb = pixbuf.scale_simple(
LARGE_THUMB_WIDTH * height / width,
except GLib.Error as error:
self.debug("Failed loading thumbnail because: %s", error)
small_thumb, large_thumb = self.__get_icons("image-x-generic")
# Build or reuse a ThumbnailCache.
thumb_cache = ThumbnailCache.get(self.__asset)
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