-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support a single shared libvips binary on Windows #211
Comments
Does this happen for all TIFF images? Are you able to provide a complete, standalone code sample that allows someone else to reproduce this issue? Note that there is no requirement to set the |
I think the problem has something to do with the current environment set up. Since without $VIPS_HOME etc. setup I couldn't get lib_vips to start at all giving the error DllNotFoundException on windows. I haven't tested all different types of tiff files, but with the pyramidal tiff's I have they all throw the System.AccessViolationException on windows. Here is the code that causes the error
I have the nuget packages installed including NetVips.Native and NetVips.Native.win-x64. My project uses .NET6. |
Looks like this something to do with GTKSharp or something specific to my application as I can run netvips on windows before the application launches GTKSharp. If I use NetVips before initializing GTK libvips does something which causes GTKSharp to throw various errors. Like: "Procedure start location g_regex_match_simple could not be found in dynamicly linked library C:msys64\mingw64\bin\libgtk-3.0.dll" |
I should probably open this issue in GTKSharp? Or do you know how I can fix this environmental error? Any suggestions are welcome?
|
It looks like this is a DLL conflict between the prebuilt GLib binaires provided by NetVips (i.e. Building a single shared libvips binary on Windows would probably fix this (see e.g. commit libvips/build-win64-mxe@208bd40). However, this would break compatibility with other libvips bindings and the existing shared prebuilt binaries. net-vips/src/NetVips/Interop/Libraries.Windows.cs Lines 5 to 10 in c83deb9
Linux and macOS doesn't have this issue after commit e04c6b0. |
OK I guess I will suggest that my users download the windows only version instead of GTK to use vips on windows. |
I think that's a reasonable workaround.
With .NET version 6.0 or higher, one can implement fallback logic using net-vips/src/NetVips/ModuleInitializer.cs Lines 44 to 53 in 3a5d427
But this won't work on .NET Framework. Additionally, it might be a bit too early to stop supporting .NET Standard 2.0 and Mono (see commit 3a5d427). I'll close this as "won't fix" for now, sorry. |
A release candidate of NetVips 3.0.0 and NetVips.Native 8.16.0 is now available for testing. |
NetVips v3.0.0 and NetVips.Native v8.16.0 is now available. |
Thank you so much for making this change now I can use GTK# and netvips on windows. :) |
I'm trying to use libvips using net-vips I have gotten libvips to work on Mac & Linux but on windows when trying to open a tiff file I get a System.AccessViolationException. I should have the proper environmental variables $VIPS_HOME, etc. set. Here is the error: System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Any suggestions on how to get libvips to work on windows?
The text was updated successfully, but these errors were encountered: