qmuntal / gltf

Go library for encoding glTF 2.0 files
https://www.khronos.org/gltf/
BSD 2-Clause "Simplified" License
241 stars 32 forks source link

Ignore EOF when decoding small .gltf files #59

Closed quipo closed 1 year ago

quipo commented 1 year ago

When decoding very small files (smaller than one read chunk?), the inner decoder might return io.EOF as error, alongside the document (i.e. the document read might be valid, but it's overwritten with nil in case of io.EOF)

qmuntal commented 1 year ago

Thanks for reporting the issue @quipo. Could you share a test file that reproduces this error? I want to understand how is that we return a io.EOF is the documents is valid.

quipo commented 1 year ago

simple.gltf

quipo commented 1 year ago

hi @qmuntal, have you had a chance to validate the above file?

qmuntal commented 1 year ago

I can't reproduce the issue, decoding simple.gltf gives no io.EOF, at least in my Windows machine. Could you share more details? Maybe a code snippet.

quipo commented 1 year ago

Hi @qmuntal, I misread the error, the problem was not parsing the .gltf file above, but converting it to .glb and trying to open the latter. I raised a ticket here: https://github.com/qmuntal/gltf/issues/63 with a reproducing script

quipo commented 1 year ago

Superseded by https://github.com/qmuntal/gltf/pull/64