jamsinclair / jSquash

Browser & Web Worker focussed wasm bundles derived from the Squoosh App.
Apache License 2.0
222 stars 14 forks source link

Cannot instantiate avif wasm module manually #23

Closed jamsinclair closed 1 year ago

jamsinclair commented 1 year ago

When darting through the code recently I think I observed a potential bug that would stop people from manually instantiating a wasm module. People using this in a CloudFlare Worker would likely be impacted.

https://github.com/jamsinclair/jSquash/blob/f76973eaec7803b79738c3a9cece15489e6a721e/packages/avif/encode.ts#L28-L31 Notice we never set the emscriptenModule with the passed module. This would prevent us from storing this module in memory.

jamsinclair commented 1 year ago

Fixed by 92b3c791b3b55b2453fb235d83c2ffb56c2855e5