Change if then else

This commit is contained in:
Antonio J. Delgado 2021-09-06 20:19:50 +03:00
parent b9474cc682
commit 389fd6ac9a

View file

@ -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