Crates.io | mlua-image |
lib.rs | mlua-image |
version | 0.1.3 |
source | src |
created_at | 2024-01-07 21:24:41.153137 |
updated_at | 2024-03-02 12:01:26.945204 |
description | Lua bindings and embedding of the Rust based 'image' imaging library. |
homepage | https://on-prem.net |
repository | https://gitlab.com/megalithic-llc/mlua-image.git |
max_upload_size | |
id | 1092036 |
size | 401,581 |
Lua bindings for the image imaging library.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-image --features luajit
use mlua::Lua;
use mlua_image;
let lua = Lua::new();
mlua_image::preload(&lua)?;
let script = r#"
local image = require('image')
local img = image.open('testdata/fractal.png')
img:save_with_format('fractal.gif', 'gif')
return img:height(), img:width()
"#;
let (height, width): (u32, u32) = lua.load(script).eval()?; // returns: (800, 800)
$ make check