How libheif.js in this folder was built ======================================= Postfjord did not build this file. It is the release file of https://github.com/catdad-experiments/libheif-emscripten at tag v1.23.5 (commit 5c8968a44e9c68ae677e24790d77d001ed7fe7cc), built by that project's GitHub Actions workflow. The project describes itself like this: libheif "is included as a submodule link, and compiled using the original repo scripts without modification to source or build scripts". What went in ------------ libheif 1.23.5, commit 413e2a87e6a70b3eccc3a3adc5801179dd2d9e00 (the submodule of libheif-emscripten) source: source/libheif-1.23.5.tar.gz in this folder libde265 1.0.15, fetched by libheif's build-emscripten.sh (LIBDE265_VERSION defaults to 1.0.15) from https://github.com/strukturag/libde265/releases/download/v1.0.15/libde265-1.0.15.tar.gz source: source/libde265-1.0.15.tar.gz in this folder Emscripten 3.1.61 (EMSCRIPTEN_VERSION in the workflow), on ubuntu-22.04 No other codec is compiled in. build-emscripten.sh turns on libde265 only (ENABLE_LIBDE265=1; the options for AOM, OpenJPEG, uncompressed pictures and WebCodecs are 0 unless set, and the workflow sets none of them). There is no encoder in the file. The steps --------- They are in build-scripts/emscripten.yml.txt (a copy of .github/workflows/emscripten.yml), job "emscripten", target "js". The scripts it runs are inside source/libheif-1.23.5.tar.gz: scripts/install-ci-linux.sh, scripts/prepare-ci.sh, scripts/run-ci.sh, build-emscripten.sh and post.js. 1. Check out libheif-emscripten at v1.23.5 with its submodule (libheif at 413e2a87). 2. In the libheif folder, with EMSCRIPTEN_VERSION=3.1.61 set: ./scripts/install-ci-linux.sh ./scripts/prepare-ci.sh 3. Make the JavaScript variant of the CI script and run it: sed -e 's/USE_WASM=0/USE_WASM=0 USE_UNSAFE_EVAL=0/g' -e 's/USE_TYPESCRIPT=0/USE_TYPESCRIPT=1/g' ./scripts/run-ci.sh > ./scripts/run-ci-js.sh chmod +x ./scripts/run-ci-js.sh ./scripts/run-ci-js.sh The line of run-ci.sh that does the work is, after the sed: source ./emscripten/emsdk/emsdk_env.sh && USE_WASM=0 USE_UNSAFE_EVAL=0 USE_TYPESCRIPT=1 ./build-emscripten.sh . build-emscripten.sh configures libde265 and libheif with emconfigure and emcmake, then links with emcc: -sWASM=0 (plain JavaScript, no WebAssembly), -sDYNAMIC_EXECUTION=0 (no eval), -sMODULARIZE, -sEXPORT_NAME="libheif", -sWASM_ASYNC_COMPILATION=0, -sALLOW_MEMORY_GROWTH, -O3, -lembind, --post-js post.js, with every heif_ and de265_ function exported. 4. Package: ./dist-prep.sh js (build-scripts/dist-prep.sh.txt) copies libheif/libheif.js to dist/libheif.js. The release job publishes that file as the release asset libheif.js. The result ---------- libheif.js, 3,369,222 bytes SHA-256 804551ee35288509d5bde23c480e956f9d7b2a0dfc0b36a6a9a8a5b01234d276 https://github.com/catdad-experiments/libheif-emscripten/releases/download/v1.23.5/libheif.js To build it yourself, follow the same steps with the two source files in source/. Emscripten is a free tool that is used unchanged: https://github.com/emscripten-core/emscripten (version 3.1.61). A build of your own will not match the checksum above bit for bit unless every tool version matches, and it does not have to: see "Use your own version" in README.txt.