This project has moved and is read-only. For the latest updates, please go here.


Feb 10, 2016 at 12:12 PM
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.!
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);

            Console.WriteLine("Bytes after: " + birds.Length);

Feb 10, 2016 at 12:28 PM
Are you using the latest version of Magick.NET? I am guessing that you are using the AnyCPU build? Can you post the exception that is being raised?