Skip to content

Commit fda09a0

Browse files
committed
Moved AutoOrient to IMagickImageCreateOperations.
1 parent 8c4cca7 commit fda09a0

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
323323
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
324324
void AutoLevel(Channels channels);
325325

326-
/// <summary>
327-
/// Adjusts an image so that its orientation is suitable for viewing.
328-
/// </summary>
329-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
330-
void AutoOrient();
331-
332326
/// <summary>
333327
/// Automatically selects a threshold and replaces each pixel in the image with a black pixel if
334328
/// the image intentsity is less than the selected threshold otherwise white.

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ public interface IMagickImageCreateOperations
186186
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
187187
void AffineTransform(IDrawableAffine affineMatrix);
188188

189+
/// <summary>
190+
/// Adjusts an image so that its orientation is suitable for viewing.
191+
/// </summary>
192+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
193+
void AutoOrient();
194+
189195
/// <summary>
190196
/// Resize image to specified size.
191197
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ public void AffineTransform(IDrawableAffine affineMatrix)
9999
SetResult(NativeMagickImage.AffineTransform(affineMatrix.ScaleX, affineMatrix.ScaleY, affineMatrix.ShearX, affineMatrix.ShearY, affineMatrix.TranslateX, affineMatrix.TranslateY));
100100
}
101101

102+
public void AutoOrient()
103+
=> SetResult(NativeMagickImage.AutoOrient());
104+
102105
public void Resize(uint width, uint height)
103106
=> Resize(new MagickGeometry(width, height));
104107

src/Magick.NET/MagickImage.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using System.IO;
1010
using System.Linq;
1111
using System.Threading;
12-
using System.Threading.Channels;
1312
using System.Threading.Tasks;
1413
using ImageMagick.Drawing;
1514

@@ -1249,7 +1248,10 @@ public void AutoLevel(Channels channels)
12491248
/// </summary>
12501249
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
12511250
public void AutoOrient()
1252-
=> _nativeInstance.AutoOrient();
1251+
{
1252+
using var mutator = new Mutator(_nativeInstance);
1253+
mutator.AutoOrient();
1254+
}
12531255

12541256
/// <summary>
12551257
/// Automatically selects a threshold and replaces each pixel in the image with a black pixel if

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
257257
public partial void AutoLevel(Channels channels);
258258

259259
[Throws]
260-
[SetInstance]
261-
public partial void AutoOrient();
260+
public partial IntPtr AutoOrient();
262261

263262
[Throws]
264263
public partial void AutoThreshold(AutoThresholdMethod method);

0 commit comments

Comments
 (0)