Skip to content

Commit

Permalink
Rename flip orientations to make them more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnatsel committed Sep 9, 2024
1 parent 92d2ec2 commit ecdf8f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/dynimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions src/orientation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -27,9 +27,9 @@ impl Orientation {
pub fn from_exif(exif_orientation: u8) -> Option<Self> {
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),
Expand Down

0 comments on commit ecdf8f5

Please sign in to comment.