-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
MIME Type & File Extension For Binary Buffers #944
Comments
CC #943 |
@sbtron OK to close this? |
As far as I can see, this isn't registered yet. |
Ah, yes, of course, I was thinking of |
nope this is still pending just the gltf-binary is done and closed. |
@sbtron any update on this one? |
@sbtron Any updates? |
https://www.iana.org/assignments/media-types/media-types.xhtml https://www.iana.org/assignments/media-types/application/gltf-buffer It looks like this is officially registered!
The registered file extensions are I'd like to caution once more about using Most web servers are capable of serving "static files" by mapping file extensions to MIME types, typically with some factory-supplied mapping table that can optionally be extended by the server's administrator. All of the major servers already include a factory mapping from So, if we want to encourage usage of the new MIME type, we should use one of the newly registered file extensions ( |
Sounds great! Why did we ask for two new file extensions? |
I'm not entirely sure how to respond to KhronosGroup/glTF-Tutorials#21 (comment) at the moment (and #1323 was closed as a duplicate of this one, so I'm asking here) : To my understanding, the More specifically: What is the MIME type that data URIs should have? (Of course, only referring to the ones that do not store images, but only the ones that store, e.g. animation data) The spec doesn't seem to say anything about that right now. I think it could and probably should be mentioned there. |
I don't think we came to a consensus which one was better, unfortunately. I didn't have a strong opinion when I was asked, so apparently we registered both. The spec should probably be updated to use just one.
Ah no, a full .GLB file is registered to A text-based .gltf file is registered to So a JSON-based I don't feel like I've written this very clearly... Please ask for any clarifications 😄 |
Also, question for the group: How much of a breaking change is it, if we ask everyone to change their |
Sorry seems to have dropped through the cracks since the registration took a while. We got the additional extensions as alternative to the .bin so if your particular server config could not use the .bin extension you had some alternatives. Rather than getting everyone to update all files to use a alternate extension I was looking at the alternate extensions as more of a opt in if you have a server config that doesn't let you override the .bin. This does mean loaders need to work with all "allowed" file extensions and not just .bin. A few of the loaders I am aware of just look at the uri and don't necessarily mandate the extension. So this might be a good middle ground to maintain compat. |
I landed here while debugging why Godot Engine fails to import some of the models from https://github.com/KhronosGroup/glTF-Sample-Models (godotengine/godot#33796), which seem to use I'll fix this in Godot's glTF 2.0 importer, but shouldn't this be updated in the specification? I only found a reference to this issue this through search engines, not in the spec. |
…* MIME types See KhronosGroup/glTF#944 for context on the application/gltf-buffer MIME type. The glTF 2.0 spec supports `image/jpeg` and `image/png` which can also be base64-encoded in buffer URIs. Fixes godotengine#33796.
…* MIME types See KhronosGroup/glTF#944 for context on the application/gltf-buffer MIME type. The glTF 2.0 spec supports `image/jpeg` and `image/png` which can also be base64-encoded in buffer URIs. Fixes #33796. (cherry picked from commit 34a5031)
…* MIME types See KhronosGroup/glTF#944 for context on the application/gltf-buffer MIME type. The glTF 2.0 spec supports `image/jpeg` and `image/png` which can also be base64-encoded in buffer URIs. Fixes godotengine#33796.
glTF 2.0 spec states that buffers with binary data must have
.bin
file extension andapplication/octet-stream
MIME Type.The latter applies both to external files (e.g., when they're served over HTTP) and Data URI-embedded buffers (because Data URI syntax requires specifying MIME type when it isn't
text/plain
).Despite that glTF binary buffer is useless without JSON description, usage of such generic MIME Type (
application/octet-stream
) and file extension (.bin
) could be sub-optimal:Proposal: register a new MIME Type for glTF binary buffers and use it instead of
application/octet-stream
. Also, optionally replace.bin
file extension with a new one.According to RFC 6838, Section 4.2.5,
application/
top-level type seems to be the right place:I think that it seems quite consistent to propose
application/gltf-buffer
.Thoughts?
CC @pjcozzi @sbtron @bghgary
The text was updated successfully, but these errors were encountered: