jkuhlmann / cgltf

:diamond_shape_with_a_dot_inside: Single-file glTF 2.0 loader and writer written in C99
MIT License
1.44k stars 136 forks source link

Implement cgltf_decode_uri #115

Closed zeux closed 4 years ago

zeux commented 4 years ago

Image and buffer paths are encoded as URIs in the glTF file. This means that special characters, such as spaces, are percent-encoded.

This change adds a helper function, cgltf_decode_uri, that can decode a URI in place; it also uses it when loading the buffers so that we pass a path to file read callback instead of a path-URI combo.