Add basic gltf format checking

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-20 09:08:35 -07:00
parent 7daaf81280
commit f08977da3c
4 changed files with 41 additions and 4 deletions

View File

@@ -166,8 +166,8 @@ class GlModelHandler extends ImageHandler {
$glMeta = json_decode(fread($gltf,$glMetaLength['int']),true);
fclose($gltf);
$newMeta = array(
'glmv-meshes' => count($glMeta['meshes']),
'glmv-textures' => count($glMeta['textures'])
'glmv-meshes' => count($glMeta['meshes'] ?? []),
'glmv-textures' => count($glMeta['textures'] ?? [])
);
foreach($glMeta['asset'] as $key => $value) {
switch ($key) {