diff --git a/Cargo.toml b/Cargo.toml index 23d98b2..df0ce49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "perceptual_image_hashing" +name = "pihash" version = "0.1.0" authors = ["Drew Short "] diff --git a/src/lib.rs b/src/lib.rs index 531ce48..001317f 100644 --- a/src/lib.rs +++ b/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); + } + +} diff --git a/test_images/14095127199_e60a64e1b6_h.jpg b/test_images/14095127199_e60a64e1b6_h_large.jpg similarity index 100% rename from test_images/14095127199_e60a64e1b6_h.jpg rename to test_images/14095127199_e60a64e1b6_h_large.jpg diff --git a/test_images/14095127199_e60a64e1b6_h_medium.jpg b/test_images/14095127199_e60a64e1b6_h_medium.jpg new file mode 100644 index 0000000..cca4f4a Binary files /dev/null and b/test_images/14095127199_e60a64e1b6_h_medium.jpg differ diff --git a/test_images/14095127199_e60a64e1b6_h_small.jpg b/test_images/14095127199_e60a64e1b6_h_small.jpg new file mode 100644 index 0000000..399002e Binary files /dev/null and b/test_images/14095127199_e60a64e1b6_h_small.jpg differ diff --git a/test_images/14191645299_7179d4a859_h.jpg b/test_images/14191645299_7179d4a859_h_large.jpg similarity index 100% rename from test_images/14191645299_7179d4a859_h.jpg rename to test_images/14191645299_7179d4a859_h_large.jpg diff --git a/test_images/14191645299_7179d4a859_h_medium.jpg b/test_images/14191645299_7179d4a859_h_medium.jpg new file mode 100644 index 0000000..5d67d72 Binary files /dev/null and b/test_images/14191645299_7179d4a859_h_medium.jpg differ diff --git a/test_images/14191645299_7179d4a859_h_small.jpg b/test_images/14191645299_7179d4a859_h_small.jpg new file mode 100644 index 0000000..8cd7e12 Binary files /dev/null and b/test_images/14191645299_7179d4a859_h_small.jpg differ diff --git a/test_images/15720949851_c94c8b2d54_h.jpg b/test_images/15720949851_c94c8b2d54_h_large.jpg similarity index 100% rename from test_images/15720949851_c94c8b2d54_h.jpg rename to test_images/15720949851_c94c8b2d54_h_large.jpg diff --git a/test_images/15720949851_c94c8b2d54_h_medium.jpg b/test_images/15720949851_c94c8b2d54_h_medium.jpg new file mode 100644 index 0000000..1a1ad7f Binary files /dev/null and b/test_images/15720949851_c94c8b2d54_h_medium.jpg differ diff --git a/test_images/15720949851_c94c8b2d54_h_small.jpg b/test_images/15720949851_c94c8b2d54_h_small.jpg new file mode 100644 index 0000000..e9f31e2 Binary files /dev/null and b/test_images/15720949851_c94c8b2d54_h_small.jpg differ diff --git a/test_images/credits.txt b/test_images/credits.txt index d8793ec..40c61a0 100644 --- a/test_images/credits.txt +++ b/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