libvips/lua-vips

Hello World fails

Closed this issue · 5 comments

stuta commented

Hello. Great library!

All other examples work (osx x64), but vips.Image.text fails.

-- make a new image with some text rendered on it
image = vips.Image.text("Hello World!", {dpi = 300})

error: 'no such operation
VipsOperation: class "text" not found
'

./configure --prefix=/Users/pasi/installed/C/vips/build --disable-dependency-tracking --enable-shared --disable-static --without-python --without-pangoft2 --without-libwebp --without-radiance --without-matio --without-openslide --without-poppler --without-OpenEXR --without-magick --without-gsf
--with-giflib-includes=/usr/local/Cellar/giflib/5.1.4/include --with-giflib-libraries=/usr/local/Cellar/giflib/5.1.4/lib
--with-jpeg-includes=/usr/local/Cellar/jpeg/8d/include --with-jpeg-libraries=/usr/local/Cellar/jpeg/8d/lib

Hello, vips uses pangoft2 to render text, so you need to enable that.

The brew vips should work, I think.

stuta commented

Thanks, I realized that too.

Tool to change loader paths (huge job by hand): https://github.com/auriamg/macdylibbundler

  • I changed Settings.cpp #63 to std::string inside_path_str = "@loader_path/";

You shouldn't need to change loader paths. I tried here and it all works fine:

brew install lua
brew install luajit
brew install vips
luarocks --local install lua-vips
eval `luarocks path`

Then:

$ luajit
LuaJIT 2.0.5 -- Copyright (C) 2005-2017 Mike Pall. http://luajit.org/
JIT: ON CMOV SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
>  vips = require "vips"
> x = vips.Image.text("hello world")
> x:write_to_file("x.png")
> ^D
$ open x.png

And I can see a "hello world" image.

stuta commented

I don't use luarocks for client installation. I have all libs in my own folder (mac32/64 + linux64/arm + win 32/64). Would be nice to have 32 bit win libraries, compiling them in paiful and non-productive work.

There are some old win32 builds here:

http://www.vips.ecs.soton.ac.uk/supported/8.1/win32/

But they might be too old.

Did you get it working with luajit on win64? I've not tried that myself.