MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getManifestLazySourceBases

Function getManifestLazySourceBases

src/hooks/urlLoaderPolicy.ts:461–480  ·  view source on GitHub ↗
(manifest: ColmapManifest)

Source from the content-addressed store, hash-verified

459}
460
461export function getManifestLazySourceBases(manifest: ColmapManifest): ManifestLazySourceBases {
462 const imagesPath = manifest.imagesPath ?? 'images/';
463 const masksPath = manifest.masksPath ?? 'masks/';
464
465 const bases: ManifestLazySourceBases = {
466 imageUrlBase: joinManifestUrlPath(manifest.baseUrl, imagesPath),
467 maskUrlBase: joinManifestUrlPath(manifest.baseUrl, masksPath),
468 };
469
470 // joinManifestUrlPath encodes each path exactly once; the resulting URLs are
471 // final and used by the adapter verbatim (never re-encoded via buildImageUrl).
472 const mappings = Object.entries(manifest.imageNameToPath ?? {});
473 if (mappings.length > 0) {
474 bases.imageNameToUrl = Object.fromEntries(
475 mappings.map(([name, relativePath]) => [name, joinManifestUrlPath(manifest.baseUrl, relativePath)])
476 );
477 }
478
479 return bases;
480}
481
482export function getManifestLoadSourceInfo(
483 manifest: ColmapManifest,

Callers 2

Calls 2

joinManifestUrlPathFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected