diff options
| author | sigoden <sigoden@gmail.com> | 2023-12-14 06:15:01 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-14 06:15:01 +0800 |
| commit | 27cae9582ff92702b6489db89f71c76b6ffe3591 (patch) | |
| tree | bb3bd1596a8951a4d4f3811e40fb5fe8882c4afb /src/config | |
| parent | 10e3b6d2344e6dad4bb46501d232d1d253c80b9d (diff) | |
| download | aichat-27cae9582ff92702b6489db89f71c76b6ffe3591.tar.gz | |
fix: cannot read image with uppercase ext (#270)
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/input.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config/input.rs b/src/config/input.rs index 3997929..b1cf6c3 100644 --- a/src/config/input.rs +++ b/src/config/input.rs @@ -144,7 +144,11 @@ fn resolve_path(file: &str) -> Option<PathBuf> { fn is_image_ext(path: &Path) -> bool { path.extension() - .map(|v| IMAGE_EXTS.iter().any(|ext| *ext == v.to_string_lossy())) + .map(|v| { + IMAGE_EXTS + .iter() + .any(|ext| *ext == v.to_string_lossy().to_lowercase()) + }) .unwrap_or_default() } |
