Closed quipo closed 2 years ago
Getting EOF error when opening a .glb file converted from .gltf using gltf.SaveBinary().
.glb
.gltf
gltf.SaveBinary()
Sample input .gltf file: https://github.com/qmuntal/gltf/files/9627951/simple.gltf.txt
Sample script:
import ( "log" "github.com/qmuntal/gltf" ) func main() { const simpleGltf = "simple.gltf" const outputGlb = "simple.glb" srcDoc, err := gltf.Open(simpleGltf) if nil != err { log.Fatal(err) } err = gltf.SaveBinary(srcDoc, outputGlb) if nil != err { log.Fatal(err) } tgtDoc, err2 := gltf.Open(outputGlb) if nil != err2 { log.Fatal(err2) } log.Println("SUCCESS!") log.Printf("DEBUG: %#v", tgtDoc) }
NB: error seen using latest version of gltf package (v.0.22.1), but not using an older version (v.0.18.3). The output files slightly differ, it looks like the old version of the package was adding some nil "padding" at the end.
nil
Thanks for the reproducer @quipo. #64 will fix this issue :)
amazing, thanks!
Getting EOF error when opening a
.glb
file converted from.gltf
usinggltf.SaveBinary()
.Sample input
.gltf
file: https://github.com/qmuntal/gltf/files/9627951/simple.gltf.txtSample script:
NB: error seen using latest version of gltf package (v.0.22.1), but not using an older version (v.0.18.3). The output files slightly differ, it looks like the old version of the package was adding some
nil
"padding" at the end.