2

I'm trying to read and convert JP2 images using the FreeImage accepted answer from this question but getting a 0 byte JOEG file. When I step through I see that the line

FIBITMAP dib = FreeImage.LoadEx(inputImage)

is returning 0 in dib. Is there anything I'm missing.

Community
  • 1
  • 1
Raj
  • 1,742
  • 1
  • 12
  • 17

1 Answers1

0

At the first time you do any thing, add:

if (FreeImage.IsAvailable())
{
    MessageBox.Show("Exits");
}

if this messageBox is showed, that means you were successful in adding this Library into your app. if No, that means if fails. Please check:

  1. If your app is developing base x32, FreeImage.dll and FreeImage.NET.dll must be builded base x32.
  2. the FreeImage.dll and FreeImage.NET.dll must be in same folder with your .exe file. you should add references to FreeImageNet.dll.

I had meet same problem and solved. hope this help.

Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101