fix #909, rely on date_time_original before date_time

This commit is contained in:
tibbi 2018-08-20 22:43:07 +02:00
parent 88d4cba636
commit 7fc8d4a3d8
2 changed files with 3 additions and 2 deletions

View file

@ -47,7 +47,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:4.6.13'
implementation 'com.simplemobiletools:commons:4.6.14'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -295,7 +295,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
val mediumDao = activity.galleryDB.MediumDao()
val paths = getSelectedPaths()
for (path in paths) {
val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue
val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME_ORIGINAL)
?: ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME)
val format = "yyyy:MM:dd kk:mm:ss"
val formatter = SimpleDateFormat(format, Locale.getDefault())
val timestamp = formatter.parse(dateTime).time