Half fix append people
This commit is contained in:
parent
e9c8e9ac06
commit
9beade82bd
1 changed files with 5 additions and 7 deletions
|
@ -76,20 +76,18 @@ class image_classifier:
|
|||
self.iptc_info.save()
|
||||
self._log.debug(f"Updated file '{file}'.")
|
||||
# get date
|
||||
self._log.debug(f"File time stamp: {self.iptc_info.get('Image timestamp')} (type: {type(self.exif_info.get('Image timestamp'))})")
|
||||
self._log.debug(f"File time stamp: {self.iptc_info['Image timestamp']} (type: {type(self.iptc_info['Image timestamp'])})")
|
||||
# move to destination
|
||||
else:
|
||||
self._log.debug("Doesn't seem to be an image.")
|
||||
|
||||
def append_people(self, people):
|
||||
if self.is_json(self.iptc_info.get('user_comment')):
|
||||
data = json.loads(self.iptc_info['user_comment'])
|
||||
if 'Person shown' not in data:
|
||||
data['Person shown'] = list()
|
||||
if self.is_json(self.iptc_info['Person shown']):
|
||||
data = json.loads(self.iptc_info['Person shown'])
|
||||
else:
|
||||
data = dict()
|
||||
if self.exif_iptc_infoinfo.get('user_comment'):
|
||||
data["previous_user_comment"]=self.iptc_info.get('user_comment')
|
||||
if self.iptc_infoinfo['Person shown']:
|
||||
data["previous_user_comment"]=self.iptc_info['user_comment']
|
||||
data['Person shown'] = list()
|
||||
for person in people:
|
||||
if person not in data['Person shown']:
|
||||
|
|
Loading…
Reference in a new issue