From a698dbdb73a78bdfae352ca65f59812879b9c890 Mon Sep 17 00:00:00 2001 From: jacky banh <37816729+Jacky56@users.noreply.github.com> Date: Sat, 26 Apr 2025 23:00:26 +0100 Subject: [PATCH] Update Utils.js truncate options/params from url if its a url to determine filename based on url --- src/loaders/Utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/loaders/Utils.js b/src/loaders/Utils.js index 4d446d7e..ca8c5076 100644 --- a/src/loaders/Utils.js +++ b/src/loaders/Utils.js @@ -1,6 +1,12 @@ import { SceneFormat } from './SceneFormat.js'; export const sceneFormatFromPath = (path) => { + try { + const url = new URL(path); + path = url.pathname; + } catch (e) { + // Ignore error, path is not a URL + } if (path.endsWith('.ply')) return SceneFormat.Ply; else if (path.endsWith('.splat')) return SceneFormat.Splat; else if (path.endsWith('.ksplat')) return SceneFormat.KSplat;