Skip to content

Commit

Permalink
Merge pull request #45 from alexwlchan/better-gif
Browse files Browse the repository at this point in the history
Slightly tweak the way I get colours from GIFs
  • Loading branch information
alexwlchan authored Jul 11, 2024
2 parents 59d6f95 + 3732029 commit bcf7b15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/get_image_colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};

Expand Down

0 comments on commit bcf7b15

Please sign in to comment.