Convert jpeg, png, gif, ico to base64, and vise versa
The library is compatible with wasm
To build into wasm, uncomment the target line in .cargo/config
``` [build]
```
```rust extern crate imagebase64wasm;
fn main() { let base64 = "base64 String"; let image = imagebase64wasm::from_base64(base64);
let imagepath = "local image file path" let base64 = imagebase64wasm::tobase64(image_path); } ```
Vec<u8>
(useful for url response body)```rust extern crate imagebase64wasm;
fn main() { let base64 = "base64 String"; let image = imagebase64wasm::from_base64(base64);
let imgdata: Vec
Add the dependency to your Cargo.toml
under [dependencies]
:
toml
image-base64-wasm = "0.5.0"
MIT