From da1db08d2754bc89867707c93826eafad29f399d Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sun, 31 Mar 2024 16:28:51 -0700 Subject: [PATCH] converter: Allow non-standard absolute paths in image URIs --- gltf/_converter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gltf/_converter.py b/gltf/_converter.py index a0faf4f..e954da3 100644 --- a/gltf/_converter.py +++ b/gltf/_converter.py @@ -607,8 +607,11 @@ def load_embedded_image(name, ext, data): texture = load_embedded_image(name, ext, data) else: uri = urllib.parse.unquote(uri) - uri = Filename.from_os_specific(uri) - fulluri = Filename(self.filedir, uri) + fname = Filename.from_os_specific(uri) + if not os.path.isabs(uri): + fulluri = Filename(self.filedir, uri) + else: + fulluri = fname texture = TexturePool.load_texture(fulluri, 0, False, LoaderOptions()) if not texture: raise RuntimeError(f'failed to load texture: {fulluri}')