Bug: ASCII PLY parsing fails on files with \r line endings due to binary mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- computer-graphics
Research direction
Start at PLYData(filename) and trace the ASCII parser used when the binary flag is false. Reproduce the failure with an ASCII PLY containing standalone \r blank lines, then verify that equivalent files using \n, \r\n, and \r parse successfully without treating blank lines as data.
Written by the indexing model from the issue text.
Description
When loading an ASCII PLY file via PLYData(filename), the parser fails to properly handle empty lines containing standalone \r (Carriage Return) characters. This occurs because the file is opened in binary mode (preserving raw \r), but the ASCII parser does not explicitly skip them. As a result, lines with \r are treated as valid content, leading to crashes.
Expected behavior:
The parser should safely ignore empty lines regardless of line ending type (\n, \r\n, or \r).
Reproduction:
- Create an ASCII PLY file with empty lines between header and data.
- Load it with happly::PLYData plyIn("file.ply", false);
- Parsing will fail when reading element data.
fily.ply:
ply
format ascii 1.0
element vertex 1
property float x
property float y
property float z
end_header
0.0 0.0 0.0
- Dominant language
- C++
- Stars
- 406
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nmwsharp/happly
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·