@@ -2424,7 +2424,10 @@ public void CopyPixels(IMagickImage source, IMagickGeometry geometry, int x, int
24242424 /// <param name="height">The height of the subregion to crop.</param>
24252425 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
24262426 public void Crop ( uint width , uint height )
2427- => Crop ( width , height , Gravity . Undefined ) ;
2427+ {
2428+ using var mutator = new Mutator ( _nativeInstance ) ;
2429+ mutator . Crop ( width , height ) ;
2430+ }
24282431
24292432 /// <summary>
24302433 /// Crop image (subregion of original image). <see cref="ResetPage"/> should be called unless
@@ -2435,7 +2438,10 @@ public void Crop(uint width, uint height)
24352438 /// <param name="gravity">The position where the cropping should start from.</param>
24362439 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
24372440 public void Crop ( uint width , uint height , Gravity gravity )
2438- => Crop ( new MagickGeometry ( 0 , 0 , width , height ) , gravity ) ;
2441+ {
2442+ using var mutator = new Mutator ( _nativeInstance ) ;
2443+ mutator . Crop ( width , height , gravity ) ;
2444+ }
24392445
24402446 /// <summary>
24412447 /// Crop image (subregion of original image). <see cref="ResetPage"/> should be called unless
@@ -2444,7 +2450,10 @@ public void Crop(uint width, uint height, Gravity gravity)
24442450 /// <param name="geometry">The subregion to crop.</param>
24452451 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
24462452 public void Crop ( IMagickGeometry geometry )
2447- => Crop ( geometry , Gravity . Undefined ) ;
2453+ {
2454+ using var mutator = new Mutator ( _nativeInstance ) ;
2455+ mutator . Crop ( geometry ) ;
2456+ }
24482457
24492458 /// <summary>
24502459 /// Crop image (subregion of original image). <see cref="ResetPage"/> should be called unless
@@ -2455,9 +2464,8 @@ public void Crop(IMagickGeometry geometry)
24552464 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
24562465 public void Crop ( IMagickGeometry geometry , Gravity gravity )
24572466 {
2458- Throw . IfNull ( nameof ( geometry ) , geometry ) ;
2459-
2460- _nativeInstance . Crop ( geometry . ToString ( ) , gravity ) ;
2467+ using var mutator = new Mutator ( _nativeInstance ) ;
2468+ mutator . Crop ( geometry , gravity ) ;
24612469 }
24622470
24632471 /// <summary>
0 commit comments