Skip to content

lexusburn/lua-vips

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lua-vips

A Lua binding for the libvips image processing library. This binding uses ffi and needs luajit 2.0 or later.

This binding works, but is not yet finished. See the issues.

Example

vips = require "vips"

image = vips.Image.text("Hello <i>World!</i>", {dpi = 300})
image = image:invert()
image:write_to_file("x.png")

image = vips.Image.thumbnail("somefile.jpg", 128)
image:write_to_file("tiny.jpg")

Development

Setup for ubuntu 17.04

You need to make your own luajit and luarocks that know about each other or busted will not work. See this repo:

https://github.com/torch/luajit-rocks

See the README, but briefly:

rm -rf ~/.luarocks
git clone https://github.com/torch/luajit-rocks
cd luajit-rocks
mkdir build
cd build/
cmake .. -DCMAKE_INSTALL_PREFIX=/home/john/.luarocks -DWITH_LUAJIT21=ON
make install

Configure luarocks for a local tree

luarocks help path

append

eval `luarocks path`
export PATH="$HOME/.luarocks/bin:$PATH"

to ~/.bashrc

Install

luarocks --local make

Unit testing

You need:

luarocks --local install busted 
luarocks --local install luacov
luarocks --local install say

Then to run the test suite:

(cd spec; for i in *_spec.lua; do luajit $i; done)

You can't do busted ., unfortunately, since busted fork()s between files and this breaks luajit ffi (I think).

Test

Run the example script with:

luajit example/hello-world.lua

Links

http://luajit.org/ext_ffi_api.html
http://luajit.org/ext_ffi_semantics.html
https://github.com/luarocks/luarocks/wiki/creating-a-rock
https://olivinelabs.com/busted/

About

Lua binding for the libvips image processing library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy