From 2492891f112caac6076ce49721d9d5d78a152c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 12 Nov 2017 15:53:58 +0100 Subject: New upstream version 0.26.4 --- src/events/EventDirectoryItem.vala | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/events/EventDirectoryItem.vala') diff --git a/src/events/EventDirectoryItem.vala b/src/events/EventDirectoryItem.vala index f316de7..f75a8e0 100644 --- a/src/events/EventDirectoryItem.vala +++ b/src/events/EventDirectoryItem.vala @@ -54,7 +54,21 @@ class EventDirectoryItem : CheckerboardItem { // scale and crop the center square of the media private static Gdk.Pixbuf get_paul_lynde(MediaSource media, Gdk.Rectangle paul_lynde) throws Error { - Gdk.Pixbuf pixbuf = media.get_preview_pixbuf(squared_scaling); + Gdk.Pixbuf pixbuf; + + try { + pixbuf = media.get_preview_pixbuf(squared_scaling); + } catch (Error error) { + ThumbnailCache.fetch_async_scaled(media, ThumbnailCache.Size.BIG, + new Dimensions(ThumbnailCache.Size.BIG, ThumbnailCache.Size.BIG), + ThumbnailCache.DEFAULT_INTERP, () => {}); + if (media is LibraryPhoto) { + LibraryPhoto photo = (LibraryPhoto) media; + pixbuf = photo.get_pixbuf(squared_scaling); + } else { + throw error; + } + } Dimensions thumbnail_dimensions = Dimensions.for_pixbuf(pixbuf); -- cgit v1.2.3