Page 1 of 1

Beginner question

Posted: 2017-08-05T07:18:03-07:00
by mfranquelo
Dear all,

I've just started playing with C# and Magick.Net but i am getting the following error when trying to read parameters of a file. Magick.Net was installed using NuGet on Visual studio 2013. Initialized.

This is my code:

using (MagickImage image = new MagickImage(@"D:\test01.jpg"))
{
// Reading file info
MagickImageInfo info = new MagickImageInfo(@"D:\test01.jpg");
Console.WriteLine(info.Width);
Console.WriteLine(info.Height);
Console.WriteLine(info.ColorSpace);
Console.WriteLine(info.Format);
Console.WriteLine(info.Density.X);
Console.WriteLine(info.Density.Y);
Console.WriteLine(info.Density.Units);
}

An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'Magick.NET-Q16-x64, Version=7.0.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec' or one of its dependencies. An attempt was made to load a program with an incorrect format.


I am sure it is something very simple, but i can't seem to figure it out.

Best,
Manuel.

Re: Beginner question

Posted: 2017-08-06T03:00:29-07:00
by dlemstra
It looks like you are trying to load a 64 bit library in a 32 bit process.

Re: Beginner question

Posted: 2017-08-06T04:29:11-07:00
by mfranquelo
Thank you dlemstra,

It worked.