Skip to content

Commit 066d1be

Browse files
authored
Merge pull request #18 from alexwlchan/fix-bug
Fix a bug when finding the dominant colour of some animated GIFs
2 parents dc4e3c2 + 3a36605 commit 066d1be

File tree

5 files changed

+81
-62
lines changed

5 files changed

+81
-62
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v1.1.3 - 2022-10-17
4+
5+
Fix a bug when finding the dominant colour of some animated GIFs.
6+
37
## v1.1.2 - 2022-10-16
48

59
Add support for TIFF images.

Cargo.lock

+61-61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dominant_colours"
3-
version = "1.1.2"
3+
version = "1.1.3"
44
edition = "2018"
55

66
[dependencies]

src/get_bytes.rs

+15
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,18 @@ pub fn get_bytes_for_gif(path: &str) -> Vec<u8> {
101101
.flatten()
102102
.collect()
103103
}
104+
105+
#[cfg(test)]
106+
mod test {
107+
use crate::get_bytes;
108+
109+
// This image comes from https://stacks.wellcomecollection.org/peering-through-mri-scans-of-fruit-and-veg-part-1-a2e8b07bde6f
110+
//
111+
// I don't remember how I got these images, but for some reason they
112+
// caused v1.1.2 to fall over. This is a test that they can still be
113+
// processed correctly.
114+
#[test]
115+
fn it_gets_bytes_for_mri_fruit() {
116+
get_bytes::get_bytes_for_gif("./src/tests/garlic.gif");
117+
}
118+
}

src/tests/garlic.gif

5.01 MB
Loading

0 commit comments

Comments
 (0)