Read file

This commit is contained in:
Antonio J. Delgado 2021-09-06 21:52:03 +03:00
parent e4116950ba
commit 15d000f614

View file

@ -69,7 +69,9 @@ class image_classifier:
if people:
self._log.debug(f"Found {len(people)} known people in the image.")
self._log.debug(json.dumps(people, indent=2))
self.metadata = pyexiv2.ImageData(file)
with open(file, 'bw') as image_file:
content = image_file.read()
self.metadata = pyexiv2.ImageData(content)
self.metadata.read()
print(f"IPTC keys: {self.metadata.iptc_keys}")
print(f"EXIF keys: {self.metadata.exif_keys}")