chang efield name

This commit is contained in:
Antonio J. Delgado 2021-09-06 21:25:29 +03:00
parent 95b611e61f
commit 1bafd2480a

View file

@ -84,16 +84,16 @@ class image_classifier:
def append_people_to_exif(self, people):
if self.is_json(self.iptc_info.get('user_comment')):
data = json.loads(self.iptc_info['user_comment'])
if 'PeopleDetected' not in data:
data['PeopleDetected'] = list()
if 'Person shown' not in data:
data['Person shown'] = list()
else:
data = dict()
if self.exif_iptc_infoinfo.get('user_comment'):
data["previous_user_comment"]=self.iptc_info.get('user_comment')
data['PeopleDetected'] = list()
data['Person shown'] = list()
for person in people:
if person not in data['PeopleDetected']:
data['PeopleDetected'].append(person)
if person not in data['Person shown']:
data['Person shown'].append(person)
self._log.debug(f"New 'user_comment': {json.dumps(data, indent=2)}")
self.iptc_info.set("user_comment", json.dumps(data))