Skip to content

libwebp-wasm/gif2webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gif2Webp

Introduction

The process of converting the libwebp project from C/C++ to WASM is achieved using the Emscripten compiler. The general workflow is as follows:

Emscripten Compilation Flow

Usage

Installation

Toolchain

This includes installing emsdk, cmake, and pnpm. For specific installation methods, refer to the Emscripten official documentation, pnpm official documentation, and installing cmake.

submodule

git submodule update --init --recursive --remote --rebase

Build

MacOS

If you are using zsh, it is recommended to install the dotenv plugin to enable features like setting environment variables if a .env file is present in the current directory.

pnpm build:mac

Docker

Build Image
docker build -f ./docker/Dockerfile -t libwebp-wasm/gif2webp:latest .
Run Image
docker run --rm  -v $(pwd)/dist:/gif2webp/dist -v $(pwd)/es:/gif2webp/es -v $(pwd)/lib:/gif2webp/lib libwebp-wasm/gif2webp

Other

Note: The modification of upstream submodule project code is currently done by running the git apply command. Sometimes you need to commit your own changes in the submodule directory and manually generate the patch.

pnpm build:patch

Example

License

MIT