ImgMetadataRemover/ImageCore/Core/LosslessCompressor.cs

26 lines
701 B
C#
Raw Normal View History

2022-01-22 17:06:10 +00:00
using ImageMagick;
namespace Image.Core
2022-01-22 17:06:10 +00:00
{
2022-01-23 17:30:05 +00:00
/// <summary>
/// LosslessCompressor compresses an image using lossless compression provided by ImageMagick.
/// </summary>
2022-01-22 17:06:10 +00:00
public class LosslessCompressor : ICompressor
{
2022-01-27 21:22:10 +00:00
public static readonly LosslessCompressor Instance = new LosslessCompressor();
2022-01-22 17:06:10 +00:00
private readonly ImageOptimizer _imageOptimizer;
public LosslessCompressor()
{
_imageOptimizer = new ImageOptimizer();
}
2022-01-23 17:30:05 +00:00
/// <summary>
/// <inheritdoc />
/// </summary>
2022-01-22 17:06:10 +00:00
public void Compress(string fileName)
{
_imageOptimizer.LosslessCompress(fileName);
}
}
}