fix: cannot read image with uppercase ext (#270)

pull/273/head
sigoden 6 months ago committed by GitHub
parent 10e3b6d234
commit 27cae9582f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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()
}

Loading…
Cancel
Save