From 389fd6ac9a082ca19f0339f2747a7f2e70c7dfe8 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Mon, 6 Sep 2021 20:19:50 +0300 Subject: [PATCH] Change if then else --- image_classifier/image_classifier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 120b702..98d0e2b 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -71,7 +71,9 @@ class image_classifier: self._log.debug(json.dumps(people, indent=2)) with open(file, 'rb') as image_file: self.exif_info = exif.Image(image_file) - if self.exif_info.has_exif: + if not self.exif_info.has_exif: + self._log.debug("No exif info in the image.") + else: # for key in dir(self.exif_info): # if not key.startswith("_"): # sys.stdout.write(f"{key}: ") @@ -80,8 +82,6 @@ class image_classifier: with open(file, 'wb') as new_image_file: new_image_file.write(self.exif_info.get_file()) self._log.debug(f"Updated file '{file}'.") - else: - self._log.debug("No exif info in the image.") # get date self._log.debug(f"File time stamp: {self.exif_info.get('Image timestamp')} (type: {type(self.exif_info.get('Image timestamp'))})") # move to destination