Skip to content

Fix UTF-8 image names in the COLMAP binary reader - #785

Open
tryu-ai wants to merge 1 commit into
viser-project:mainfrom
tryu-ai:fix-colmap-utf8-filenames
Open

tryu-ai wants to merge 1 commit into
viser-project:mainfrom
tryu-ai:fix-colmap-utf8-filenames

Conversation

@tryu-ai

@tryu-ai tryu-ai commented Oct 15, 2026

Copy link
Copy Markdown

read_images_binary() decodes image names one byte at a time, so valid UTF-8 names such as café.png or 场景.png raise UnicodeDecodeError. Accumulate the NUL-terminated name bytes and decode the complete name once, preserving strict UTF-8 error handling.

COLMAP writes the complete name followed by NUL (official writer). Regression tests cover ASCII, two-/three-/four-byte UTF-8, mixed Chinese/emoji names, four consecutive records with varying point counts and aligned coordinates/IDs, and invalid UTF-8 rejection.

Validation on macOS arm64 / Python 3.9.6:

  • New regression tests: 5 failed / 4 passed before the fix; 9 passed after.
  • ruff check and ruff format --check: passed.
  • CPU test subset including the new tests: 496 passed.
  • Full pytest tests is blocked by missing Playwright. The non-E2E suite is blocked by missing client build/nodeenv; the complete suite was not run successfully.

No GPU tests or real reconstruction datasets were used.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant