From 04cf364b4937f9971b98e90b4ac5ae25b1222445 Mon Sep 17 00:00:00 2001 From: Roberto Morelos Date: Mon, 6 Nov 2017 16:18:28 -0600 Subject: [PATCH] Reduced memory usage by recycling the bitmap (#93) --- .../src/main/utils/com/otaliastudios/cameraview/CropHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java index 2808e39c..7273922e 100644 --- a/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java +++ b/cameraview/src/main/utils/com/otaliastudios/cameraview/CropHelper.java @@ -27,6 +27,7 @@ class CropHelper { image.recycle(); ByteArrayOutputStream out = new ByteArrayOutputStream(); crop.compress(Bitmap.CompressFormat.JPEG, jpegCompression, out); + crop.recycle(); return out.toByteArray(); }