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

Function findZipEntry

src/utils/zipArchiveState.ts:72–93  ·  view source on GitHub ↗
(
  imageName: string,
  index: Map<string, ArchiveEntry>
)

Source from the content-addressed store, hash-verified

70 * Find an entry in a ZIP index by image name.
71 */
72export function findZipEntry(
73 imageName: string,
74 index: Map<string, ArchiveEntry>
75): ArchiveEntry | null {
76 const candidates = getZipEntryLookupCandidates(imageName);
77
78 for (const candidate of candidates) {
79 const entry = index.get(candidate);
80 if (entry) {
81 return entry;
82 }
83 }
84
85 const lowerCandidates = new Set(candidates.map(candidate => candidate.toLowerCase()));
86 for (const [key, entry] of index.entries()) {
87 if (lowerCandidates.has(key.toLowerCase())) {
88 return entry;
89 }
90 }
91
92 return null;
93}
94
95/**
96 * Extract an image from the active ZIP archive.

Callers 3

extractZipImageFunction · 0.85
fetchZipMaskFunction · 0.85

Calls 3

getMethod · 0.80
entriesMethod · 0.80

Tested by

no test coverage detected