mirror of
https://codeberg.org/JasterV/Image-Processing-CLI.git
synced 2026-04-26 18:10:07 +00:00
Rotate implemented
Now the user can rotate the image 90|180|270 degrees
This commit is contained in:
parent
3e176fa9cb
commit
117243634a
2 changed files with 12 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -13,3 +13,5 @@ Cargo.lock
|
||||||
# Added by cargo
|
# Added by cargo
|
||||||
|
|
||||||
/target
|
/target
|
||||||
|
|
||||||
|
/mock
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,15 @@ fn edit_photo(mut image: DynamicImage, matches: &ArgMatches) -> DynamicImage {
|
||||||
if let Some(degrees) = matches.value_of("huerotate") {
|
if let Some(degrees) = matches.value_of("huerotate") {
|
||||||
image = image.huerotate(degrees.parse().unwrap());
|
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
|
// GRAY SCALE
|
||||||
if matches.is_present("grayscale") {
|
if matches.is_present("grayscale") {
|
||||||
image = image.grayscale();
|
image = image.grayscale();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue