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

Commit a162638e authored by tibbi's avatar tibbi
Browse files

make exif orientation copying optional

parent fec2bc5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 21
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '5.5.16'
        propVersionName = '5.5.17'
        kotlin_version = '1.3.11'
    }

+6 −3
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@ package com.simplemobiletools.commons.extensions

import android.media.ExifInterface

fun ExifInterface.copyTo(destination: ExifInterface) {
    val attributes = arrayOf(
fun ExifInterface.copyTo(destination: ExifInterface, copyOrientation: Boolean = true) {
    val attributes = arrayListOf(
            ExifInterface.TAG_APERTURE,
            ExifInterface.TAG_DATETIME,
            ExifInterface.TAG_DATETIME_DIGITIZED,
@@ -25,9 +25,12 @@ fun ExifInterface.copyTo(destination: ExifInterface) {
            ExifInterface.TAG_ISO_SPEED_RATINGS,
            ExifInterface.TAG_MAKE,
            ExifInterface.TAG_MODEL,
            ExifInterface.TAG_ORIENTATION,
            ExifInterface.TAG_WHITE_BALANCE)

    if (copyOrientation) {
        attributes.add(ExifInterface.TAG_ORIENTATION)
    }

    attributes.forEach {
        val value = getAttribute(it)
        if (value != null) {