add flipping horizontally and photo quality

This commit is contained in:
darthpaul 2022-06-25 17:14:49 +01:00
parent c398370446
commit 1f3dd341d0

View File

@ -233,6 +233,7 @@ class CameraXPreview(
return ImageCapture.Builder() return ImageCapture.Builder()
.setCaptureMode(CAPTURE_MODE_MAXIMIZE_QUALITY) .setCaptureMode(CAPTURE_MODE_MAXIMIZE_QUALITY)
.setFlashMode(flashMode) .setFlashMode(flashMode)
.setJpegQuality(config.photoQuality)
.setTargetAspectRatio(aspectRatio) .setTargetAspectRatio(aspectRatio)
.setTargetRotation(rotation) .setTargetRotation(rotation)
.build() .build()
@ -305,7 +306,7 @@ class CameraXPreview(
val imageCapture = imageCapture ?: throw IllegalStateException("Camera initialization failed.") val imageCapture = imageCapture ?: throw IllegalStateException("Camera initialization failed.")
val metadata = Metadata().apply { val metadata = Metadata().apply {
isReversedHorizontal = frontCameraInUse isReversedHorizontal = config.flipPhotos
} }
val contentValues = ContentValues().apply { val contentValues = ContentValues().apply {