diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index dcdd619..f3c1f13 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -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']: