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

Function collectImageFiles

src/utils/imageFileUtils.ts:71–87  ·  view source on GitHub ↗
(files: Map<string, File>)

Source from the content-addressed store, hash-verified

69 * Stores each image under multiple keys (path suffixes, case variants) for fast O(1) lookup.
70 */
71export function collectImageFiles(files: Map<string, File>): Map<string, File> {
72 const imageFiles = new Map<string, File>();
73
74 for (const [path, file] of files) {
75 if (!isImageFile(path)) {
76 continue;
77 }
78
79 for (const key of getImageLookupKeys(path)) {
80 if (!imageFiles.has(key)) {
81 imageFiles.set(key, file);
82 }
83 }
84 }
85
86 return imageFiles;
87}
88
89/**
90 * Look up an image file by COLMAP image name.

Callers 2

processFileDropzoneFilesFunction · 0.90

Calls 2

isImageFileFunction · 0.90
getImageLookupKeysFunction · 0.90

Tested by

no test coverage detected