You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The returned image is using a pointer to the `data` area, but luajit won't
218
-
always know this. You should keep a reference to `data` alive for as long as you
219
-
are using any downstream images, or you'll get a crash.
229
+
The returned image is using a pointer to the `data` area, but the Lua/LuaJIT interpreter won't always know this. You should keep a reference to `data` alive for as long as you are using any downstream images, or you'll get a crash.
Same as `new_from_memory`, but for any kind of data pointer (non-FFI allocated) by specifying the length of the data in bytes. The pointed data must be valid for the lifespan of the image and any downstream images.
224
234
225
-
A string can be used as the data pointer thanks to LuaJIT FFI semantics.
235
+
A string can be used as the data pointer thanks to FFI semantics.
Installing `lua-vips` on Windows is a bit harder than on Unix systems. We recommend using MinGW (Minimalist GNU for Windows) for the installation. Here are the steps:
655
+
656
+
1. Install [MSYS2](https://www.msys2.org/) to the default path.
657
+
2. Start Mingw-w64 64bit console from the start menu. Check that is says MINGW64. The following steps happen in that console.
658
+
3. Update MSYS2 using
659
+
```shell
660
+
pacman -Syuu
661
+
```
662
+
4. Install the build tools (including Lua 5.4 and Luarocks) via
663
+
```shell
664
+
pacman -S git make mingw-w64-x86_64-toolchain mingw-w64-x86_64-lua-luarocks
665
+
```
666
+
5. Install `libvips` with (optional) dependencies via
667
+
```shell
668
+
pacman -S
669
+
mingw-w64-x86_64-libvips
670
+
mingw-w64-x86_64-openslide
671
+
mingw-w64-x86_64-libheif
672
+
mingw-w64-x86_64-libjxl
673
+
mingw-w64-x86_64-imagemagick
674
+
mingw-w64-x86_64-poppler
675
+
```
676
+
6. Optionally: If you want to use `lua-vips` with LuaJIT instead of Lua 5.4 install LuaJIT via
677
+
```shell
678
+
pacman -S mingw-w64-x86_64-luajit
679
+
luarocks config --scope system lua_version 5.1
680
+
luarocks config --scope system lua_interpreter luajit.exe
681
+
luarocks config --scope system variables.LUA_DIR /mingw64/bin
682
+
luarocks config --scope system variables.LUA_INCDIR /mingw64/include/luajit-2.1/
683
+
luarocks config --scope system rocks_provided.luaffi-tkl 2.1-1
684
+
```
685
+
7. Install `lua-vips` via
686
+
```shell
687
+
luarocks install lua-vips
688
+
```
689
+
or clone the repository and run `luarocks make` in the `lua-vips` folder.
690
+
8. Add `C:\msys64\mingw64\bin` and `C:\msys64\usr\bin` to the top of your `PATH`
691
+
environment variable in the Windows Advanced system settings and restart the console.
692
+
693
+
9. Run `lua` or `luajit` and try
694
+
```lua
695
+
vips=require"vips"
696
+
print(vips.Image.xyz(3,2))
697
+
```
698
+
642
699
###RunningunderWine (WindowsemulationonLinux)
643
700
644
-
I used the luapower all-in-one to get a 64-bit Windows LuaJIT build:
0 commit comments