Replies: 3 comments 16 replies
-
Hi @lopcode, sure, I'll add a note, it looks nice. It seems to be generating off the C++ headers, is that right? I suppose (in my mind) the ideal JVM binding would target the lower-level libvips GObject API, rather as the C# binding does. It would make the whole libvips API available, wouldn't need the (often rather fragile) header parsing, and would automatically update itself for whatever libvips binary it detected at runtime, rather than being tied to a specific libvips version. I'm sure you saw https://www.libvips.org/API/current/binding.html However! That's quite a bit more work, and I can see that pragmatically your approach is easier. Thanks for letting us know! |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking, appreciate you adding a note, and for the pointer to the C# bindings. The main benefit of targeting the GObject API seems to be "automatic" updating for API changes which does sound appealing. I did see the bindings section on the website and went for something closer to the "Dynamic language with FFI" option, except I'll play around with it, thanks again 👍 |
Beta Was this translation helpful? Give feedback.
-
I've promoted the most recent build to Also discovered that JVips is quite out of date at the moment (2 years at least) - I had planned to benchmark against a recent release, but it seems there's binary compatibility issues between it and recent libvips releases. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Thanks for working on libvips!
This is just a heads up that I shipped Java/JVM libvips bindings that use Java's new FFM API (Foreign Function & Memory API) from JEP 454. The bindings are automatically generated from headers (via a new JDK tool called jextract), and then again automatically processed with some custom code. The second pass makes a "helper API" that is safer to use than the "raw" C stuff (as noted on your website), and more idiomatic for JVM systems. In theory there should be ~100% API coverage, assuming Java's generation tooling picked everything up, and updating for new libvips releases should be easy.
No doubt there are additional improvements to make, but I think things are good enough to use now. The project's over here if you'd like to take a look: https://github.com/lopcode/vips-ffm
I was wondering if you would consider signposting it on the libvips website? No problem if not, and I know there are other more mature JNI-based solutions available too. But I thought the new project might be useful for others, so wanted to reach out and ask.
Thanks again,
lopcode
Beta Was this translation helpful? Give feedback.
All reactions