Replace the Lensfun WebAssembly runtime with our own lens engine.
The wrapper's wasm, its 5 MB data blob and the runtime chunk were fragile to serve (CSP, MIME, cache) and pulled an LGPL runtime into the bundle just for calibration data. The Lensfun XML is now converted at build time into public/lens-db/profiles.json, and search, matching and the correction maths live in src/lib/lensDb.ts and src/lib/lensEngine.ts. Maps are pinned against output captured from the previous implementation, so results are unchanged. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -456,7 +456,7 @@ Data directory
|
||||
| `src/lib/preview16.ts` | 16-bit raw-proxy PNG parser, camera matrix and half-float conversion for the RGBA16F source texture |
|
||||
| `src/lib/softProof.ts` | ICC parsing (lut8/lut16/mAB), printer A2B/B2A round trip and the 3D proof cube |
|
||||
| `src/lib/dcp.ts` | DCP tag reader and the camera-to-sRGB matrix recipe |
|
||||
| `src/lib/lensfun.ts`, `lensNames.ts`, `lensDefaults.ts` | Lensfun client, EXIF matching, saved defaults |
|
||||
| `src/lib/lensDb.ts`, `lensEngine.ts`, `lensNames.ts`, `lensDefaults.ts` | Lens database, correction maps, EXIF matching, saved defaults |
|
||||
| `src/lib/merge.ts` | HDR / panorama / focus-stack composition |
|
||||
| `src/lib/autoMask.ts`, `noiseProfile.ts` | On-device masks and ISO-aware noise starting points |
|
||||
| `src/lib/xmp.ts` | Lightroom-compatible XMP sidecar reader/writer |
|
||||
@@ -907,22 +907,24 @@ licensed implementation.
|
||||
|
||||
## Lens profiles
|
||||
|
||||
Lens correction uses the [Lensfun](https://lensfun.github.io/) camera and lens database
|
||||
through the [`@neoanaloglabkk/lensfun-wasm`](https://github.com/lexluthor0304/LensfunWasm)
|
||||
build. Runtime assets are served from `public/lensfun/`.
|
||||
Lens correction uses the calibration data of the
|
||||
[Lensfun](https://lensfun.github.io/) camera and lens database, converted at build time
|
||||
into the compact profile file the editor ships. The correction maths is Luminary's own
|
||||
(`src/lib/lensEngine.ts`): PanoTools, poly3 and poly5 distortion, poly3 TCA and `pa`
|
||||
vignetting, evaluated in the same normalised coordinates Lensfun used. No WebAssembly
|
||||
runtime, no XML parser and no `blob:` or eval allowance is involved, and a unit test
|
||||
pins the output against maps captured from the previous implementation.
|
||||
|
||||
- **Database** — © Lensfun contributors, licensed
|
||||
[CC BY-SA 3.0 Unported](https://creativecommons.org/licenses/by-sa/3.0/), taken from
|
||||
Lensfun `data/db` at commit
|
||||
[`655a9c4`](https://github.com/lensfun/lensfun/tree/655a9c4e3e53c25bc04843c853e7e7a0121359e7/data).
|
||||
It is redistributed as bundled by the wrapper build; Luminary adds no profiles of its
|
||||
own.
|
||||
- **Library** — Lensfun is LGPL-3.0 (the bundled notice states "or later"), compiled to
|
||||
WebAssembly. Corresponding source is the upstream repository at the pinned commit plus
|
||||
the wrapper's build scripts.
|
||||
- **Bundled files** — `public/lensfun/LICENSE` is the **MIT licence of the WASM
|
||||
wrapper**, not of the database or the library. `NOTICE.md`,
|
||||
`THIRD_PARTY_LICENSES.md` and `UPSTREAM.md` record the other components and the pin.
|
||||
[`655a9c4`](https://github.com/lensfun/lensfun/tree/655a9c4e3e53c25bc04843c853e7e7a0121359e7/data)
|
||||
and converted by `scripts/build-lens-db.mjs` into `public/lens-db/profiles.json`.
|
||||
Luminary adds no profiles of its own.
|
||||
- **Engine** — `src/lib/lensDb.ts` (loading, matching, camera lookup) and
|
||||
`src/lib/lensEngine.ts` (maps, auto-scale), both MIT like the rest of the app code.
|
||||
- **Bundled files** — `public/lens-db/NOTICE.md` records the attribution and the pin;
|
||||
`public/lens-db/profiles.json` carries the same provenance in its `source` field.
|
||||
|
||||
See [Third-party attribution and licences](#third-party-attribution-and-licences) before
|
||||
redistributing the app or its container image.
|
||||
@@ -1090,15 +1092,11 @@ including Lensfun's CC BY-SA 3.0 database, which the MIT licence does not relice
|
||||
|
||||
| Component | Version / pin | Upstream | Licence | Notes |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Lensfun library | `655a9c4` | [lensfun/lensfun](https://github.com/lensfun/lensfun) | LGPL-3.0; bundled notices say "or later" | Compiled to WebAssembly; distribution needs the licence text and corresponding source |
|
||||
| Lensfun database | `655a9c4` | [lensfun `data/db`](https://github.com/lensfun/lensfun/tree/655a9c4e3e53c25bc04843c853e7e7a0121359e7/data) | CC BY-SA 3.0 Unported | © Lensfun contributors; shipped as `public/lensfun/lensfun-core.data`; attribution and share-alike apply |
|
||||
| Lensfun WASM wrapper | 0.1.3 | [lexluthor0304/LensfunWasm](https://github.com/lexluthor0304/LensfunWasm) | MIT | `public/lensfun/LICENSE` is this licence and covers neither the database nor the library |
|
||||
| Lensfun database | `655a9c4` | [lensfun `data/db`](https://github.com/lensfun/lensfun/tree/655a9c4e3e53c25bc04843c853e7e7a0121359e7/data) | CC BY-SA 3.0 Unported | © Lensfun contributors; shipped as `public/lens-db/profiles.json`; attribution and share-alike apply to the data only |
|
||||
| LibRaw | via `libraw-wasm` 1.6.0 | [LibRaw/LibRaw](https://github.com/LibRaw/LibRaw) | LGPL-2.1 **or** CDDL-1.0 (dual) | The decoder compiled into the WASM |
|
||||
| `libraw-wasm` | 1.6.0 | [ybouane/LibRaw-Wasm](https://github.com/ybouane/LibRaw-Wasm) | ISC | Binding layer only; its metadata does not replace LibRaw's terms for the compiled library |
|
||||
| `sharp` | 0.35.5 | [lovell/sharp](https://github.com/lovell/sharp) | Apache-2.0 | Prebuilt binaries bundle libvips |
|
||||
| libvips | bundled by `sharp` | [libvips/libvips](https://github.com/libvips/libvips) | LGPL-2.1-or-later | Applies when distributing binaries or container images |
|
||||
| tinyxml2 | bundled in Lensfun WASM | [leethomason/tinyxml2](https://github.com/leethomason/tinyxml2) | zlib | |
|
||||
| utf8proc | bundled in Lensfun WASM | [JuliaStrings/utf8proc](https://github.com/JuliaStrings/utf8proc) | MIT | |
|
||||
| `exifr` | 7.1.3 | [MikeKovarik/exifr](https://github.com/MikeKovarik/exifr) | MIT | Browser EXIF parsing |
|
||||
| `nodemailer` | 10.6.1 | [nodemailer](https://github.com/nodemailer/nodemailer) | MIT-0 | SMTP notifications |
|
||||
| React / React DOM | 18.3.1 | [facebook/react](https://github.com/facebook/react) | MIT | |
|
||||
@@ -1122,18 +1120,15 @@ Creative Commons content licence, and it grants neither patent nor trademark rig
|
||||
|
||||
### Redistribution checklist
|
||||
|
||||
`public/lensfun/` currently ships the notices (`NOTICE.md`, `THIRD_PARTY_LICENSES.md`,
|
||||
`UPSTREAM.md`) and the wrapper's MIT `LICENSE`, but **not** the full LGPL-3.0 or
|
||||
CC BY-SA 3.0 texts. Before distributing Luminary or its container image:
|
||||
`public/lens-db/` currently ships the converted data and `NOTICE.md`, but **not** the
|
||||
full CC BY-SA 3.0 text. Before distributing Luminary or its container image:
|
||||
|
||||
1. Add the upstream licence texts beside the assets: Lensfun `COPYING` and
|
||||
`COPYING.LESSER` (the LGPL incorporates GPL-3.0 by reference), and
|
||||
`data/COPYING.CC_BY-SA_3.0` for the database.
|
||||
2. Keep the notices, the pinned commit and the attribution block above in the distributed
|
||||
copy, served from `public/lensfun/` as they are today.
|
||||
3. Provide corresponding source for the LGPL components: Lensfun and LibRaw at the
|
||||
versions actually built, plus tinyxml2 and utf8proc. Leave
|
||||
`dist/lensfun/lensfun-core.wasm` and its JS loader replaceable.
|
||||
1. Add the upstream licence text beside the data: Lensfun
|
||||
`data/COPYING.CC_BY-SA_3.0`.
|
||||
2. Keep the notice, the pinned commit and the attribution block above in the distributed
|
||||
copy, served from `public/lens-db/` as it is today.
|
||||
3. Provide corresponding source for the LGPL components still shipped: LibRaw at the
|
||||
version actually built.
|
||||
4. When publishing a container image, include the same files and the libvips, Node.js and
|
||||
Debian notices.
|
||||
5. Do not relicense third-party assets under Luminary's own terms, and do not add
|
||||
|
||||
Reference in New Issue
Block a user