Replies: 1 comment
-
Thanks for raising this - I read it but forgot to reply. The native library loading is a real pain. It is theoretically possible (as you showed) to add something that checks common macOS locations for libraries, but that feels quite prone to weird bugs if users have (for example) multiple libraries with different versions. I'm more inclined to ship a module with libvips built for common platforms. And then users have an option for using the library knowing that it's ABI-compatible with the libvips version provided. And, if they don't want that, they could just not include the module with the download. I still need to figure out if that's possible - in my head, it might look something like:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for starting this project, really great to have an easy way to have access to libvips on the jvm!
Bumped into some minor usability issues while trying out the vips-ffm, which are mostly related to macOS SIP changes and how it interfers with
DYLIB_LIBRARY_PATH
.It is challenging to have a jvm project be able to set dynamically DYLIB_LIBRARY_PATH depending on the configuration, moreover it doesn't work when trying to run a unit test in Intellij IDEA either.
That's not the fault of vips-ffm here, but clearly macOs
To work around this usability issue and have a simple consistent behavior across mac platform (apple silicon, intel) and package managers (brew, fink, macports), I implemented a simple scan logic that sets up the system property in order to override the current lookup mechanism before calling Vips.init()
This will not work with a security manager, but I'm not running with any and this is the easiest workaround, but it feels like it is maybe something that could be done within the existing code.
In case this is useful for someone, here is a sample snippet of Java code that should help to run vips-ffm consistently on mac
I feel like maybe modifying the current library lookup mechanism to be able to cycle on well known locations could help (at least for mac) and will make it more flexible and usable in a variety of configurations. it will also avoid users creating additional code like above, or hardcoding. See thumbnail-fixer.
Beta Was this translation helpful? Give feedback.
All reactions