Browse Source

Resized some images for the test. Updated the credits for the images. Added a test to confirm that we're reading files in the test directory.

develop
Drew Short 9 years ago
parent
commit
9f2b0d919e
  1. 2
      Cargo.toml
  2. 24
      src/lib.rs
  3. 0
      test_images/14095127199_e60a64e1b6_h_large.jpg
  4. BIN
      test_images/14095127199_e60a64e1b6_h_medium.jpg
  5. BIN
      test_images/14095127199_e60a64e1b6_h_small.jpg
  6. 0
      test_images/14191645299_7179d4a859_h_large.jpg
  7. BIN
      test_images/14191645299_7179d4a859_h_medium.jpg
  8. BIN
      test_images/14191645299_7179d4a859_h_small.jpg
  9. 0
      test_images/15720949851_c94c8b2d54_h_large.jpg
  10. BIN
      test_images/15720949851_c94c8b2d54_h_medium.jpg
  11. BIN
      test_images/15720949851_c94c8b2d54_h_small.jpg
  12. 8
      test_images/credits.txt

2
Cargo.toml

@ -1,5 +1,5 @@
[package]
name = "perceptual_image_hashing"
name = "pihash"
version = "0.1.0"
authors = ["Drew Short <warrick@sothr.com>"]

24
src/lib.rs

@ -8,3 +8,27 @@ pub fn hello(mut result: String) -> String {
result.push_str(helloworld);
result
}
/*
* Module for the tests
*/
#[cfg(test)]
mod tests {
use super::*;
use std::fs;
use std::path;
#[test]
fn can_get_test_images() {
let paths = fs::read_dir(&path::Path::new("./test_images")).unwrap();
let mut num_paths = 0;
for path in paths {
num_paths += 1;
//println!("Name: {}", path.unwrap().path().display())
}
// Currently 13 files in the test imaages directory
assert!(num_paths >= 13);
}
}

0
test_images/14095127199_e60a64e1b6_h.jpg → test_images/14095127199_e60a64e1b6_h_large.jpg

Before

Width: 1600  |  Height: 1600  |  Size: 1.1 MiB

After

Width: 1600  |  Height: 1600  |  Size: 1.1 MiB

BIN
test_images/14095127199_e60a64e1b6_h_medium.jpg

After

Width: 800  |  Height: 800  |  Size: 288 KiB

BIN
test_images/14095127199_e60a64e1b6_h_small.jpg

After

Width: 400  |  Height: 400  |  Size: 72 KiB

0
test_images/14191645299_7179d4a859_h.jpg → test_images/14191645299_7179d4a859_h_large.jpg

Before

Width: 1600  |  Height: 1600  |  Size: 1.3 MiB

After

Width: 1600  |  Height: 1600  |  Size: 1.3 MiB

BIN
test_images/14191645299_7179d4a859_h_medium.jpg

After

Width: 800  |  Height: 800  |  Size: 340 KiB

BIN
test_images/14191645299_7179d4a859_h_small.jpg

After

Width: 400  |  Height: 400  |  Size: 89 KiB

0
test_images/15720949851_c94c8b2d54_h.jpg → test_images/15720949851_c94c8b2d54_h_large.jpg

Before

Width: 1600  |  Height: 1600  |  Size: 611 KiB

After

Width: 1600  |  Height: 1600  |  Size: 611 KiB

BIN
test_images/15720949851_c94c8b2d54_h_medium.jpg

After

Width: 800  |  Height: 800  |  Size: 132 KiB

BIN
test_images/15720949851_c94c8b2d54_h_small.jpg

After

Width: 400  |  Height: 400  |  Size: 37 KiB

8
test_images/credits.txt

@ -3,11 +3,11 @@ All test images are Creative Commons Licensed
This document seeks to credit the original authors where possible
# Landscapes
14095127199_e60a64e1b6_h.jpg https://m.flickr.com/#/photos/cubagallery/14095127199/in/search_QM_q_IS_landscape_AND_w_IS_commons
15720949851_c94c8b2d54_h.jpg https://m.flickr.com/#/photos/cubagallery/15720949851/in/search_QM_q_IS_landscape_AND_w_IS_commons
14191645299_7179d4a859_h.jpg https://m.flickr.com/#/photos/cubagallery/14191645299/in/search_QM_q_IS_landscape_AND_w_IS_commons
14095127199_e60a64e1b6_h_{large,medium,small}.jpg https://m.flickr.com/#/photos/cubagallery/14095127199/in/search_QM_q_IS_landscape_AND_w_IS_commons
15720949851_c94c8b2d54_h_{large,medium,small}.jpg https://m.flickr.com/#/photos/cubagallery/15720949851/in/search_QM_q_IS_landscape_AND_w_IS_commons
14191645299_7179d4a859_h_{large,medium,small}.jpg https://m.flickr.com/#/photos/cubagallery/14191645299/in/search_QM_q_IS_landscape_AND_w_IS_commons
# Faces
# Miscellaneous
Sample_01{large,medium,small}.jpg (Creative Commons) Source Unlisted
Sample_01_{large,medium,small}.jpg (Creative Commons) Source Unlisted
Loading…
Cancel
Save