From 1f55c1345a2f44fb71f7ba9a8d76b2fccea51c09 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 11 Jun 2018 11:26:50 +0200 Subject: [PATCH] make sure the image is rotated as appropriate at third party intents --- .../com/simplemobiletools/camera/helpers/PhotoProcessor.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt index 41a26c6c..c77f2f80 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt @@ -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) }