Skip to content

[Merged by Bors] - Fix MIME type support for glTF buffer Data URIs (pipelined)#3106

Closed
parasyte wants to merge 1 commit intobevyengine:pipelined-renderingfrom
parasyte:fix/pipelined-gltf-loader-mimetype
Closed

[Merged by Bors] - Fix MIME type support for glTF buffer Data URIs (pipelined)#3106
parasyte wants to merge 1 commit intobevyengine:pipelined-renderingfrom
parasyte:fix/pipelined-gltf-loader-mimetype

Conversation

@parasyte
Copy link
Contributor

@parasyte parasyte commented Nov 11, 2021

Apply #3101 on top of the pipelined-rendering branch, as requested by @cart in #3101 (comment)

Objective

Buffer data MAY alternatively be embedded in the glTF file via data: URI with base64 encoding. When data: URI is used for buffer storage, its mediatype field MUST be set to application/octet-stream or application/gltf-buffer.

(Emphasis in original.)

Solution

  • Check for both MIME types.

@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Nov 11, 2021
@mockersf
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Nov 11, 2021
Apply #3101 on top of the `pipelined-rendering` branch, as requested by @cart in #3101 (comment)

# Objective

- The glTF 2.0 spec requires that Data URIs use one of two valid MIME types. `bevy_gltf2` only supports one of these.
- See:
  - https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#_media_type_registrations
  - https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#file-extensions-and-media-types
  - https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#binary-data-storage

> Buffer data **MAY** alternatively be embedded in the glTF file via `data:` URI with base64 encoding. When `data:` URI is used for buffer storage, its mediatype field **MUST** be set to `application/octet-stream` or `application/gltf-buffer`.

(Emphasis in original.)

## Solution

- Check for both MIME types.
@bors
Copy link
Contributor

bors bot commented Nov 11, 2021

@bors bors bot changed the title Fix MIME type support for glTF buffer Data URIs (pipelined) [Merged by Bors] - Fix MIME type support for glTF buffer Data URIs (pipelined) Nov 11, 2021
@bors bors bot closed this Nov 11, 2021
@parasyte parasyte deleted the fix/pipelined-gltf-loader-mimetype branch November 11, 2021 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants