Skip to content

Commit 51c2e85

Browse files
committed
Fix latin-1 gcp ID encoding in fpdf2 export
1 parent 153905b commit 51c2e85

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

opensfm/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ def make_gcp_error_details(self):
312312
column_names = ["ID", "Error X (m)", "Error Y (m)", "Error Z (m)"]
313313

314314
for gcp in gcp_stats:
315-
row = [gcp["id"]]
315+
gcp_id = ''.join(c if ord(c) < 256 else '?' for c in gcp["id"]) # latin-1 only due to fpdf2 requirements
316+
row = [gcp_id]
316317
row.append(f"{gcp['error'][0]:.3f}")
317318
row.append(f"{gcp['error'][1]:.3f}")
318319
row.append(f"{gcp['error'][2]:.3f}")

0 commit comments

Comments
 (0)