# wvips licence notices

`wvips.wasm` and `wvips.js` statically link libvips, its delegate libraries
and Emscripten's runtime. This directory carries each component's upstream
licence and notice files, verbatim, so that every copy of the binary carries
them too. If you serve `wvips.wasm` from a site or bundle it into an app, ship
this directory with it, or link to it from your own notices page.

This is a summary for compliance, not legal advice.

## What the package is licensed under

- **wvips's own code** (the TypeScript wrapper in `dist/*.js`, the C bindings
  and the build tooling) is Apache-2.0. See `LICENSE` at the package root.
- **The wasm binary** is a combined work. Each statically linked component
  keeps its own licence, listed below. The `license` field in `package.json`
  is the SPDX conjunction of all of them.

| Component | Version | Licence (SPDX) | Notice files here |
|---|---|---|---|
| libvips | 8.18.2 | LGPL-2.1-or-later | `libvips-LICENSE.txt` |
| glib | 2.88.0 | LGPL-2.1-or-later | `glib-COPYING.txt` |
| libexif | 0.6.26 | LGPL-2.1-or-later | `libexif-COPYING.txt` |
| libheif | git 4652161 | LGPL-3.0-or-later | `libheif-COPYING.txt` |
| zlib-ng | 2.3.3 | Zlib | `zlib-ng-LICENSE.txt` |
| libarchive | 3.8.9 | BSD-2-Clause | `libarchive-COPYING.txt` |
| libffi | 3.5.2 | MIT | `libffi-LICENSE.txt` |
| expat | 2.8.0 | MIT | `expat-COPYING.txt` |
| lcms2 | 2.19 | MIT | `lcms2-LICENSE.txt` |
| brotli | 1.2.0 | MIT | `brotli-LICENSE.txt` |
| cgif | 0.5.3 | MIT | `cgif-LICENSE.txt` |
| highway | 1.4.0 | Apache-2.0 OR BSD-3-Clause | `highway-LICENSE.txt` |
| mozjpeg | git 0826579 | IJG AND BSD-3-Clause AND Zlib | `mozjpeg-LICENSE.txt`, `mozjpeg-README.ijg.txt` |
| libjxl | 0.11.2 | BSD-3-Clause, plus a patent grant | `libjxl-LICENSE.txt`, `libjxl-PATENTS.txt` |
| libpng | 1.6.58 | libpng-2.0 | `libpng-LICENSE.txt` |
| libimagequant | 2.4.1 | BSD-2-Clause | `libimagequant-COPYRIGHT.txt` |
| libwebp | 1.6.0 | BSD-3-Clause, plus a patent grant | `libwebp-COPYING.txt`, `libwebp-PATENTS.txt` |
| libtiff | git 179a100 | libtiff | `libtiff-LICENSE.txt` |
| libaom | 3.13.3 | BSD-2-Clause, plus the AOMedia Patent License 1.0 | `libaom-LICENSE.txt`, `libaom-PATENTS.txt` |
| Emscripten runtime | emsdk 5.0.6 | MIT OR NCSA | `emscripten-LICENSE.txt` |
| musl libc (via Emscripten) | emsdk 5.0.6 | MIT | `musl-COPYRIGHT.txt` |
| libc++, libc++abi, compiler-rt (via Emscripten) | emsdk 5.0.6 | Apache-2.0 WITH LLVM-exception | `llvm-libcxx-LICENSE.txt` |

The versions are the ones pinned in `native/settings/versions.sh` when this
file was last updated. The notice files themselves are always copied from the
sources the binary was built from.

### Attribution required in product documentation

mozjpeg (libjpeg-turbo) asks that documentation for a binary that includes it
state:

> This software is based in part on the work of the Independent JPEG Group.

## LGPL obligations

libvips, glib and libexif are LGPL-2.1-or-later, and libheif is
LGPL-3.0-or-later. They are linked **statically** into one wasm file, so there
is no separate library a user could swap in at run time. Both LGPL versions
then require that whoever distributes the binary also lets the recipient
rebuild it with a modified version of the library:

- LGPL-2.1 §6(a) and LGPL-3.0 §4(d)(0) are met by making the complete
  corresponding source available: the source of the LGPL libraries and of the
  code they are linked with.
- For wvips, all of that is public. The wrapper and build scripts are this
  repository (Apache-2.0), and the build fetches every library from the
  upstream release or commit pinned in `native/settings/versions.sh`. Any
  patches applied are in `native/patches/`. `npm run build:native` rebuilds
  the binary from it inside Docker. To use a modified library, edit its
  source under `native/sources/` (or add a patch), then rebuild.

If you distribute `wvips.wasm`, for example by serving it from a website:

1. Keep these notices with it, or link to them.
2. Point recipients to the corresponding source for the exact version you
   ship. The wvips git tag (`https://gitlab.com/wasmedia/wvips/-/tree/vX.Y.Z`)
   carries the build scripts, patches and pinned upstream versions. LGPL-3.0
   (via libheif) expects you to make sure that source stays available for as
   long as you distribute the binary. If you can't rely on GitLab and the
   upstream hosts for that, mirror the sources.
3. Don't forbid reverse engineering or modification for debugging those
   modifications in your terms of use (LGPL-2.1 §6, LGPL-3.0 §4).

Your own JavaScript that calls wvips is not affected: the LGPL covers the
libraries and the combined binary, not separate code that uses them through
their interface.
