SalOne22 / rimage

This is CLI tool inspired by squoosh!
Apache License 2.0
306 stars 19 forks source link

wasm-pack #144

Open pzhasaki opened 11 months ago

pzhasaki commented 11 months ago

Is there an existing issue for this?

Description

[dependencies] rimage = { version = "0.9", features = ["webp", "avif"] } could rimage build in wasm? there failed: CC=emcc wasm-pack build --target web

image

Expected behavior

No response

Library Version

0.9.0

Steps To Reproduce

No response

Anything else?

No response

SalOne22 commented 11 months ago

There is no official support for the wasm target at the moment. I am currently working on integrating the image crate, and I will do my best to implement support for all major targets, including wasm.

pzhasaki commented 11 months ago

Looking forward to it !

SalOne22 commented 10 months ago

The latest release has introduced support for the wasm32-unknown-emscripten and wasm32-wasi targets. However, support for the wasm32-unknown-unknown target is not available due to the inability of mozjpeg to compile without the C standard library.

MiniOcean404 commented 2 months ago

Looking forward to it !

MiniOcean404 commented 2 months ago

I would like to ask if the webp dependency cannot be compiled by wasm-pack。

I used cargo build --lib --target wasm32-unknown-emscripten. This command also failed to compile

SalOne22 commented 2 months ago

I would like to ask if the webp dependency cannot be compiled by wasm-pack

Any C dependency cannot be compiled to the wasm32-unknown-unknown target. webp crate uses C implementation of libwebp.

I used cargo build --lib --target wasm32-unknown-emscripten. This command also failed to compile

What's the issue?

MiniOcean404 commented 2 months ago

请问一下webp依赖不能用wasm-pack编译吗

任何 C 依赖项都无法编译到wasm32-unknown-unknown目标。cratewebp使用 的 C 实现libwebp

我使用了cargo build --lib --target wasm32-unknown-emscripten。此命令也编译失败

有什么问题?

Thank you for your reply and answer. It seems that C or C++ is still needed to better complete wasm