Skip to main content

Merge pull request #45 from alexwlchan/better-gif

ID
bcf7b15
date
2024-07-11 07:08:17+00:00
author
Alex Chan <alex@alexwlchan.net>
parents
59d6f95, 3732029
message
Merge pull request #45 from alexwlchan/better-gif

Slightly tweak the way I get colours from GIFs
changed files
1 file, 1 addition, 2 deletions

Changed files

src/get_image_colors.rs (5394) → src/get_image_colors.rs (5374)

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<Lab> {
     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),
     };