catch an unparseable exception at parsing exif datetime
This commit is contained in:
parent
33fb52df0d
commit
b86656faae
1 changed files with 6 additions and 3 deletions
|
@ -126,9 +126,12 @@ class PropertiesDialog() {
|
|||
val exif = ExifInterface(path)
|
||||
exif.getAttribute(ExifInterface.TAG_DATETIME).let {
|
||||
if (it?.isNotEmpty() == true) {
|
||||
val simpleDateFormat = SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.getDefault())
|
||||
val dateTaken = simpleDateFormat.parse(it).time.formatLastModified()
|
||||
addProperty(R.string.date_taken, dateTaken)
|
||||
try {
|
||||
val simpleDateFormat = SimpleDateFormat("yyyy:MM:dd HH:mm:ss", Locale.getDefault())
|
||||
val dateTaken = simpleDateFormat.parse(it).time.formatLastModified()
|
||||
addProperty(R.string.date_taken, dateTaken)
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue