2022-01-22 17:06:10 +00:00
|
|
|
|
using ImageMagick;
|
|
|
|
|
|
|
|
|
|
namespace Image
|
|
|
|
|
{
|
|
|
|
|
public class LosslessCompressor : ICompressor
|
|
|
|
|
{
|
2022-01-23 13:12:17 +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 13:12:17 +00:00
|
|
|
|
|
2022-01-22 17:06:10 +00:00
|
|
|
|
public void Compress(string fileName)
|
|
|
|
|
{
|
|
|
|
|
_imageOptimizer.LosslessCompress(fileName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|