tinyimg: image decoding, transformation and drawing for Cloudflare Workers.
The module has to arrive already compiled, because workerd refuses to compile wasm from bytes.
Importing the file is what makes it work there; TinyImgModule.loadBytes is for node, bun
and the browser.
Nothing runs until the output is asked for. A 400x400 thumbnail of a 16 megapixel photograph
decodes a region at a reduced scale rather than 16 megapixels, and that decision cannot be made
after the first operation has already run.
tinyimg: image decoding, transformation and drawing for Cloudflare Workers.
The module has to arrive already compiled, because workerd refuses to compile wasm from bytes. Importing the file is what makes it work there; TinyImgModule.loadBytes is for node, bun and the browser.
Three tiers, and they are the same planner underneath:
Nothing runs until the output is asked for. A 400x400 thumbnail of a 16 megapixel photograph decodes a region at a reduced scale rather than 16 megapixels, and that decision cannot be made after the first operation has already run.