0xC0000054/libheif-sharp

Bundle libheif library in nuget package?

ziriax opened this issue ยท 4 comments

Thanks for this library! I actually started my own wrapper, using SharpGen to automatically generate most of the low-level API bindings, but you've tackled it the hard way, nice ๐Ÿ‘

Do you have a reason (maybe licensing) not to bundle the native DLLs in the nuget package, as described here?

Would you accept a PR that does this?

PS: If you are interested in my project that uses SharpGen, I'll be happy to push it to GitHub

Do you have a reason (maybe licensing) not to bundle the native DLLs in the nuget package, as described here?

There are several reasons that the libheif DLLs are not bundled.

The main one is that it would force me to update the LibHeifSharp NuGet package when each new libheif version is released.
Most of the NuGet packages that have native dependencies place those dependencies in a separate NuGet package so that they can be serviced independently of the managed code that uses them.
Also, a NuGet package would not be required for any operating system that includes the latest version of libheif in the OS package manager, e.g. many Linux distributions.

Another is that users may want libheif to be build with different features, e.g. some users may want AVIF support or only need decoding.
The libheif build I use for testing only has HEVC decoding and encoding support.

It would make sense to have a libheif NuGet package for some platforms, e.g. a libheif.Windows NuGet package that provides the 32-bit and 64-bit DLLs.

Would you accept a PR that does this?

No, for the reasons stated above.

Thanks for the feedback.

Do you have any up-to-date instructions on how to build a version of libheif.dll on Windows that will work with your library then?

The libheif github page advises to use vcpkg, but that builds version 1.7, and your library needs 1.9.

I have not yet been able to build a version that works on Windows.

Found it, I had to apply this patch to build it.

@ziriax if I build the libheif.dll and copy it to my libheif-sharp vs solution directory, there still seem to be some dependencies missing. What binaries did you add in addition to the libheif.dll? I built it with MinSizeRel x64 settings.