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

Incorrect behaviour when loading files containing spaces #60

Closed ptxmac closed 1 year ago

ptxmac commented 1 year ago

Take a look at the glTF sample files called Box With Spaces

This file has a uri reference to Box With Spaces.bin. But this library performs urlencode of the URI so spaces become %20 and then fails because it cannot find a file named Box%20With%20Spaces.bin

The url-encoding happens because of a round-trip through net/url.Parse

A solution would be to only use the parsed URL if the scheme is not empty. i.e. the URL is http/file/etc

qmuntal commented 1 year ago

Thanks for reporting this issue. I'll submit following the recommendations laid out in https://github.com/KhronosGroup/glTF/issues/1449.

ptxmac commented 1 year ago

Awesome!