Skip to content

Commit

Permalink
Decode external uri during search (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
slimbuck authored Sep 16, 2024
1 parent 6452fc8 commit 830428e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ class Viewer {

const processImage = function (gltfImage: any, continuation: (err: string, result: any) => void) {
const u: File = externalUrls.find((url) => {
return url.filename === path.normalize(gltfImage.uri || '');
return url.filename === decodeURIComponent(path.normalize(gltfImage.uri || ''))

Check failure on line 1033 in src/viewer.ts

View workflow job for this annotation

GitHub Actions / Lint (18.x)

Missing semicolon
});
if (u) {
const textureAsset = new Asset(u.filename, 'texture', {
Expand All @@ -1054,7 +1054,7 @@ class Viewer {

const processBuffer = function (gltfBuffer: any, continuation: (err: string, result: any) => void) {
const u = externalUrls.find((url) => {
return url.filename === path.normalize(gltfBuffer.uri || '');
return url.filename === decodeURIComponent(path.normalize(gltfBuffer.uri || ''))

Check failure on line 1057 in src/viewer.ts

View workflow job for this annotation

GitHub Actions / Lint (18.x)

Missing semicolon
});
if (u) {
const bufferAsset = new Asset(u.filename, 'binary', {
Expand Down Expand Up @@ -1557,8 +1557,10 @@ class Viewer {
entity = prevEntity;
} else {
if (asset.type === 'container') {
// container/glb
entity = asset.resource.instantiateRenderEntity();
} else {
// gaussian splat scene
entity = asset.resource.instantiate();

// render frame if gaussian splat sorter updates)
Expand Down

0 comments on commit 830428e

Please sign in to comment.