From 54abe7ee963b0bee79d6a4e1ccf1c269151ccf22 Mon Sep 17 00:00:00 2001 From: architect-bot Date: Wed, 19 Aug 2026 12:32:06 +0000 Subject: [PATCH] =?UTF-8?q?WIP=20checkpoint:=20US-1:=20Asset=20Import=20Pi?= =?UTF-8?q?peline=20=E2=80=94=20glTF=20upload=20endpoint=20with=20metadata?= =?UTF-8?q?=20extraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/gltf.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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: