From af3b4e46f03b0ec7d5fcbe8f83008b2c7a266681 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 12 Sep 2019 20:21:25 +0200 Subject: [PATCH] properly fetch the Date Taken value on Android 10 --- app/build.gradle | 2 +- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index af5a3243d..057e9bfac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.17.13' + implementation 'com.simplemobiletools:commons:5.17.16' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index c87341fca..96bb4e727 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -304,7 +304,9 @@ class MediaFetcher(val context: Context) { try { val path = cursor.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) val dateTaken = cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) - dateTakens[path] = dateTaken + if (dateTaken != 0L) { + dateTakens[path] = dateTaken + } } catch (e: Exception) { } } while (cursor.moveToNext())