# HEIC decoder source and build information

The unmodified decoder at /engines/libheif-bundle.js is libheif-js 1.23.2 (LGPL-3.0).
The wrapper and decoder are distributed separately from the application. No decoder source modifications were made.

Corresponding sources served from this same site:
- [libheif-js source and bundling scripts](source/libheif-js-1.23.2.tar.gz), commit 6ca00b818c0ff51cb2a5c75b9ce97d708083335a.
- [Emscripten build workflow](source/libheif-build-1.23.2.tar.gz), commit dd5a19b878149437a5a427f6e1afa8bac624a714.
- [libheif source](source/libheif-source.tar.gz), commit ac1cb05c39008f01525c991ff8b88f84ddf70fd2.
- [libde265 1.0.15 source](source/libde265-1.0.15.tar.gz).
- [Decoder license](libheif-LICENSE.txt).
- [GNU GPL v3, incorporated by LGPL v3](GPL-3.0.txt).

Build: follow .github/workflows/emscripten.yml in the build archive with Emscripten 3.1.61 and the linked libheif revision. The upstream run-ci.sh/build-emscripten.sh contain the build instructions and dependency configuration. The WASM workflow uses USE_WASM=1, USE_UNSAFE_EVAL=0, USE_TYPESCRIPT=1. Then use scripts/install.js from the libheif-js archive with the generated libheif.tar.gz to create the browser bundle.

Replacement: build your modified compatible decoder and replace /engines/libheif-bundle.js. The FormRedi adapter /engines/heic-worker.js dynamically loads that path with importScripts. Its interface uses HeifDecoder.decode, frame.get_width, frame.get_height and frame.display. No integrity lock or signature restricts replacing this library.

Application terms do not restrict reverse engineering for debugging modifications of the LGPL library. Keep these source archives and notices available alongside every distribution of this decoder.

