[BUG, ANDROID] width prop not works correctly when fixOrientation is enabled (#1629)

* add scan support for landscape mode

* refactoring

* fix errors

* fix rotation

* add landscape orientation support

* fix exception

* freeze preview image

From PR https://github.com/lwansbrough/react-native-camera/pull/919

* fix width prop
This commit is contained in:
Slavik 2018-06-12 00:00:46 +03:00 committed by João Guilherme Fidelis
parent 35d962668c
commit 4fdd548611

View File

@ -87,14 +87,14 @@ public class ResolveTakenPictureAsyncTask extends AsyncTask<Void, Void, Writable
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_UNDEFINED);
if (mOptions.hasKey("width")) {
mBitmap = resizeBitmap(mBitmap, mOptions.getInt("width"));
}
// Rotate the bitmap to the proper orientation if needed
if (mOptions.hasKey("fixOrientation") && mOptions.getBoolean("fixOrientation") && orientation != ExifInterface.ORIENTATION_UNDEFINED) {
mBitmap = rotateBitmap(mBitmap, getImageRotation(orientation));
}
if (mOptions.hasKey("width")) {
mBitmap = resizeBitmap(mBitmap, mOptions.getInt("width"));
}
if (mOptions.hasKey("mirrorImage") && mOptions.getBoolean("mirrorImage")) {
mBitmap = flipHorizontally(mBitmap);