summaryrefslogtreecommitdiff
path: root/src/events/EventDirectoryItem.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 16:48:02 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-11-12 16:48:02 +0100
commitabdaad68fb94e2d61448a6dfc14847df8a2c32b9 (patch)
tree26855c5dd3bfffdbf319d5ba4a38223a28de3e7c /src/events/EventDirectoryItem.vala
parent0f67b3cc674377559e66c5a6729fd499049a992f (diff)
parentdd7f98a232efe86f6e6055119c9414a0f9d9e67b (diff)
Merge branch 'feature/upstream' into develop
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);