summaryrefslogtreecommitdiff
path: root/src/events/EventDirectoryItem.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-15 20:38:57 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-15 20:38:57 +0100
commitf1353e9ffd34db5f755c7da0b3f9c10638fbfd38 (patch)
treea1f2ab30332a6383b0677bfcc2aec687b98851d6 /src/events/EventDirectoryItem.vala
parentf8ca421bdacee8851965a4b802ada1d2366bdbc1 (diff)
parentede50c561ec9811704821a9ea0f04c3d6c20b5af (diff)
Merge branch 'release/0.26.4-1'0.26.4-1
Diffstat (limited to 'src/events/EventDirectoryItem.vala')
-rw-r--r--src/events/EventDirectoryItem.vala16
1 files changed, 15 insertions, 1 deletions
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);