From 37320291082e1780cdf4be723b63332fe9b9a5ee Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Thu, 11 Jul 2024 08:06:58 +0100 Subject: [PATCH] Slightly tweak the way I get colours from GIFs --- src/get_image_colors.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/get_image_colors.rs b/src/get_image_colors.rs index 19ec1b5..e520e5f 100644 --- a/src/get_image_colors.rs +++ b/src/get_image_colors.rs @@ -19,8 +19,7 @@ use palette::{IntoColor, Lab, Srgba}; pub fn get_image_colors(path: &PathBuf) -> Vec { let image_bytes = match path.extension().and_then(OsStr::to_str) { - Some("gif") => get_bytes_for_gif(&path), - Some("GIF") => get_bytes_for_gif(&path), + Some(ext) if ext.to_lowercase() == "gif" => get_bytes_for_gif(&path), _ => get_bytes_for_non_gif(&path), };