{"action":"created","issue":{"url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/2243","repository_url":"https://api.github.com/repos/PointCloudLibrary/pcl","labels_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/2243/labels{/name}","comments_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/2243/comments","events_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/2243/events","html_url":"https://github.com/PointCloudLibrary/pcl/pull/2243","id":302262865,"number":2243,"title":"LoadPLYFile should be able to load large ply files correctly","user":{"login":"YouYue123","id":8738486,"avatar_url":"https://avatars1.githubusercontent.com/u/8738486?v=4","gravatar_id":"","url":"https://api.github.com/users/YouYue123","html_url":"https://github.com/YouYue123","followers_url":"https://api.github.com/users/YouYue123/followers","following_url":"https://api.github.com/users/YouYue123/following{/other_user}","gists_url":"https://api.github.com/users/YouYue123/gists{/gist_id}","starred_url":"https://api.github.com/users/YouYue123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YouYue123/subscriptions","organizations_url":"https://api.github.com/users/YouYue123/orgs","repos_url":"https://api.github.com/users/YouYue123/repos","events_url":"https://api.github.com/users/YouYue123/events{/privacy}","received_events_url":"https://api.github.com/users/YouYue123/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-05T11:22:21Z","updated_at":"2018-03-08T15:47:17Z","closed_at":"2018-03-06T23:06:48Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/PointCloudLibrary/pcl/pulls/2243","html_url":"https://github.com/PointCloudLibrary/pcl/pull/2243","diff_url":"https://github.com/PointCloudLibrary/pcl/pull/2243.diff","patch_url":"https://github.com/PointCloudLibrary/pcl/pull/2243.patch"},"body":"Patch on top of https://github.com/PointCloudLibrary/pcl/issues/2145\r\n\r\n## Your Environment\r\n- Operating System and version: Ubuntu 16.04\r\n- Compiler: cmake 3.5.2 / make 4.1\r\n- PCL Version: 1.8.1\r\n- CPU: 36 cores / RAM: 64GB\r\n\r\n## Expected Behavior\r\npcl::io::LoadPLYFile should be able to load large ply files correctly\r\n\r\n## Current Behavior\r\nWhile trying to load a 40 GB .ply point cloud using the following:\r\n```c++\r\nloadPLYFile<PointXYZ>(filePath, *object);\r\n```\r\nI get a point cloud which all points are ```(0, 0, 0)```\r\n\r\n## Issue\r\nIn io/src/ply/ply_parser.cpp line 498, the ply parse function is trying to check whether ```end_header_callback_``` is return true. Otherwise it will return from the ply parse procedure.  And this return will remain all points as its initial value ```(0,0,0)```\r\n\r\n```c++\r\n  // end_header\r\n      else if (keyword == \"end_header\")\r\n      {\r\n        if (end_header_callback_)\r\n        {\r\n          if (end_header_callback_ () == false)\r\n            return true;\r\n        }\r\n        break;\r\n      }\r\n```\r\n\r\nAnd in io/src/ply/ply_io.cpp line 95, the endHeaderCallback is return a checking between `data.size()` with a expression `cloud_->point_step * cloud_->width * cloud_->height` which is not always true while ` cloud_->point_step * cloud_->width * cloud_->height` is larger than 4,294,967,295(Max number of 32 bit integer)\r\n\r\n```c++\r\nbool\r\npcl::PLYReader::endHeaderCallback ()\r\n{ \r\n  cloud_->data.resize (static_cast<size_t>(cloud_->point_step) * cloud_->width * cloud_->height);\r\n  return (cloud_->data.size () == cloud_->point_step * cloud_->width * cloud_->height);\r\n}\r\n```\r\n\r\n## Resolution\r\n\r\nAs proposed in pull request, I changed the checking as below\r\n\r\n```c++\r\nbool\r\npcl::PLYReader::endHeaderCallback ()\r\n{ \r\n  cloud_->data.resize (static_cast<size_t>(cloud_->point_step) * cloud_->width * cloud_->height);\r\n  return (cloud_->data.size () == static_cast<size_t>(cloud_->point_step) * cloud_->width * cloud_->height);\r\n}\r\n```\r\nIt works in my env.\r\n\r\n## Context\r\nWe are trying to process large building information to be able to be processed by our computing engine"},"comment":{"url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/comments/371527535","html_url":"https://github.com/PointCloudLibrary/pcl/pull/2243#issuecomment-371527535","issue_url":"https://api.github.com/repos/PointCloudLibrary/pcl/issues/2243","id":371527535,"user":{"login":"YouYue123","id":8738486,"avatar_url":"https://avatars1.githubusercontent.com/u/8738486?v=4","gravatar_id":"","url":"https://api.github.com/users/YouYue123","html_url":"https://github.com/YouYue123","followers_url":"https://api.github.com/users/YouYue123/followers","following_url":"https://api.github.com/users/YouYue123/following{/other_user}","gists_url":"https://api.github.com/users/YouYue123/gists{/gist_id}","starred_url":"https://api.github.com/users/YouYue123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YouYue123/subscriptions","organizations_url":"https://api.github.com/users/YouYue123/orgs","repos_url":"https://api.github.com/users/YouYue123/repos","events_url":"https://api.github.com/users/YouYue123/events{/privacy}","received_events_url":"https://api.github.com/users/YouYue123/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T15:47:17Z","updated_at":"2018-03-08T15:47:17Z","author_association":"NONE","body":"Nice to see this changes!"}}
{"actor":{"display_login":"YouYue123"}}