From c7dde38c982fa7922017ef933e9fc8799f8706bd Mon Sep 17 00:00:00 2001 From: carrot <149851+lopcode@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:07:30 +0100 Subject: [PATCH] Tweak README intro and sample output --- README.md | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 962128c..e36f7e3 100644 --- a/README.md +++ b/README.md @@ -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 🎉 ```