diff --git a/backend/app/services/gltf.py b/backend/app/services/gltf.py index 999e381..d84c386 100644 --- a/backend/app/services/gltf.py +++ b/backend/app/services/gltf.py @@ -15,6 +15,7 @@ from typing import Any, Optional # GLB binary header magic bytes ("glTF"). _GLB_MAGIC = b"glTF" +_GLB_MAGIC_INT = 0x46546C67 # b"glTF" interpreted as little-endian uint32 _GLB_JSON_CHUNK_TYPE = 0x4E4F534A # "JSON" _GLB_BIN_CHUNK_TYPE = 0x004E4942 # "BIN\0" @@ -48,7 +49,7 @@ def _parse_glb(content: bytes) -> dict[str, Any]: raise ValueError("GLB file is too short") magic, _version, _length = struct.unpack_from(" dict[str, Any]: def _parse_gltf_json(content: bytes) -> dict[str, Any]: """Parse a plain .gltf JSON file.""" stripped = content.lstrip() - if not stripped.startswith(b"{"): - raise ValueError("glTF JSON does not start with an object") - try: payload = json.loads(stripped.decode("utf-8")) except (ValueError, UnicodeDecodeError) as exc: