Hi, I have problem with ImageOptimizer. I'm doing almost the same process here but I get this error:
An unhandled exception of type 'System.TypeInitializationException' occurred in Magick.NET-Q8-x86.dll
Additional information: The type initializer for 'ImageMagick.MagickFormatInfo' threw an exception.
Any help would be appreciated Thanks.!
An unhandled exception of type 'System.TypeInitializationException' occurred in Magick.NET-Q8-x86.dll
Additional information: The type initializer for 'ImageMagick.MagickFormatInfo' threw an exception.
Any help would be appreciated Thanks.!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Drawing;
namespace LosslesImageCompression
{
static class Program
{
static void Main(string[] args)
{
FileInfo birds = new FileInfo("C:\\dev\\workspaces\\visual studio\\Staj 2016\\HSV\\image\\birds.jpg");
ImageMagick.ImageOptimizer optimizer = new ImageMagick.ImageOptimizer();
Console.WriteLine("Bytes before: "+birds.Length);
optimizer.LosslessCompress(birds);
birds.Refresh();
Console.WriteLine("Bytes after: " + birds.Length);
}
}
}