val outputOptions = ImageCapture
.OutputFileOptions
.Builder(photoFile)
.setMetadata(ImageCapture.Metadata().also {
it.isReversedHorizontal = CameraSelector.LENS_FACING_FRONT == lensFacing
}).build()
imageCapture.takePicture(
outputOptions, cameraExecutor, object : ImageCapture.OnImageSavedCallback {
override fun onError(exc: ImageCaptureException) {
Log.e(TAG, "Photo capture failed: ${exc.message}", exc)
}
override fun onImageSaved(output: ImageCapture.OutputFileResults) {
val savedUri = output.savedUri ?: Uri.fromFile(photoFile)
Log.d(TAG, "Photo capture succeeded: $savedUri")
}
})
While View image its Working fine , But while Save in local its not Working Fine, its in Mirror. Kindly help on this
It's mirrored because you ask it to mirror it for the front camera. Simply remove this: