aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-05-21 20:27:53 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-05-21 20:27:53 +0200
commit6d90a5cd57f7460f99381da212c667de04c73036 (patch)
tree9d799d0438c94db1f1d19331e854c5899a2bfaca /src
parent0de9d57420e74282b09b7963017137fd32c98876 (diff)
further improvment trying to deal with large images
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/persistance/FileBackend.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java
index 7bddc55f..9d64c45f 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);
+ }
}
}