godot/editor/import
Rémi Verschelde 9529ce41eb
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).

(cherry picked from commit 2e99d0b26f)
2020-10-05 14:41:53 +02:00
..
atlas_import_failed.xpm Added ability for multiple images to be imported as an atlas 2019-04-19 15:56:34 -03:00
editor_import_collada.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_import_collada.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_import_plugin.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_import_plugin.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
editor_scene_importer_gltf.cpp glTF: Fix parsing image data with mimeType undefined 2020-10-05 14:41:53 +02:00
editor_scene_importer_gltf.h [3.2] Add GLTF light import 2020-06-10 23:51:34 -04:00
resource_importer_bitmask.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_bitmask.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_csv_translation.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_csv_translation.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_csv.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_csv.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_image.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_image.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_layered_texture.cpp Fix #42043, mismatched compress options in ResourceImporterLayeredTexture 2020-09-14 15:36:46 +08:00
resource_importer_layered_texture.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_obj.cpp Add option to apply an offset to obj mesh import 2020-01-11 19:27:00 +11:00
resource_importer_obj.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_scene.cpp Fix issues with custom tracks on reimport 2020-07-03 13:17:57 +02:00
resource_importer_scene.h Respect 'mesh compression' editor import option in Assimp (ie. FBX) and glTF importers 2020-05-28 15:28:47 -07:00
resource_importer_texture_atlas.cpp Fix excessive bottom cropping in atlas generation 2020-06-04 12:16:39 +02:00
resource_importer_texture_atlas.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_texture.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_texture.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_wav.cpp Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
resource_importer_wav.h Update copyright statements to 2020 2020-01-01 11:16:22 +01:00
SCsub SCons: Format buildsystem files with psf/black 2020-06-10 15:30:52 +02:00