Skip to content

Commit fb84acd

Browse files
committed
Moved Minify to IMagickImageCreateOperations.
1 parent d4a8944 commit fb84acd

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,12 +1322,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
13221322
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
13231323
void MedianFilter(uint radius);
13241324

1325-
/// <summary>
1326-
/// Reduce image by integral size.
1327-
/// </summary>
1328-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
1329-
void Minify();
1330-
13311325
/// <summary>
13321326
/// Returns the points that form the minimum bounding box around the image foreground objects with
13331327
/// the "Rotating Calipers" algorithm. he method also returns these properties: minimum-bounding-box:area,

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ public interface IMagickImageCreateOperations
724724
/// <param name="colorDistance">The color distance.</param>
725725
void MeanShift(uint width, uint height, Percentage colorDistance);
726726

727+
/// <summary>
728+
/// Reduce image by integral size.
729+
/// </summary>
730+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
731+
void Minify();
732+
727733
/// <summary>
728734
/// Resize image to specified size.
729735
/// <para />

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ public void MeanShift(uint width, uint height)
398398
public void MeanShift(uint width, uint height, Percentage colorDistance)
399399
=> SetResult(NativeMagickImage.MeanShift(width, height, PercentageHelper.ToQuantum(nameof(colorDistance), colorDistance)));
400400

401+
public void Minify()
402+
=> SetResult(NativeMagickImage.Minify());
403+
401404
public void LiquidRescale(Percentage percentageWidth, Percentage percentageHeight, double deltaX, double rigidity)
402405
{
403406
var geometry = new MagickGeometry(percentageWidth, percentageHeight);

src/Magick.NET/MagickImage.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4126,7 +4126,10 @@ public void MedianFilter(uint radius)
41264126
/// </summary>
41274127
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
41284128
public void Minify()
4129-
=> _nativeInstance.Minify();
4129+
{
4130+
using var mutator = new Mutator(_nativeInstance);
4131+
mutator.Minify();
4132+
}
41304133

41314134
/// <summary>
41324135
/// Returns the points that form the minimum bounding box around the image foreground objects with

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
523523
public partial IntPtr MeanShift(nuint width, nuint height, double colorDistance);
524524

525525
[Throws]
526-
[SetInstance]
527-
public partial void Minify();
526+
public partial IntPtr Minify();
528527

529528
[Throws]
530529
[Cleanup(Name = "ImageMagick.Moments.DisposeList")]

0 commit comments

Comments
 (0)