- Add feature to limit file size for external resources(images, buffers)
- Use strlen to correctly retrieve a string from a string which contains multiple null-characters.
- Return fail when opening a directory(Posix only). Fixes#416
Tinygltf is able to write files defined by a URI, so it needs to be able
to decode it. Since it may also modify the path where the image is saved
it may need to re-encode the URI too. This patch provides an API to set
URI encoding and decoding callbacks and exposes the default decode
method.
Uses the existing dlib::urldecode as a decode default. The encode
callback is left null, matching existing behaviour.
Updates the WriteImageDataFunction signature to include
tinygltf::URICallbacks.
Decodes the image and buffer uris before using them as a filename.
If the encode callback is set, encodes the written image location in the
default WriteImageDataFunction and encodes generated buffer locations
when writing .bin files.
Adds a save+load step to the test image-uri-spaces to verify uri
encoding.
Modifies UpdateImageObject() so that Returning false from the
WriteImageDataFunction callback results in the WriteGltfScene*() call
returning false.
Does not call WriteImageDataFunction if there is no image data.
Adds test case serialize-image-failure to verify the callback return
code is able to cause an overall failure to save the gltf.
Adds 'const' to all Serialize*() methods.
Updates WriteImageData callback to take a URI out pointer that was
previously being written to the Image::uri, which is now const.
This breaks the WriteImageData API and as a side effect, Image::uri will
no longer contain the written image URI after saving.
Adds test serialize-const-image, which verifies the model's image is not
changed (because it's const), but the uri written to the gltf json is
still correct.
Adds test serialize-image-callback that defines a WriteImageDataFunction
and also verifies the uri can be overwritten.
with warnings cranked up and warnings-as-errors enabled, the compiler throws an error due to this switch missing a case for binary. this makes the ignore explicit in order for compilation to proceed.