From c339e248e09b92cb8b1a8d18bfe195ec0dfe315a Mon Sep 17 00:00:00 2001 From: Johann Woelper Date: Fri, 17 Jan 2025 19:55:59 +0100 Subject: [PATCH] fix: detect heif and heic as heif --- src/image_loader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/image_loader.rs b/src/image_loader.rs index f5b0666..907a0c9 100644 --- a/src/image_loader.rs +++ b/src/image_loader.rs @@ -41,9 +41,12 @@ pub fn open_image( .to_str() .unwrap_or_default() .to_lowercase() + // add aliased extensions here if the same formats have multiple extensions .replace("tiff", "tif") - .replace("jpeg", "jpg"); + .replace("jpeg", "jpg") + .replace("heic", "heif"); + // These are detected incorrectly, for example svg is xml etc let unchecked_extensions = ["svg", "kra", "tga", "dng"]; if let Ok(fmt) = FileFormat::from_file(&img_location) {