Add check for no image
This commit is contained in:
parent
3a0cb54fa0
commit
660db24dec
1 changed files with 8 additions and 6 deletions
|
@ -66,12 +66,13 @@ class image_classifier:
|
|||
move it to the folder of the day'''
|
||||
self._log.debug(f"Processing file '{file}'...")
|
||||
people = self.find_faces(file)
|
||||
with open(file, 'rb') as image_file:
|
||||
exif_info = exif.Image(image_file)
|
||||
if exif_info.has_exif:
|
||||
print(json.dumps(exif_info, indent=2))
|
||||
# get date
|
||||
# move to destination
|
||||
if people:
|
||||
with open(file, 'rb') as image_file:
|
||||
exif_info = exif.Image(image_file)
|
||||
if exif_info.has_exif:
|
||||
print(json.dumps(exif_info, indent=2))
|
||||
# get date
|
||||
# move to destination
|
||||
|
||||
def load_known_people(self):
|
||||
known_people = list()
|
||||
|
@ -99,6 +100,7 @@ class image_classifier:
|
|||
names.append(known_person['name'])
|
||||
except PIL.UnidentifiedImageError as error:
|
||||
self._log.debug(f"File '{file}' don't seem to be an image.")
|
||||
return False
|
||||
return names
|
||||
|
||||
def _init_log(self):
|
||||
|
|
Loading…
Reference in a new issue