diff options
author | steckbrief <steckbrief@chefmail.de> | 2018-02-26 20:52:16 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2018-02-26 20:52:16 +0100 |
commit | 010eb44ad971ad9e77b555179d70b6e43d1dec80 (patch) | |
tree | 37cb5ed599b1843f5a4090b5c1777c8f4da966a0 | |
parent | 1b07917a2684d58cdb832fac84dafec1f9088486 (diff) |
fixes FS#257 - Fix policy 31 violation
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java index eee18cc9..a741dfbd 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/ImageUtil.java @@ -350,12 +350,14 @@ public final class ImageUtil { public static int calcSampleSize(Uri image, int size) throws FileNotFoundException { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; - Bitmap bmp = BitmapFactory.decodeStream(StreamUtil.openInputStreamFromContentResolver(image), null, options); + InputStream bmpInputStream = StreamUtil.openInputStreamFromContentResolver(image); + Bitmap bmp = BitmapFactory.decodeStream(bmpInputStream, null, options); int height = options.outHeight; int width = options.outWidth; if (null != bmp) { bmp.recycle(); } + StreamUtil.close(bmpInputStream); return calcSampleSize(width, height, size); } |