mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-14 07:46:00 +01:00
use matrix transformation at landscape photos too
This commit is contained in:
parent
f73cb32db8
commit
c2b042c5ac
@ -93,15 +93,17 @@ class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val deviceOr
|
||||
image = rotate(image, totalRotation)
|
||||
}
|
||||
|
||||
if (isUsingFrontCamera && activity.config.flipPhotos) {
|
||||
val matrix = Matrix()
|
||||
val isPortrait = image.width < image.height
|
||||
matrix.preScale(if (isPortrait) -1f else 1f, if (isPortrait) 1f else -1f)
|
||||
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)
|
||||
|
||||
try {
|
||||
image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
activity.toast(R.string.out_of_memory_error)
|
||||
try {
|
||||
image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false)
|
||||
} catch (e: OutOfMemoryError) {
|
||||
activity.toast(R.string.out_of_memory_error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user