Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Bad chunk padding for GLB export #57

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

Cyphall
Copy link
Contributor

@Cyphall Cyphall commented Mar 12, 2024

This PR fixes two bugs:

  1. The trailing padding for the BIN chunk was applied between chunkType and chunkData instead of after chunkData (terms from the glTF Specs)
  2. The padding code was not adding the right amount of bytes (e.g. for a chunk size of 11, it was adding 3 bytes instead of 1).

I also refactored a few lines to have the same code structure of "write and pad" for the JSON and BIN chunks

@spnda spnda merged commit c1be0f8 into spnda:main Mar 12, 2024
14 checks passed
@spnda
Copy link
Owner

spnda commented Mar 12, 2024

Thank you, really stupid mistake of having the padding in front of the chunk data...

@Cyphall Cyphall deleted the glb-padding-fix branch March 12, 2024 13:48
spnda pushed a commit that referenced this pull request Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants