From bca37d9653e152956444973c4e79eab87b34d1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 17 May 2016 13:15:29 +0200 Subject: [PATCH] Fixed binary reader errors in ply reader. (Thanks to Michael Kremer for the patch). --- src/OpenMesh/Core/IO/reader/PLYReader.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc index 2d04f68a..ecfa83fe 100644 --- a/src/OpenMesh/Core/IO/reader/PLYReader.cc +++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc @@ -606,7 +606,7 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap case VERTEX_INDICES: // nV = number of Vertices for current face unsigned int nV; - readValue(prop.listIndexType, _in, nV); + readInteger(prop.listIndexType, _in, nV); if (nV == 3) { vhandles.resize(3); @@ -636,11 +636,11 @@ bool _PLYReader_::read_binary(std::istream& _in, BaseImporter& _bi, bool /*_swap if (_opt.check(Options::Custom) && fh.is_valid()) readCustomProperty(_in, _bi, fh, prop.name, prop.value, prop.listIndexType); else - consume_input(_in, scalar_size_[vertexProperties_[propertyIndex].value]); + consume_input(_in, scalar_size_[faceProperties_[propertyIndex].value]); break; default: - consume_input(_in, scalar_size_[vertexProperties_[propertyIndex].value]); + consume_input(_in, scalar_size_[faceProperties_[propertyIndex].value]); break; } } @@ -1154,6 +1154,8 @@ bool _PLYReader_::can_u_read(std::istream& _is) const { indexType = ValueTypeUINT8; } else if (listIndexType == "uchar") { indexType = ValueTypeUCHAR; + } else if (listIndexType == "int") { + indexType = ValueTypeINT; } else { omerr() << "Unsupported Index type for property list: " << listIndexType << std::endl; continue;