make sure the image is rotated as appropriate at third party intents

This commit is contained in:
tibbi 2018-06-11 11:26:50 +02:00
parent ff85805636
commit 1f55c1345a
1 changed files with 4 additions and 1 deletions

View File

@ -74,7 +74,10 @@ class PhotoProcessor(val activity: MainActivity, val saveUri: Uri?, val deviceOr
val deviceRot = compensateDeviceRotation(deviceOrientation, isUsingFrontCamera)
var image = BitmapFactory.decodeByteArray(data, 0, data.size)
val totalRotation = (imageRot + deviceRot + previewRotation) % 360
if (activity.isPathOnSD(path) && !isNougatPlus()) {
if (path.startsWith(activity.internalStoragePath) || isNougatPlus()) {
// do not rotate the image itself in these cases, rotate it by exif only
} else {
// make sure the image itself is rotated at third party intents
image = rotate(image, totalRotation)
}