diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-10-29 19:38:07 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-10-29 19:38:07 +0100 |
commit | ddffbeee3ccf9eeef94586eed299291b0e12fc46 (patch) | |
tree | 545f507e51b7ddd370f749ea7d5b711ce1568895 /src/main/java/de/pixart/messenger/persistance/FileBackend.java | |
parent | 6b861d9eb8efa77d649e5899decdf21cbdf1d2ed (diff) |
video processing: pick smaller file after transcoding. Do not transcode files smaller 1 MiB
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 4 |
1 files changed, 2 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 f942ba8c5..43f362993 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -153,7 +153,7 @@ public class FileBackend { } } - private static long getFileSize(Context context, Uri uri) { + public static long getFileSize(Context context, Uri uri) { try { final Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { @@ -273,7 +273,7 @@ public class FileBackend { options.inJustDecodeBounds = true; try { BitmapFactory.decodeStream(mXmppConnectionService.getContentResolver().openInputStream(uri), null, options); - if (options == null || options.outMimeType == null || options.outHeight <= 0 || options.outWidth <= 0) { + if (options.outMimeType == null || options.outHeight <= 0 || options.outWidth <= 0) { return false; } return (options.outWidth <= mXmppConnectionService.getCompressImageResolutionPreference() && options.outHeight <= mXmppConnectionService.getCompressImageResolutionPreference() && options.outMimeType.contains(Config.IMAGE_FORMAT.name().toLowerCase())); |