Add check for error reading

This commit is contained in:
Antonio J. Delgado 2021-09-06 16:50:18 +03:00
parent fd93451903
commit d128e8844d

View file

@ -72,7 +72,8 @@ class image_classifier:
exif_info = exif.Image(image_file)
if exif_info.has_exif:
for key in exif_info.list_all():
print(f"{key}: {exif_info[key]}")
if key != 'cannot read a base/unknown IFD tag instance':
print(f"{key}: {exif_info[key]}")
else:
self._log.debug("No exif info in the image.")
# get date