Skip to content

Libcaesium compiled to WASM that allows you to compress images directly on browser

License

Notifications You must be signed in to change notification settings

Lymphatus/libcaesium-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libcaesium WASM

WASM compiled code for libcaesium.
This allows you to run (almost) the full libcaesium potential directly inside the browser.

Table of Contents

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/Lymphatus/libcaesium-wasm.git
    cd libcaesium-wasm
  2. Install Cross:

    cargo install cross --git https://github.com/cross-rs/cross
  3. Build the library:

    cross build --release

Usage

You can test the compression by copying the compiled libcaesium-wasm.js and libcaesium_wasm.wasm files into the static folder of the project. You can then open the static/index.html file to have a small demo of the usage.

The copy command should look like this

cp target/wasm32-unknown-emscripten/release/libcaesium-wasm.js static/libcaesium-wasm.js
cp target/wasm32-unknown-emscripten/release/libcaesium_wasm.wasm static/libcaesium_wasm.wasm

Note that the code by default is compiled as an ES6 Module, so it supports only modern browsers.
The library can be compiled as vanilla JS or UMD by tweaking the EMCC_CFLAGS inside Dockerfile.

License

Licensed under Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) See LICENSE.md for details.

About

Libcaesium compiled to WASM that allows you to compress images directly on browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published