From ecdf8f59602b7a8cd859ad090f781d3e3c20733f Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Mon, 9 Sep 2024 03:24:12 +0100 Subject: [PATCH] Rename flip orientations to make them more explicit --- src/dynimage.rs | 4 ++-- src/orientation.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dynimage.rs b/src/dynimage.rs index 139e937f03..b85bf4b0ac 100644 --- a/src/dynimage.rs +++ b/src/dynimage.rs @@ -931,8 +931,8 @@ impl DynamicImage { Orientation::Rotate90 => Ok(*image = image.rotate90()), Orientation::Rotate180 => Ok(image.rotate180_in_place()), Orientation::Rotate270 => Ok(*image = image.rotate270()), - Orientation::FlipH => Ok(image.fliph_in_place()), - Orientation::FlipV => Ok(image.flipv_in_place()), + Orientation::FlipHorizontal => Ok(image.fliph_in_place()), + Orientation::FlipVertical => Ok(image.flipv_in_place()), Orientation::Rotate90FlipH => { let mut new_image = image.rotate90(); new_image.fliph_in_place(); diff --git a/src/orientation.rs b/src/orientation.rs index 80dd85e3c7..a1690e9889 100644 --- a/src/orientation.rs +++ b/src/orientation.rs @@ -13,9 +13,9 @@ pub enum Orientation { /// Rotate by 90 degrees clockwise. Rotate270, /// Flip horizontally. Can be performed in-place. - FlipH, + FlipHorizontal, /// Flip vertically. Can be performed in-place. - FlipV, + FlipVertical, /// Rotate by 90 degrees clockwise and flip horizontally. Rotate90FlipH, /// Rotate by 270 degrees clockwise and flip horizontally. @@ -27,9 +27,9 @@ impl Orientation { pub fn from_exif(exif_orientation: u8) -> Option { match exif_orientation { 1 => Some(Self::NoTransforms), - 2 => Some(Self::FlipH), + 2 => Some(Self::FlipHorizontal), 3 => Some(Self::Rotate180), - 4 => Some(Self::FlipV), + 4 => Some(Self::FlipVertical), 5 => Some(Self::Rotate90FlipH), 6 => Some(Self::Rotate90), 7 => Some(Self::Rotate90FlipH),