Open gedw99 opened 1 year ago
Hi @gedw99, I'd like to know more about that. We are using nsjail for running imagemagick and nodejs scripts.
For imagemagick, there is a wasm port (https://github.com/dlemstra/magick-wasm), but it didn't support reading PDF (https://github.com/dlemstra/magick-wasm/discussions/51), which is mandatory for us. Same for SVG: https://github.com/dlemstra/magick-wasm/discussions/19. Do you have another way to suggest?
For nodejs scripts, do you have any resource or link on how to compile JS to wasm?
apologies for random thoughts but https://github.com/ncruces/dcraw https://github.com/jerbob92/go-pdfium-wasm might be cookie crumbs to find folks in similar situations about images and pdf support for their tools. in most cases there are ports to do. I don't have insight into compiling JS to wasm, but someone else may
Will chime here …
sometimes it’s useful to step back and see the best path forward ..
Image transforms can be done in pure go compiled to wasm. Sure you might loose some speed but it’s really clean. There are plenty of golang packages that pretty much do what image magic does.
pdf. As @codefromthecrypt suggested. It works great. There is also pdfcpu which is pure golang .
Wazero is so simple to use and there are sone great golang systems built on top to make it very easy .
capsule is one on GitHub ..
Wazero is a no cgo wasm runner and could replace nsjail