Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Magick.NET.Core/IMagickImageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public partial interface IMagickImageInfo
/// </summary>
int Width { get; }

/// <summary>
/// Gets the orientation of the image.
/// </summary>
OrientationType Orientation { get; }

/// <summary>
/// Read basic information about an image.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions src/Magick.NET/MagickImageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ public MagickImageInfo(Stream stream, IMagickReadSettings<QuantumType>? readSett
/// </summary>
public int Width { get; private set; }

/// <summary>
/// Gets the orientation of the image.
/// </summary>
public OrientationType Orientation { get; private set; }

/// <summary>
/// Read basic information about an image with multiple frames/pages.
/// </summary>
Expand Down Expand Up @@ -439,5 +444,6 @@ private void Initialize(IMagickImage<QuantumType> image)
Interlace = image.Interlace;
Quality = image.Quality;
Width = image.Width;
Orientation = image.Orientation;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void ShouldReturnTheCorrectInformation()
Assert.Equal(Interlace.NoInterlace, first.Interlace);
Assert.Equal(827, first.Width);
Assert.Equal(0, first.Quality);
Assert.Equal(OrientationType.TopLeft, first.Orientation);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public void ShouldReturnTheCorrectInformation()
Assert.Equal(Interlace.NoInterlace, imageInfo.Interlace);
Assert.Equal(100, imageInfo.Quality);
Assert.Equal(123, imageInfo.Width);
Assert.Equal(OrientationType.Undefined, imageInfo.Orientation);
}
}

Expand Down