From 3d315fcd39a016df1fdcb7d463669478f59e0b01 Mon Sep 17 00:00:00 2001 From: Woraphot Chokratanasombat Date: Tue, 19 Mar 2019 16:38:51 +0700 Subject: [PATCH] change(android): Remove unused code in cropAndResize() --- .../imageeditor/ImageEditorModule.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModule.java b/android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModule.java index dab5ba4..ccba0f4 100644 --- a/android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModule.java +++ b/android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModule.java @@ -325,18 +325,6 @@ private Bitmap cropAndResize( // Loading large bitmaps efficiently: // http://developer.android.com/training/displaying-bitmaps/load-bitmap.html - // Just decode the dimensions - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inJustDecodeBounds = true; - InputStream inputStream = openBitmapInputStream(); - try { - BitmapFactory.decodeStream(inputStream, null, options); - } finally { - if (inputStream != null) { - inputStream.close(); - } - } - // This uses scaling mode COVER // Where would the crop rect end up within the scaled bitmap? @@ -362,8 +350,7 @@ private Bitmap cropAndResize( // Decode the bitmap. We have to open the stream again, like in the example linked above. // Is there a way to just continue reading from the stream? outOptions.inSampleSize = getDecodeSampleSize(mWidth, mHeight, targetWidth, targetHeight); - options.inJustDecodeBounds = false; - inputStream = openBitmapInputStream(); + InputStream inputStream = openBitmapInputStream(); Bitmap bitmap; try {