From 6aa2ef112e16c53771dd1b070a1c620541216bbd Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Sun, 19 Dec 2021 21:19:25 +0300 Subject: [PATCH] fix: image flips after stripping orientation exif --- util/import_photos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/import_photos.py b/util/import_photos.py index 906430d..b8d0869 100644 --- a/util/import_photos.py +++ b/util/import_photos.py @@ -47,6 +47,10 @@ def process_pictures(): (k[5:], v) for k, v in image.metadata.items() if k.startswith("exif:") ) with image.clone() as cloned: + # adjust an image so that its orientation is suitable for viewing + # (i.e. top-left orientation) by checking EXIF data + cloned.auto_orient() + # strip an image of all profiles and comments cloned.strip() # Q: may damage icc, do we allow that or use smh else? cloned.transform(resize="50%") # Q: what do we want here? # move them to the processed folder