-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak README intro and sample output (#18)
- Loading branch information
Showing
1 changed file
with
25 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,48 @@ | ||
# vips-ffm | ||
|
||
A thin wrapper to let Java/JVM projects use [libvips](https://github.com/libvips/libvips), via the | ||
"Foreign Function & Memory API" ([JEP 454](https://openjdk.org/jeps/454)) released in JDK 22. | ||
[libvips](https://github.com/libvips/libvips) bindings for JVM projects, using the "Foreign Function & Memory API" | ||
([JEP 454](https://openjdk.org/jeps/454)) released in JDK 22. The combination of libvips and FFM makes for performant, safe, and ergonomic image | ||
manipulation in JVM systems, supporting a vast range of image formats, including HEIC, JXL, WebP, PNG, JPEG, and more. | ||
Pronounced "vips (like zips) eff-eff-emm". | ||
|
||
Incubating in [Photo Fox](https://github.com/lopcode/photo-fox). Pronounced "vips (like hips) eff-eff-emm". | ||
Bindings are automatically generated using `jextract`, and enhanced with some helpful wrapper functions to make usage | ||
more idiomatic. | ||
|
||
Incubating in [Photo Fox](https://github.com/lopcode/photo-fox). | ||
|
||
## Project goals | ||
|
||
* Publish to GitHub Packages via Gradle, so that using the library is as easy as | ||
`implementation("app.photofox:vips-ffm-core:$version")` | ||
* Automate as much as possible, including API generation via `jextract`, so upstream changes can be rapidly integrated | ||
* Core module should only include this automated output, with a minimum of extra things that can break as ImageMagick | ||
changes | ||
`implementation("app.photofox:vips-ffm-core:$version")` (TODO) | ||
* Automate as much as possible, including API generation via [jextract](https://github.com/openjdk/jextract), so | ||
upstream changes can be rapidly integrated ✅ | ||
* Core module should only include this automated output, with a minimum of extra things that can break as upstreams | ||
change ✅ | ||
* If helpers are required, publish in another artifact | ||
* Incubate in Photo Fox with some "real world" usage | ||
|
||
## Proof of concept | ||
## Samples | ||
|
||
Samples are included that show various usages of the `libvips` bindings. They include validations, and run on GitHub | ||
Actions to validate new versions during development. | ||
|
||
This project includes a proof of concept that only runs on macOS. To run it: | ||
To get set up to run samples (on macOS): | ||
* `brew install vips` | ||
* `sdk use java 22-open` | ||
* `./setup_lib_symlinks.sh` | ||
* (Optional, to regenerate bindings) `./generate_ffm_bindings.sh` | ||
* Run `VipsFfm` in IntelliJ to run samples and validations | ||
|
||
### Example output | ||
* Then either: | ||
* Run `./run_samples.sh` in your terminal | ||
* Run `VipsFfm` in IntelliJ to run samples and validations | ||
|
||
``` | ||
[main] INFO vipsffm.VipsFfm - clearing sample run directory at path "sample_run" | ||
[main] INFO vipsffm.VipsFfm - running sample "GetVersionSample"... | ||
[main] INFO vipsffm.GetVersionSample - libvips version: "8.15.2" | ||
[main] INFO vipsffm.VipsFfm - validation succeeded ✅ | ||
[main] INFO vipsffm.VipsFfm - running sample "CreateThumbnailSample"... | ||
[main] INFO vipsffm.GetVersionSample - source image size: 2490 x 3084 | ||
[main] INFO vipsffm.GetVersionSample - output image size: 323 x 400 | ||
[main] INFO vipsffm.VipsFfm - validation succeeded ✅ | ||
[main] INFO vipsffm.VipsFfm - all samples ran successfully 🎉 | ||
``` |