Skip to content

ademi/wasm_rust_image_viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust WASM Image Viewer

This project serves as an example of how to use Rust language compiled into wasm to read and operate on images openned in internet browser.

You can view this project in a desktop browser that supports WebAssembly here: https://ademi.github.io/wasm_rust_image_viewer/

Building

The command lines on the file named compile is used to compile the rust into wasm and move the reuslting static files to a servable directory. You can either use it as is, or copy and modify the commands to your likings.

Running

Although the resulting files are 100% running on the client side. Due to cross-origin security issues, almost all browsers require that you serve the contents of the project from a webserver. I use Nginx with added the wasm mime type to Nginx configuration, by adding the line to the suitable config file (mime.types in my case).

type application/wasm                      wasm;

Another simpler route will be using Python and python simpeHTTPServer however you'll have to figure out the configuration.

Then open http://localhost:8000 to view the example.

About

Image Viewer compiling Rusts to Web Assembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published