Skip to content

Commit 6675372

Browse files
guhungryTrancever
authored andcommitted
fix(android): remove unused code in cropAndResize() (#20)
1 parent 787dbb4 commit 6675372

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

android/src/main/java/com/reactnativecommunity/imageeditor/ImageEditorModule.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -325,18 +325,6 @@ private Bitmap cropAndResize(
325325
// Loading large bitmaps efficiently:
326326
// http://developer.android.com/training/displaying-bitmaps/load-bitmap.html
327327

328-
// Just decode the dimensions
329-
BitmapFactory.Options options = new BitmapFactory.Options();
330-
options.inJustDecodeBounds = true;
331-
InputStream inputStream = openBitmapInputStream();
332-
try {
333-
BitmapFactory.decodeStream(inputStream, null, options);
334-
} finally {
335-
if (inputStream != null) {
336-
inputStream.close();
337-
}
338-
}
339-
340328
// This uses scaling mode COVER
341329

342330
// Where would the crop rect end up within the scaled bitmap?
@@ -362,8 +350,7 @@ private Bitmap cropAndResize(
362350
// Decode the bitmap. We have to open the stream again, like in the example linked above.
363351
// Is there a way to just continue reading from the stream?
364352
outOptions.inSampleSize = getDecodeSampleSize(mWidth, mHeight, targetWidth, targetHeight);
365-
options.inJustDecodeBounds = false;
366-
inputStream = openBitmapInputStream();
353+
InputStream inputStream = openBitmapInputStream();
367354

368355
Bitmap bitmap;
369356
try {

0 commit comments

Comments
 (0)