2

Throw Nuget Package Manager, I've downloaded this version of FreeImage that seems to be the easyer version to use. The version name is : VVVV.FreeImage
The link : https://www.nuget.org/packages/VVVV.FreeImage/
When I try to use the library I have a DllNotFoundException.
Here is some code :

using FreeImageAPI;

namespace MySoft
{
    public partial class MainWindow : Window
    { 
        public MainWindow()
        {
            FIBITMAP dibSource = FreeImage.Load(FREE_IMAGE_FORMAT.FIF_JPEG, "test", FREE_IMAGE_LOAD_FLAGS.JPEG_ACCURATE);
        }
    }
}

I get the code error : HRESULT : 0x8007007E
Thank You

betsou
  • 143
  • 3
  • 16
  • 1
    I assume the package is broken and does not install the native dependencies, try to install manually this package: https://www.nuget.org/packages/native.freeimage.redist/ – Gusman May 04 '17 at 15:26
  • Got this error : 'Erreur Impossible d’installer le package « native.freeimage.redist 3.17.0 ». Vous essayez d’installer ce package dans un projet ciblant « .NETFramework,Version=v4.5.2 », mais le package ne contient aucun fichier de contenu ou référence d’assembly compatible avec cette infrastructure. Pour plus d’informations, contactez le créateur du package.' Sorry for the French – betsou May 04 '17 at 15:40
  • 1
    Nice, now hire a translater and may be someone will understand the error. – Gusman May 04 '17 at 15:41
  • Impossible to instal the package « native.freeimage.redist 3.17.0 ». You try to instal it in a project that aim « .NETFramework,Version=v4.5.2 », but the package does not contain any file of content or assembly reference compatible with this infrastructure. For more information contact tje creator of this package. – betsou May 04 '17 at 16:14
  • 1
    Ok, if that NuGet package does not work then try to download the binary DLL and add it to your project (it must be copied with your project's binaries): http://freeimage.sourceforge.net/download.html Download 'FreeImage DLL' – Gusman May 04 '17 at 16:16
  • When adding the DLL, I got an error, a reference to (path of the DLL) hadn't been added. Verify file is accessible and that it's an assemply or valid COM component... And I don't know which one to add, the 32 or the 64 Bit – betsou May 09 '17 at 14:39
  • 2
    No, you don't need to add a reference to these libraries, they aren't managed DLL's so you can't add a reference, you must add the files to the project, and once added set "Copy to Output Directory" to "Copy Always" or "Copy if Newer" on the file's properties. And about using the x32 or x64... it depends on your program, if you compile as "Any CPU" with the "prefer 32 bits" option or as x86 then include the 32 bits one, in other case the 64 bits one. – Gusman May 10 '17 at 11:19
  • did you manage to solve this? – DanielV Sep 18 '19 at 08:15
  • 1
    Yes, the sourceforge version of free image worked fine, but I had to marshall every function (since I remember) – betsou Sep 23 '19 at 09:16

0 Answers0