Skip to content

Commit

Permalink
Fix encoding issue when writing comments to file in landmark_exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad committed Mar 29, 2022
1 parent 2d90e63 commit 507a7ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exporters/landmark_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def add_subjects_to_path(self, path, data):
with open(join(storage_path, str(annotation.id) + '.txt'), 'w') as f:
f.write(subject.name + '\n')
f.write(annotation.image.format + '\n')
f.write(annotation.comments.replace('\n', '<br>') + '\n')
f.write((annotation.comments).encode('ascii', 'ignore').decode('ascii').replace('\n', '<br>') + '\n') # Encoding fix
# Get aspect ratio to correct x landmarks, because they are stored with isotropic spacing, while images
# are often not stored in isotropic spacing
metaimage = MetaImage(filename=annotation.image.format.replace('#', str(0)))
Expand Down

0 comments on commit 507a7ee

Please sign in to comment.