godot/scene
Rémi Verschelde 2e99d0b26f
glTF: Fix parsing image data with mimeType undefined
The glTF 2.0 spec only makes `mimeType` mandatory for `bufferView` image data,
so the previous logic to handle URIs with base64-encoded images could fail if
`mimeType` is undefined.

The logic was documented and refactored to better handle the spec, notably:

- `uri` and `bufferView` are now mutually exclusive, and only the latter fails
  if `mimeType` is undefined.
- `uri` with a file path will now respect the `mimeType` if defined, and thus
  attempt loading the file with the specified format (even if its extension is
  not the one expected for this format). So we can support bad extensions (PNG
  data with `.jpg` extension) or custom ones (PNG data in `.img` file for
  example).
- `uri` with base64 encoded data will infer MIME type from `data:image/png` or
  `data:image/jpeg` if it was not documented in `mimeType` initially.
- `uri` with base64 encoded data, no `mimeType` and `application/octet-stream`
  or `application/gltf-buffer` will fall back to trying both PNG and JPEG
  loaders.

Fully fixes #33796 (and fixes up #42501).
2020-10-05 13:06:50 +02:00
..
2d Remove area or body from map before emitting signals. 2020-10-02 17:03:09 +01:00
3d Updated getters and setters names for toplevel 2020-10-02 19:09:01 -04:00
animation Merge pull request #38743 from arrowinaknee/node-config-warnings 2020-10-01 14:03:29 +02:00
audio Add override keywords. 2020-07-10 13:56:54 +01:00
debugger Fix resource preview in remote inspector 2020-05-23 11:52:02 +02:00
gui Updated getters and setters names for toplevel 2020-10-02 19:09:01 -04:00
main Updated getters and setters names for toplevel 2020-10-02 19:09:01 -04:00
resources glTF: Fix parsing image data with mimeType undefined 2020-10-05 13:06:50 +02:00
register_scene_types.cpp Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
register_scene_types.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
scene_string_names.cpp Custom Skeleton3DEditorPlugin 2020-05-22 09:54:34 -07:00
scene_string_names.h Custom Skeleton3DEditorPlugin 2020-05-22 09:54:34 -07:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00