(manifest: ColmapManifest)
| 459 | } |
| 460 | |
| 461 | export 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 | |
| 482 | export function getManifestLoadSourceInfo( |
| 483 | manifest: ColmapManifest, |
no test coverage detected