godot/editor/import
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
..
atlas_import_failed.xpm Added ability for multiple images to be imported as an atlas 2019-04-19 15:56:34 -03:00
collada.cpp Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
collada.h Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
editor_import_collada.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
editor_import_collada.h Add override keywords. 2020-07-10 13:56:54 +01:00
editor_import_plugin.cpp Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2020-05-14 16:54:55 +02:00
editor_import_plugin.h Add override keywords. 2020-07-10 13:56:54 +01:00
editor_scene_importer_gltf.cpp glTF: Fix parsing image data with mimeType undefined 2020-10-05 13:06:50 +02:00
editor_scene_importer_gltf.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_bitmask.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
resource_importer_bitmask.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_csv_translation.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
resource_importer_csv_translation.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_csv.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
resource_importer_csv.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_image.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
resource_importer_image.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_layered_texture.cpp Implement 3D textures as import and resource format. 2020-09-09 13:50:21 -03:00
resource_importer_layered_texture.h Implement 3D textures as import and resource format. 2020-09-09 13:50:21 -03:00
resource_importer_obj.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
resource_importer_obj.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_scene.cpp Fix issues with custom tracks on reimport 2020-07-02 16:08:20 -07:00
resource_importer_scene.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_shader_file.cpp Style: Enforce separation line between function definitions 2020-05-14 16:54:55 +02:00
resource_importer_shader_file.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_texture_atlas.cpp Fix excessive bottom cropping in atlas generation 2020-06-03 22:24:49 +02:00
resource_importer_texture_atlas.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_texture.cpp Remove the obsolete "2D Pixel" import preset 2020-06-14 15:08:09 +02:00
resource_importer_texture.h Add override keywords. 2020-07-10 13:56:54 +01:00
resource_importer_wav.cpp Style: Enforce braces around if blocks and loops 2020-05-14 21:57:34 +02:00
resource_importer_wav.h Add override keywords. 2020-07-10 13:56:54 +01:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00