# HEIC decoder / corresponding source This separately replaceable ES module is derived from **heic-to 1.5.2**'s `src/lib/libheif-without-unsafe-eval.js`. Its upstream header identifies **libheif 1.22.2**, **libde265 1.0.16**, `USE_UNSAFE_EVAL=0`. This is the precompiled JavaScript/asm.js build provided upstream, not a newly compiled binary. No runtime CDN, nested Worker, or dynamic evaluation is required by our wrapper. ## Local change JCDIC TOOLS, 2026-09-13: `var getHeapMax=()=>2147483648;` is replaced exactly once with `var getHeapMax=()=>268435456;`, limiting decoder heap growth to 256 MiB. The leading change notice is also added. No other upstream code is changed. This is not a limit on total browser memory. The application validates file/header dimensions before decoding, decodes one image at a time, and can terminate its directly owned Worker. The original library is preserved in the source package below. The reproducible extraction/modification is in `planning/publish-image-converter-vendor.py`. ## Licensing - heic-to: LGPL-3.0-or-later, [full license](heic-to-LICENSE.txt). - libheif: LGPL-3.0-or-later for the library, with MIT parts noted by upstream: [COPYING](libheif-COPYING.txt), including the incorporated GPLv3 text. - libde265: LGPL-3.0, [library license](libde265-library-COPYING.txt), [root COPYING and sample licenses](libde265-COPYING.txt). - Generated runtime notice supplements: [Emscripten MIT/NCSA](Emscripten-LICENSE.txt) and [musl COPYRIGHT](musl-COPYRIGHT.txt), copied from the official Emscripten `4.0.13` tag's `LICENSE` and `system/lib/libc/musl/COPYRIGHT`. This tag pins the notice copies only; it does **not** identify the compiler used for the upstream precompiled module, whose exact compiler version was not published. Retain these notices and the corresponding source. The library remains a separate module so it can be replaced/relinked for debugging modifications; JCDIC TOOLS does not impose a restriction on reverse engineering required to debug such library modifications. The application wrapper and interface are maintained separately from the library module. ## Fixed source archives - [heic-to 1.5.2 package, including original module/source/build script](sources/heic-to-1.5.2.tgz) — https://registry.npmjs.org/heic-to/-/heic-to-1.5.2.tgz - [libheif 1.22.2 source and build-emscripten.sh](sources/libheif-1.22.2.tar.gz) — https://github.com/strukturag/libheif/tree/v1.22.2 - [libde265 1.0.16 source](sources/libde265-1.0.16.tar.gz) — https://github.com/strukturag/libde265/tree/v1.0.16 Runtime, license and source archive sizes and SHA-256 hashes are recorded in [manifest.json](manifest.json). The npm archive SHA-512 is validated before extraction. Upstream build directions use `LIBDE265_VERSION=1.0.16 USE_UNSAFE_EVAL=0 USE_WASM=0` and describe the export-symbol adjustment in heic-to's README. The exact Emscripten compiler version is not declared by this upstream package; no bit-for-bit C++ rebuild is claimed here. The old `heic-to-1.5.2.js` file is retained for unrelated existing consumers but is no longer loaded by the HEIC page. Native AVIF input in `/image/convert/` does not load this decoder. ZIP output reuses zip.js 2.14.0, BSD-3-Clause, with its license in the parent vendor directory.