unibas-gravis / scalismo-faces

Scalable Image Analysis and Shape Modelling: Module to work with 2d images, with a focus on face images
Apache License 2.0
118 stars 27 forks source link

While reading a PLY-File, infer the line separator length from the file not from the system #108

Closed Andreas-Forster closed 6 years ago

Andreas-Forster commented 6 years ago

When copying files between different systems a file can end up having not the systems default line ending encoding. Therefore this pull request updates the PLY-reader to infer first from the file the line separator length before using it later to parse the file correctly. This should sort out some problems that were reported mainly from users of Windows-based systems using our library or projects derived thereof.

The method that infers the length interprets the first encountered line separation symbol as the one used throughout the file. The different options are: "\r\n", "\n\r", "\n", "\r", "\u0085", "\u2028" or "\u2029".