@@ -2520,7 +2520,10 @@ public void Decipher(string passphrase)
25202520 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
25212521 /// <returns>The angle that was used.</returns>
25222522 public double Deskew ( Percentage threshold )
2523- => Deskew ( threshold , autoCrop : false ) ;
2523+ {
2524+ using var mutator = new Mutator ( _nativeInstance ) ;
2525+ return mutator . Deskew ( threshold ) ;
2526+ }
25242527
25252528 /// <summary>
25262529 /// Removes skew from the image. Skew is an artifact that occurs in scanned images because of
@@ -2532,7 +2535,10 @@ public double Deskew(Percentage threshold)
25322535 /// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
25332536 /// <returns>The angle that was used.</returns>
25342537 public double DeskewAndCrop ( Percentage threshold )
2535- => Deskew ( threshold , autoCrop : true ) ;
2538+ {
2539+ using var mutator = new Mutator ( _nativeInstance ) ;
2540+ return mutator . DeskewAndCrop ( threshold ) ;
2541+ }
25362542
25372543 /// <summary>
25382544 /// Despeckle image (reduce speckle noise).
@@ -7293,20 +7299,6 @@ private MagickReadSettings CreateReadSettings(IMagickReadSettings<QuantumType>?
72937299 return newReadSettings ;
72947300 }
72957301
7296- private double Deskew ( Percentage threshold , bool autoCrop )
7297- {
7298- using var temporaryDefines = new TemporaryDefines ( this ) ;
7299- temporaryDefines . SetArtifact ( "deskew:auto-crop" , autoCrop ) ;
7300-
7301- _nativeInstance . Deskew ( PercentageHelper . ToQuantum ( nameof ( threshold ) , threshold ) ) ;
7302-
7303- var artifact = GetArtifact ( "deskew:angle" ) ;
7304- if ( ! double . TryParse ( artifact , NumberStyles . Any , CultureInfo . InvariantCulture , out var result ) )
7305- return 0.0 ;
7306-
7307- return result ;
7308- }
7309-
73107302 private void Dispose ( bool disposing )
73117303 {
73127304 DisposeInstance ( ) ;
0 commit comments