Add EXIF info again

This commit is contained in:
Antonio J. Delgado 2021-09-06 21:34:24 +03:00
parent 9beade82bd
commit 9a103ec965

View file

@ -71,7 +71,10 @@ class image_classifier:
self._log.debug(f"Found {len(people)} known people in the image.") self._log.debug(f"Found {len(people)} known people in the image.")
self._log.debug(json.dumps(people, indent=2)) self._log.debug(json.dumps(people, indent=2))
self.iptc_info = IPTCInfo(file, force=True) self.iptc_info = IPTCInfo(file, force=True)
print(self.iptc_info['keywords']) print(f"IPTC info: {self.iptc_info['keywords']}")
with open(file, 'rb') as image_file:
exif_info = exif.Image(image_file)
print(f"EXIF info: {dir(exif_info)}")
self.append_people(people) self.append_people(people)
self.iptc_info.save() self.iptc_info.save()
self._log.debug(f"Updated file '{file}'.") self._log.debug(f"Updated file '{file}'.")