diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt index e6855203..7da596c7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt @@ -84,6 +84,7 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId } else { matrix.preScale(-1f, 1f) } + try { image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false) } catch (e: OutOfMemoryError) { diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt index b32a917f..65f72d02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt @@ -205,7 +205,6 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan }.sortedByDescending { it.width * it.height } if (index == -1) { - mActivity?.toast(R.string.setting_resolution_failed) index = getDefaultFullscreenResolution(resolutions) ?: 0 } @@ -292,12 +291,15 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan if (mCanTakePicture) { val selectedResolution = getSelectedResolution() mParameters!!.setPictureSize(selectedResolution.width, selectedResolution.height) + val pictureSize = mParameters!!.pictureSize + if (selectedResolution.width != pictureSize.width || selectedResolution.height != pictureSize.height) { + mActivity!!.toast(R.string.setting_resolution_failed) + } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { mCamera!!.enableShutterSound(false) } - mRotationAtCapture = mActivity!!.mLastHandledOrientation updateCameraParameters() isWaitingForTakePictureCallback = true