diff --git a/.gitignore b/.gitignore index 22d3516..1ce1458 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ Cargo.lock # Added by cargo /target + +/mock diff --git a/src/main.rs b/src/main.rs index 4e15a22..9cee115 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use lib::cli; fn main() { let matches = cli::build_cli().get_matches(); - + let input = matches.value_of("INPUT").unwrap(); let output = matches.value_of("OUTPUT").unwrap(); @@ -41,6 +41,15 @@ fn edit_photo(mut image: DynamicImage, matches: &ArgMatches) -> DynamicImage { if let Some(degrees) = matches.value_of("huerotate") { image = image.huerotate(degrees.parse().unwrap()); } + // ROTATE IMAGE + if let Some(degrees) = matches.value_of("rotate") { + match degrees { + "90" => image = image.rotate90(), + "180" => image = image.rotate180(), + "270" => image = image.rotate270(), + _ => {} + } + } // GRAY SCALE if matches.is_present("grayscale") { image = image.grayscale();