summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-05-16 19:25:07 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-05-16 19:25:07 +0200
commit0d1d51ab612b22ad6439000590b512502d18a791 (patch)
treec409613fe920e09063e1ff377044e007713ae6b8
parentae3883ee92ac931e710de553c12240ad3283dfa0 (diff)
fall back to "Image DateTime" if DateTimeOriginal is unavailable
-rwxr-xr-xbin/pyggle7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/pyggle b/bin/pyggle
index c5d97f7..7b1dfb7 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -158,7 +158,12 @@ class Thumbnail:
self.exif_tag["Image DateTimeOriginal"].values, "%Y:%m:%d %H:%M:%S"
)
except (KeyError, ValueError):
- pass
+ try:
+ dt = datetime.strptime(
+ self.exif_tag["Image DateTime"].values, "%Y:%m:%d %H:%M:%S"
+ )
+ except (KeyError, ValueError):
+ pass
if dt:
self.exif_dt = dt