syoyo / tinygltf

Header only C++11 tiny glTF 2.0 library
MIT License
1.94k stars 395 forks source link

Fix images not being saved due to missing filesystem callbacks #491

Closed ptc-tgamper closed 4 days ago

ptc-tgamper commented 1 week ago

tiny_gltf.h - explicitly pass filesystem callbacks to image related functions tester.cc - add respective test case, fix image uri test case

syoyo commented 1 week ago

Thanks!

This PR solves the issue as you mentioned: https://github.com/syoyo/tinygltf/issues/473 And since it breaks FS API, I need to be a bit carefully on merging this PR.

Just want to confirm: The difference is only adding FSCallback to FS Writer API? No other changes to FS API?

ptc-tgamper commented 1 week ago

No other changes. Just directly passing the FSCallbacks through. Now the user pointer is actually the user pointer one would expect in all the callbacks.

ptc-tgamper commented 6 days ago

@tdapper could you give this branch a try?

DanielLorenzLaubwerk commented 6 days ago

I can confirm that the small test case does not crash anymore. I am going to test it in our original context now.

DanielLorenzLaubwerk commented 5 days ago

It also works in our original context. Many thanks.

syoyo commented 4 days ago

@ptc-tgamper Code is now OK(reviewed & CI test passes). I think its ready to merge. Do you have any further commits planned?

ptc-tgamper commented 4 days ago

Not at the moment. Please merge, as this gets memory consumption down by an order of magnitude for our use case.

syoyo commented 4 days ago

@ptc-tgamper Thanks! Merged!

syoyo commented 4 days ago

Created new release FYI: https://github.com/syoyo/tinygltf/releases/tag/v2.9.0