aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/persistance
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-01-03 22:48:47 +0100
committerChristian Schneppe <christian@pix-art.de>2019-01-03 22:48:47 +0100
commit76c8a67ade32affffef1da61dd2f9454f730984e (patch)
tree2af6ef3035f32960fa11f6e5caeaa28c8a3c3b90 /src/main/java/de/pixart/messenger/persistance
parent5f79aa085d74dadabd475cfc51e4a214ccfaf0ad (diff)
introduced 'original' as video and image quality and do not ignorer error
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 2703f0538..705e5489b 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -294,9 +294,12 @@ public class FileBackend {
}
File file = new File(path);
long size = file.length();
- if (size == 0 || size >= mXmppConnectionService.getCompressImageSizePreference()) {
+ if ((size == 0 || size >= mXmppConnectionService.getCompressImageSizePreference()) && mXmppConnectionService.getCompressImageSizePreference() != 0) {
return false;
}
+ if (mXmppConnectionService.getCompressImageResolutionPreference() == 0 && mXmppConnectionService.getCompressImageSizePreference() == 0 ) {
+ return true;
+ }
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
try {
@@ -450,7 +453,7 @@ public class FileBackend {
throw new FileCopyException(R.string.error_compressing_image);
}
os.flush();
- targetSizeReached = file.length() <= mXmppConnectionService.getCompressImageSizePreference() || quality <= 50;
+ targetSizeReached = (file.length() <= mXmppConnectionService.getCompressImageSizePreference() && mXmppConnectionService.getCompressImageSizePreference() != 0) || quality <= 50;
quality -= 5;
}
scaledBitmap.recycle();