From 12e3f615746a0fe2d641b37df4e87bd326b78002 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 16 Nov 2017 14:56:14 +0100 Subject: [PATCH] catch outofmemory errors at gif loading --- .../kotlin/com/simplemobiletools/gallery/extensions/activity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt index 143a5a4e4..9910aa225 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -160,6 +160,8 @@ fun Activity.loadImage(path: String, target: MySquareImageView, horizontalScroll target.scaleType = if (cropThumbnails) ImageView.ScaleType.CENTER_CROP else ImageView.ScaleType.FIT_CENTER } catch (e: Exception) { loadJpg(path, target, cropThumbnails) + } catch (e: OutOfMemoryError) { + loadJpg(path, target, cropThumbnails) } } }