From 0d1d51ab612b22ad6439000590b512502d18a791 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 16 May 2021 19:25:07 +0200 Subject: fall back to "Image DateTime" if DateTimeOriginal is unavailable --- bin/pyggle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3