Skip to content

Commit

Permalink
Fix issue #3424 (#3425)
Browse files Browse the repository at this point in the history
PCD Reader not seeking to correct location in Windows. 
Files were opened as text not binary causing issues with seekg and 
tellg methods. By setting the binanary argument to true when opening
the file, Utils::openFile(m_filename, true); this issue is resolved.
  • Loading branch information
dsmith8fr committed May 6, 2021
1 parent 1192f2f commit c4e925e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions io/PcdReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void PcdReader::ready(PointTableRef table)
switch (m_header.m_dataStorage)
{
case PcdDataStorage::ASCII:
m_istreamPtr = Utils::openFile(m_filename, false);
m_istreamPtr = Utils::openFile(m_filename, true);
if (!m_istreamPtr)
throwError("Unable to open ASCII PCD file '" + m_filename + "'.");
m_istreamPtr->seekg(m_header.m_dataOffset);
Expand Down Expand Up @@ -243,7 +243,7 @@ void PcdReader::initialize()
if (m_filename.empty())
throwError("Can't read PCD file without filename.");

m_istreamPtr = Utils::openFile(m_filename, false);
m_istreamPtr = Utils::openFile(m_filename, true);
if (!m_istreamPtr)
throwError("Can't open file '" + m_filename + "'.");
try
Expand Down

0 comments on commit c4e925e

Please sign in to comment.