ImgMetadataRemover/ImageCore/LosslessCompressor.cs

26 lines
677 B
C#
Raw Normal View History

2022-01-22 17:06:10 +00:00
using ImageMagick;
namespace Image
{
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
{
public static readonly LosslessCompressor Instance = new();
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);
}
}
}