From 6d90a5cd57f7460f99381da212c667de04c73036 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 21 May 2014 20:27:53 +0200 Subject: [PATCH] further improvment trying to deal with large images --- src/eu/siacs/conversations/persistance/FileBackend.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java index 7bddc55f7..9d64c45fd 100644 --- a/src/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/eu/siacs/conversations/persistance/FileBackend.java @@ -135,7 +135,12 @@ public class FileBackend { throw new ImageCopyException( R.string.error_security_exception_during_image_copy); } catch (OutOfMemoryError e) { - return copyImageToPrivateStorage(message, image, sampleSize++); + ++sampleSize; + if (sampleSize<=3) { + return copyImageToPrivateStorage(message, image, sampleSize); + } else { + throw new ImageCopyException(R.string.error_out_of_memory); + } } }