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