From 387f5fba4037a81b76760580963328769d7b15ef Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Tue, 28 Dec 2021 17:38:24 -0500 Subject: [PATCH] Don't require extension. --- src/js/libpannellum.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/libpannellum.js b/src/js/libpannellum.js index 8aa2f19..75a6758 100644 --- a/src/js/libpannellum.js +++ b/src/js/libpannellum.js @@ -292,7 +292,7 @@ function Renderer(container, context) { faceImg.onload = onLoad; faceImg.onerror = incLoaded; // ignore missing face to support partial fallback image if (imageType == 'multires') { - faceImg.src = path.replace('%s', fallbackSides[s]) + '.' + image.extension; + faceImg.src = path.replace('%s', fallbackSides[s]) + (image.extension ? '.' + image.extension : ''); } else { faceImg.src = image[s].src; } @@ -1453,7 +1453,7 @@ function Renderer(container, context) { * @param {MultiresNode} node - Input node. */ function processNextTileFallback(node) { - loadTexture(node, node.path + '.' + image.extension, function(texture, loaded) { + loadTexture(node, node.path + (image.extension ? '.' + image.extension : ''), function(texture, loaded) { node.texture = texture; node.textureLoaded = loaded ? 2 : 1; }, globalParams.crossOrigin); @@ -1505,7 +1505,7 @@ function Renderer(container, context) { }; processNextTile = function(node) { // Since web worker is created from a Blob, we need the absolute URL - var path = new URL(node.path + '.' + image.extension, window.location).href; + var path = new URL(node.path + (image.extension ? '.' + image.extension : ''), window.location).href; texturesLoading[path] = node; worker.postMessage([path, globalParams.crossOrigin]); };