What is in this directory
=========================

Everything here is generated. Nothing in it is hand-edited, and nothing is
obfuscated: it is minified for delivery only. Rebuild it all from the sources
that ship alongside it, in the plugin folder:

    npm install && npm run build

The complete, un-minified sources are in ../src-js/, the build that produces
this directory is ../build.mjs, and the whole plugin is public at

    https://github.com/AlexStack/imreso-target-size-image-compressor


Built from ../src-js/
---------------------

    ir-worker.js         <- src-js/ir-worker-entry.ts + src-js/format.ts
    worker-client.js     <- src-js/worker-client.js
    classic-uploader.js  <- src-js/classic-uploader.js
    block-uploader.js    <- src-js/block-uploader.js
    chunks/chunk-*.js    <- one is src-js/wfd-shim.js; the other is esbuild's
                            own CommonJS interop runtime


Third-party, bundled by esbuild from the npm packages in ../package.json
-----------------------------------------------------------------------

    chunks/encode-*.js        @jsquash/{avif,webp,jpeg}   Apache-2.0
    chunks/avif_enc*.js       @jsquash/avif               Apache-2.0
    chunks/webp_enc*.js       @jsquash/webp               Apache-2.0
    chunks/UTIF-*.js          utif2 (bundles pako)        MIT / MIT AND Zlib
    chunks/heic-to-*.js       heic-to                     LGPL-3.0

heic-to is libheif compiled to plain JavaScript, which is why it is ~3 MB and
why HEIC decoding needs no extra binary. Full licence texts for all of the
above are in ../licenses/.


The .wasm files
---------------

    avif_enc.wasm        @jsquash/avif/codec/enc/avif_enc.wasm
    webp_enc.wasm        @jsquash/webp/codec/enc/webp_enc.wasm
    webp_enc_simd.wasm   @jsquash/webp/codec/enc/webp_enc_simd.wasm
    mozjpeg_enc.wasm     @jsquash/jpeg/codec/enc/mozjpeg_enc.wasm

These four are the image encoders. This plugin exists to compress images on the
visitor's own device instead of on a server or through an external API, and
these binaries are what performs that encoding — without them the plugin does
nothing at all. They are copied byte-for-byte from the @jsquash packages that
npm install fetches; this build does not compile them. Each is built upstream
from a public, GPL-compatible C/C++ project:

    webp_enc.wasm        libwebp    BSD-3-Clause
    webp_enc_simd.wasm   libwebp    BSD-3-Clause
    mozjpeg_enc.wasm     mozjpeg    BSD-3-Clause / IJG
    avif_enc.wasm        libavif + libaom   BSD-2-Clause

    https://chromium.googlesource.com/webm/libwebp
    https://github.com/mozilla/mozjpeg
    https://github.com/AOMediaCodec/libavif
    https://github.com/jamsinclair/jSquash

They are loaded from this directory and never fetched from anywhere else, which
is what keeps every image on the user's own device.
