Skip to content

Commit

Permalink
Allow for the ascii header to end with CRLF
Browse files Browse the repository at this point in the history
Previously we assumed that the header of a ply file had to end with

    end_header\n

but it is there are systems that write the end as

    end_header\r\n

This previously left the rest of the file read off by one byte.

Fixes issue 14937
  • Loading branch information
algrs committed Oct 21, 2018
1 parent 2410ad1 commit 3ccce0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/js/loaders/PLYLoader.js
Expand Up @@ -71,7 +71,7 @@ THREE.PLYLoader.prototype = {

function parseHeader( data ) {

var patternHeader = /ply([\s\S]*)end_header\s/;
var patternHeader = /ply([\s\S]*)end_header\r?\n/;
var headerText = '';
var headerLength = 0;
var result = patternHeader.exec( data );
Expand Down

0 comments on commit 3ccce0e

Please sign in to comment.