Browse Source

Don't require extension.

pull/1067/head
Matthew Petroff 2 years ago
parent
commit
387f5fba40
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/js/libpannellum.js

+ 3
- 3
src/js/libpannellum.js View File

@@ -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]);
};


Loading…
Cancel
Save