Skip to content

Commit

Permalink
Add encoding test for jelly beans image
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Aug 23, 2023
1 parent dfa3216 commit 0c230e5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,16 @@ mod tests {

assert_eq!(img[0..5], [1, 1, 1, 255, 1]);
}

#[test]
fn test_jelly_beans() {
use image::{EncodableLayout, GenericImageView};

let img = image::open("data/octocat.png").unwrap();
let (width, height) = img.dimensions();
let blurhash = encode(4, 3, width, height, img.to_rgba8().as_bytes()).unwrap();

// assert_eq!(blurhash, "LFL4=pI8%foujXofRkWC.loyH?V{");
assert_eq!(blurhash, "LNAdAqj[00aymkj[TKay9}ay-Sj[");
}
}

0 comments on commit 0c230e5

Please sign in to comment.