mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-01-14 15:55:53 +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)
|
image = rotate(image, totalRotation)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUsingFrontCamera && activity.config.flipPhotos) {
|
if (isUsingFrontCamera) {
|
||||||
val matrix = Matrix()
|
if (activity.config.flipPhotos || deviceRot != 0) {
|
||||||
val isPortrait = image.width < image.height
|
val matrix = Matrix()
|
||||||
matrix.preScale(if (isPortrait) -1f else 1f, if (isPortrait) 1f else -1f)
|
val isPortrait = image.width < image.height
|
||||||
|
matrix.preScale(if (isPortrait) -1f else 1f, if (isPortrait) 1f else -1f)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false)
|
image = Bitmap.createBitmap(image, 0, 0, image.width, image.height, matrix, false)
|
||||||
} catch (e: OutOfMemoryError) {
|
} catch (e: OutOfMemoryError) {
|
||||||
activity.toast(R.string.out_of_memory_error)
|
activity.toast(R.string.out_of_memory_error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user