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

Function getImageFile

src/utils/imageFileUtils.ts:93–109  ·  view source on GitHub ↗
(
  imageFiles: Map<string, File> | undefined,
  imageName: string
)

Source from the content-addressed store, hash-verified

91 * Handles various path formats and case sensitivity issues.
92 */
93export function getImageFile(
94 imageFiles: Map<string, File> | undefined,
95 imageName: string
96): File | undefined {
97 if (!imageFiles || !imageName) {
98 return undefined;
99 }
100
101 const normalizedName = normalizeImagePath(imageName);
102 const lookupKeys = getPreferredImageLookupKeys(normalizedName);
103 for (const key of lookupKeys) {
104 const match = imageFiles.get(key);
105 if (match) return match;
106 }
107
108 return undefined;
109}
110
111function getPreferredImageLookupKeys(normalizedName: string): string[] {
112 const keys: string[] = [];

Callers 5

getImageFunction · 0.90
getMetricImageFunction · 0.90
getImageSyncFunction · 0.90
findMissingImageFilesFunction · 0.85

Calls 3

normalizeImagePathFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected