use matrix transformation at landscape photos too

This commit is contained in:
tibbi 2019-09-03 11:09:18 +02:00
parent f73cb32db8
commit c2b042c5ac

View File

@ -93,7 +93,8 @@ class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val deviceOr
image = rotate(image, totalRotation)
}
if (isUsingFrontCamera && activity.config.flipPhotos) {
if (isUsingFrontCamera) {
if (activity.config.flipPhotos || deviceRot != 0) {
val matrix = Matrix()
val isPortrait = image.width < image.height
matrix.preScale(if (isPortrait) -1f else 1f, if (isPortrait) 1f else -1f)
@ -104,6 +105,7 @@ class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val deviceOr
activity.toast(R.string.out_of_memory_error)
}
}
}
try {
image.compress(Bitmap.CompressFormat.JPEG, activity.config.photoQuality, fos)