mlua-image

Crates.iomlua-image
lib.rsmlua-image
version0.1.3
sourcesrc
created_at2024-01-07 21:24:41.153137
updated_at2024-03-02 12:01:26.945204
descriptionLua bindings and embedding of the Rust based 'image' imaging library.
homepagehttps://on-prem.net
repositoryhttps://gitlab.com/megalithic-llc/mlua-image.git
max_upload_size
id1092036
size401,581
David Rauschenbach (drauschenbach)

documentation

README

mlua-image

Lua bindings for the image imaging library.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-image --features luajit

Using

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)

Testing

$ make check
Commit count: 0

cargo fmt