Closed antony closed 3 years ago
wasm-vips
is now a thing, so, is it possible to have a wasm version of sharp?
Any updates here?
It would be great if this package could work on CFW.
Nothing yet it seems. I coded up an image processing tool and then realized this does not work in Cloudflare workers
wasm-vips
is now a thing, so, is it possible to have a wasm version of sharp?
Unfortunately wasm-vips
will not be able to run on Cloudflare in the foreseeable future, see https://github.com/kleisauke/wasm-vips/issues/2#issuecomment-1187416552
Alternatives
Experimental support for WebAssembly environments will be arriving in v0.33.0 - please see https://github.com/lovell/sharp/issues/3336 - however Cloudflare Workers does not currently support threading or the Web Workers API so you'll need to ask Cloudflare about this lack of support if you need to use their services.
Experimental support for WebAssembly environments will be arriving in v0.33.0 - please see #3336 - however Cloudflare Workers does not currently support threading or the Web Workers API so you'll need to ask Cloudflare about this lack of support if you need to use their services.
@lovell Is there any kind of Single-Threaded mode for Sharp?
Even a dramatically slower option could still be useful for processing ultra-small images such as 100x100 thumbnails, Favicons, 50x50 Profile Pictures, etc...
@ThatGuySam Threading is fairly fundamental to libvips as well as an increasing number of the dependencies it relies on for image codecs. From what I can tell, Cloudflare Workers appears to be more suitable for tasks that are I/O bound rather than CPU bound. If performance isn't of concern then perhaps try jimp.
What are you trying to achieve?
We'd love to deploy this on CloudFlare workers. As of early this year, libvips is now compiled for that target, so as I understand it, the remaining step is to compile sharp as WebAssembly.
Libvips issue is here https://github.com/libvips/libvips/issues/192
Have you searched for similar feature requests?
Yes - There is https://github.com/lovell/sharp/issues/1476 but it was closed and locked prior to the libvips changes.
What would you expect the API to look like?
I'm not at all familiar with WebAssembly, I'm afraid.
What alternatives have you considered?
Not using cloudflare workers