Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 824046d8 authored by tibbi's avatar tibbi
Browse files

lets make saveExifRotation a context extension

parent eb298803
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ buildscript {
        propMinSdkVersion = 16
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '3.17.22'
        propVersionName = '3.17.23'
        kotlin_version = '1.2.31'
        support_libs = '27.1.0'
    }
+1 −1
Original line number Diff line number Diff line
@@ -513,7 +513,7 @@ fun Context.saveImageRotation(path: String, degrees: Int): Boolean {
    return false
}

private fun saveExifRotation(exif: ExifInterface, degrees: Int) {
fun Context.saveExifRotation(exif: ExifInterface, degrees: Int) {
    val orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL)
    val orientationDegrees = (orientation.degreesFromOrientation() + degrees) % 360
    exif.setAttribute(ExifInterface.TAG_ORIENTATION, orientationDegrees.orientationFromDegrees())