change to iptc

This commit is contained in:
Antonio J. Delgado 2021-09-06 21:15:01 +03:00
parent 3db5a8502c
commit b443483ff4
2 changed files with 5 additions and 1 deletions

View file

@ -14,6 +14,7 @@ import click_config_file
from logging.handlers import SysLogHandler from logging.handlers import SysLogHandler
import face_recognition import face_recognition
import exif import exif
from iptcinfo3 import IPTCInfo
import PIL import PIL
class CustomFormatter(logging.Formatter): class CustomFormatter(logging.Formatter):
@ -69,6 +70,8 @@ class image_classifier:
if people: if people:
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))
iptc_info = IPTCInfo(file)
print(iptc_info['keywords'])
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 not self.exif_info.has_exif: if not self.exif_info.has_exif:

View file

@ -2,3 +2,4 @@ click
click_config_file click_config_file
face_recognition face_recognition
exif exif
iptcinfo3