image-base64-wasm

crates

Convert jpeg, png, gif, ico to base64, and vise versa

Compatibility

The library is compatible with wasm

To build into wasm, uncomment the target line in .cargo/config

``` [build]

target = "wasm32-unknown-unknown"

```

Code Example

```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); } ```

```rust extern crate imagebase64wasm;

fn main() { let base64 = "base64 String"; let image = imagebase64wasm::from_base64(base64);

let imgdata: Vec = ...; // TODO replace this part let base64 = imagebase64wasm::vectobase64(imgdata); } ```

Installation

Add the dependency to your Cargo.toml under [dependencies]:

toml image-base64-wasm = "0.5.0"

License

MIT