This repo contains a simple image converter (PNG ↔ JPG) using WASM technology and C++ code.
Features:
- client-side multiplattfom C++ logic execution in browser (x86/ARM, Windows/MacOS/Linux)
- extensible to other (exotic) formats like
PNMorTIFF, see here (section "Supported Image Formats)
- Web assembly
- Bootstrap
- Emscripten compiler (em++/emcc)
- VS Code
There are various image converters on the net which can be implemented one of the following way:
- send the files to the server, where the conversion logic is implemented
- JS client-side conversion via
canvasdrawing and export functionality, see Centipede5/imageconverter.
However this implementation serves as a technology test for a particular task.
- Install boost library
- Build shared libraries for
boost::filesystemandboost::gil - Run
make buildin the root directory. The executable is inbuilddirectory.
- Install Emscripten SDK
- Activate emscripten for current terminal session (e.g.
source ~/emsdk/emsdk_env.sh) - In order to build
libjpegstatic library go tobuild/includeand runemconfigure ./configureandemmake make. - In the root folder:
make wasm_pageto buildwasmartifact and corresponding.jscode. - Run an HTTP server in website/
- Enjoy!
MIT
