Skip to content

Commit

Permalink
Migrated exifInterface to androidx exif.interface
Browse files Browse the repository at this point in the history
  • Loading branch information
neeldoshii committed Dec 8, 2024
1 parent cc74707 commit 5125928
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ dependencies {
implementation "androidx.browser:browser:1.3.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.exifinterface:exifinterface:1.3.2"
implementation 'androidx.exifinterface:exifinterface:1.3.7'
implementation "androidx.core:core-ktx:$CORE_KTX_VERSION"
implementation 'com.simplecityapps:recyclerview-fastscroll:2.0.1'

Expand Down
15 changes: 6 additions & 9 deletions app/src/main/java/fr/free/nrw/commons/edit/EditActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import android.animation.ValueAnimator
import android.content.Intent
import android.graphics.BitmapFactory
import android.graphics.Matrix
//noinspection ExifInterface TODO Issue : #5994
import android.media.ExifInterface
import android.os.Bundle
import android.view.animation.AccelerateDecelerateInterpolator
import android.widget.ImageView
Expand All @@ -16,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.graphics.rotationMatrix
import androidx.core.graphics.scaleMatrix
import androidx.core.net.toUri
import androidx.exifinterface.media.ExifInterface
import androidx.lifecycle.ViewModelProvider
import fr.free.nrw.commons.databinding.ActivityEditBinding
import timber.log.Timber
Expand Down Expand Up @@ -45,12 +44,10 @@ class EditActivity : AppCompatActivity() {
imageUri = intent.getStringExtra("image") ?: ""
vm = ViewModelProvider(this)[EditViewModel::class.java]
val sourceExif = imageUri.toUri().path?.let { ExifInterface(it) }
//TODO(Deprecation : 'TAG_APERTURE: String' is deprecated. Deprecated in Java) Issue : #6001
// TODO(Deprecation : 'TAG_ISO: String' is deprecated. Deprecated in Java) Issue : #6001
@Suppress("DEPRECATION")

val exifTags =
arrayOf(
ExifInterface.TAG_APERTURE,
ExifInterface.TAG_F_NUMBER,
ExifInterface.TAG_DATETIME,
ExifInterface.TAG_EXPOSURE_TIME,
ExifInterface.TAG_FLASH,
Expand All @@ -66,13 +63,13 @@ class EditActivity : AppCompatActivity() {
ExifInterface.TAG_GPS_TIMESTAMP,
ExifInterface.TAG_IMAGE_LENGTH,
ExifInterface.TAG_IMAGE_WIDTH,
ExifInterface.TAG_ISO,
ExifInterface.TAG_PHOTOGRAPHIC_SENSITIVITY,
ExifInterface.TAG_MAKE,
ExifInterface.TAG_MODEL,
ExifInterface.TAG_ORIENTATION,
ExifInterface.TAG_WHITE_BALANCE,
ExifInterface.WHITEBALANCE_AUTO,
ExifInterface.WHITEBALANCE_MANUAL,
ExifInterface.WHITE_BALANCE_AUTO,
ExifInterface.WHITE_BALANCE_MANUAL,
)
for (tag in exifTags) {
val attribute = sourceExif?.getAttribute(tag.toString())
Expand Down

0 comments on commit 5125928

Please sign in to comment.