Beginner question

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
mfranquelo
Posts: 7
Joined: 2017-08-05T07:14:10-07:00
Authentication code: 1151

Beginner question

Post 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.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Beginner question

Post by dlemstra »

It looks like you are trying to load a 64 bit library in a 32 bit process.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
mfranquelo
Posts: 7
Joined: 2017-08-05T07:14:10-07:00
Authentication code: 1151

Re: Beginner question

Post by mfranquelo »

Thank you dlemstra,

It worked.
Post Reply