Change if then else
This commit is contained in:
parent
b9474cc682
commit
389fd6ac9a
1 changed files with 3 additions and 3 deletions
|
@ -71,7 +71,9 @@ class image_classifier:
|
||||||
self._log.debug(json.dumps(people, indent=2))
|
self._log.debug(json.dumps(people, indent=2))
|
||||||
with open(file, 'rb') as image_file:
|
with open(file, 'rb') as image_file:
|
||||||
self.exif_info = exif.Image(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):
|
# for key in dir(self.exif_info):
|
||||||
# if not key.startswith("_"):
|
# if not key.startswith("_"):
|
||||||
# sys.stdout.write(f"{key}: ")
|
# sys.stdout.write(f"{key}: ")
|
||||||
|
@ -80,8 +82,6 @@ class image_classifier:
|
||||||
with open(file, 'wb') as new_image_file:
|
with open(file, 'wb') as new_image_file:
|
||||||
new_image_file.write(self.exif_info.get_file())
|
new_image_file.write(self.exif_info.get_file())
|
||||||
self._log.debug(f"Updated file '{file}'.")
|
self._log.debug(f"Updated file '{file}'.")
|
||||||
else:
|
|
||||||
self._log.debug("No exif info in the image.")
|
|
||||||
# get date
|
# get date
|
||||||
self._log.debug(f"File time stamp: {self.exif_info.get('Image timestamp')} (type: {type(self.exif_info.get('Image timestamp'))})")
|
self._log.debug(f"File time stamp: {self.exif_info.get('Image timestamp')} (type: {type(self.exif_info.get('Image timestamp'))})")
|
||||||
# move to destination
|
# move to destination
|
||||||
|
|
Loading…
Reference in a new issue