From 467f603ba1102ca1af521ddb332ced9b26c322f8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 5 Sep 2017 09:53:51 +0200 Subject: [PATCH] rename rotation to orientation at exif changes --- .../gallery/activities/ViewPagerActivity.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index bbb805353..639cecda8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -383,15 +383,15 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun rotateByExif() { val exif = ExifInterface(getCurrentPath()) - val rotation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) - val newRotation = getNewRotation(rotation) - exif.setAttribute(ExifInterface.TAG_ORIENTATION, newRotation) + val orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL) + val newOrientation = getNewOrientation(orientation) + exif.setAttribute(ExifInterface.TAG_ORIENTATION, newOrientation) exif.saveAttributes() File(getCurrentPath()).setLastModified(System.currentTimeMillis()) (getCurrentFragment() as? PhotoFragment)?.refreshBitmap() } - private fun getNewRotation(rotation: Int): String { + private fun getNewOrientation(rotation: Int): String { return when (rotation) { ExifInterface.ORIENTATION_ROTATE_90 -> ExifInterface.ORIENTATION_ROTATE_180 ExifInterface.ORIENTATION_ROTATE_180 -> ExifInterface.ORIENTATION_ROTATE_270