Open kzfile opened 2 years ago
The "unexpected EOF. malformed file?" exception happens when opening a well-formed ASCII file, such as this file: https://people.sc.fsu.edu/~jburkardt/data/ply/airplane.ply. The exception happens in tinyply 2.3.4, but not in tinyply 2.3.2. It is possible that the problem was introduced in 2.3.4 by the code that avoids crashes when reading incomplete files (the ones with less data than declared in the header).
Hello. I stil get the exception "Caught tinyply exception: unexpected EOF. malformed file?" e.g. when reading files exported with Blender. Intrestingly enough it works if the mesh is triangles only(e.g. applying a triangulate modifier before exporting). The same mesh with quads does not work. I the testfiles.zip file you'll find the same mesh, once triangulated and once with quads. The one with quads should trigger the exception.
okay, I have some more information: It seems to be caused by a wrong user list hint. e.g. faces = file.request_properties_from_element("face", { "vertex_indices" }, 3); when the list actually has 4 elements per list. Setting faces = file.request_properties_from_element("face", { "vertex_indices" }, 0); works and the error disappears. However, since it is called only "hint"(as to "try this value first and fall back to finding it out ourselfs it that didn't work"), shouldn't there be some validation/fallback, if the user provided hint does not correspond with the size of the actual list in the .ply file? E.g. something along the lines of
try {
parse_data(is, false);
} catch(Exception e) {
parse_data(is, true);
}
in tinyply.h line 544...
Hello,Is there anythong wrong in the new commit? I just clone the repository and run the example but got exception when reading
example_cube-ascii.ply
:Same exception occured when I try another ascii ply. I compiled the code on windows msvc/wsl2 and no one was spared.