Skip to content

Commit fac3908

Browse files
committed
Moved Encipher back to IMagickImage.
1 parent 8f5e970 commit fac3908

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

src/Magick.NET.Core/IMagickImage.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,13 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
905905
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
906906
void Draw(IEnumerable<IDrawable> drawables);
907907

908+
/// <summary>
909+
/// Converts pixels to cipher-pixels.
910+
/// </summary>
911+
/// <param name="passphrase">The password that to encrypt the image with.</param>
912+
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
913+
void Encipher(string passphrase);
914+
908915
/// <summary>
909916
/// Applies a histogram equalization to the image.
910917
/// </summary>

src/Magick.NET.Core/IMagickImageCreateOperations.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,6 @@ public interface IMagickImageCreateOperations
446446
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
447447
void Emboss(double radius, double sigma);
448448

449-
/// <summary>
450-
/// Converts pixels to cipher-pixels.
451-
/// </summary>
452-
/// <param name="passphrase">The password that to encrypt the image with.</param>
453-
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
454-
void Encipher(string passphrase);
455-
456449
/// <summary>
457450
/// Applies a digital filter that improves the quality of a noisy image.
458451
/// </summary>

src/Magick.NET/MagickImage.CloneMutator.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,6 @@ public void Emboss()
255255
public void Emboss(double radius, double sigma)
256256
=> SetResult(NativeMagickImage.Emboss(radius, sigma));
257257

258-
public void Encipher(string passphrase)
259-
{
260-
Throw.IfNullOrEmpty(nameof(passphrase), passphrase);
261-
262-
SetResult(NativeMagickImage.Encipher(passphrase));
263-
}
264-
265258
public void Enhance()
266259
=> SetResult(NativeMagickImage.Enhance());
267260

src/Magick.NET/MagickImage.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,8 +2682,9 @@ public void Emboss(double radius, double sigma)
26822682
/// <exception cref="MagickException">Thrown when an error is raised by ImageMagick.</exception>
26832683
public void Encipher(string passphrase)
26842684
{
2685-
using var mutator = new Mutator(_nativeInstance);
2686-
mutator.Encipher(passphrase);
2685+
Throw.IfNullOrEmpty(nameof(passphrase), passphrase);
2686+
2687+
_nativeInstance.Encipher(passphrase);
26872688
}
26882689

26892690
/// <summary>

src/Magick.NET/Native/MagickImage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
386386
public partial IntPtr Emboss(double radius, double sigma);
387387

388388
[Throws]
389-
public partial IntPtr Encipher(string passphrase);
389+
public partial void Encipher(string passphrase);
390390

391391
[Throws]
392392
public partial IntPtr Enhance();

0 commit comments

Comments
 (0)