# HEIC/HEIF decoder: license, source, and relinking offer

AnatoMe downloads a WebAssembly HEIC/HEIF decoder to your browser only when
HEIC conversion is needed. The `@discourse/heic@1.0.0` wrapper is Apache-2.0.
Its `heic_dec.wasm` statically links libheif 1.19.7 and libde265 1.0.15, which
are licensed under LGPL-3.0. LGPL-3.0 incorporates GPL-3.0 terms.

Full license texts:

- `/open-source/heic-codec/Apache-2.0.txt`
- `/open-source/heic-codec/LGPL-3.0.txt`
- `/open-source/heic-codec/GPL-3.0.txt`

Exact corresponding library source, conveyed from this same durable origin:

- `/open-source/heic-codec/source/libheif-v1.19.7.tar.gz`
  SHA-256 `8334c7c418f82c30c9bec1f46e6abfd5a8d3c420a3210d5505eb1868696ce0cc`
- `/open-source/heic-codec/source/libde265-v1.0.15.tar.gz`
  SHA-256 `d4e55706dfc5b2c5c9702940b675ce2d3e7511025c6894eaddcdbaf0b15fd3f3`

Exact wrapper and build source is pinned permanently by Git commit:
https://github.com/discourse/jSquash/tree/3c0672654a01dbc8c8fcd80c191702732736f93d/packages/heic

The build pins Emscripten SDK 3.1.57. The shipped npm WASM SHA-256 is
`832bfb37148038257e56216d165cfae24a8afaa7cae8fc0ddb1ef4bf495612a9`.

Download `/open-source/heic-codec/relink-heic-codec.sh` for the executable
obtain/modify/relink/install path. It checks out the exact wrapper/build commit,
verifies these exact library sources, retains editable source trees, rebuilds
with the pinned Docker/Emscripten toolchain, and installs replacement JS/WASM.
Use `HEIC_CODEC_USE_EXISTING_SOURCES=1` after editing the retained libraries.
Use `HEIC_CODEC_INSTALL_DIR` to select the package installation to replace.
Then run `bun run build` to emit the relinked decoder. The AnatoMe application
source accompanying this notice is the Corresponding Application Code.

No warranty is provided. See the license texts for your rights and obligations.
