(files: Map<string, File>)
| 69 | * Stores each image under multiple keys (path suffixes, case variants) for fast O(1) lookup. |
| 70 | */ |
| 71 | export 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. |
no test coverage detected