3
3
[ ![ Build Status] ( https://travis-ci.org/libvips/php-vips.svg?branch=master )] ( https://travis-ci.org/libvips/php-vips )
4
4
5
5
` php-vips ` is a binding for [ libvips] ( https://github.com/libvips/libvips ) 8.7
6
- and later for PHP 7.4 and later.
6
+ and later that runs on PHP 7.4 and later.
7
7
8
8
libvips is fast and needs little memory. The
9
9
[ ` vips-php-bench ` ] ( https://github.com/jcupitt/php-vips-bench ) repository
@@ -20,7 +20,7 @@ destination in a set of small fragments.
20
20
### Install
21
21
22
22
You need to [ install the libvips
23
- library] ( https://libvips.github.io/ libvips/install.html ) . It's in the linux
23
+ library] ( https://www. libvips.org /install.html ) . It's in the linux
24
24
package managers, homebrew and MacPorts, and there are Windows binaries on
25
25
the vips website. For example, on Debian:
26
26
@@ -34,7 +34,9 @@ Or macOS:
34
34
brew install vips
35
35
```
36
36
37
- Then add vips to your ` composer.json ` :
37
+ You'll need to [ enable FFI in your
38
+ PHP] ( https://www.php.net/manual/en/ffi.configuration.php ) , then add vips
39
+ to your ` composer.json ` :
38
40
39
41
```
40
42
"require": {
@@ -71,6 +73,21 @@ $ ./try1.php ~/pics/k2.jpg x.tif
71
73
See ` examples/ ` . We have a [ complete set of formatted API
72
74
docs] ( https://libvips.github.io/php-vips/docs/classes/Jcupitt-Vips-Image.html ) .
73
75
76
+
77
+ ### How it works
78
+
79
+ php-vips uses [ php-ffi] ( https://www.php.net/manual/en/book.ffi.php ) to
80
+ call directly into the libvips binary. It introspects the library binary
81
+ and presents the methods it finds as members of the ` Image ` class.
82
+
83
+ This means that the API you see depends on the version of libvips that
84
+ php-vips finds at runtime, and not on php-vips. php-vips documentation assumes
85
+ you are using the latest stable version of the libvips library.
86
+
87
+ The previous php-vips version that relied on a binary extension
88
+ and not on php-ffi is still available and supported in [ the 1.x
89
+ branch] ( https://github.com/libvips/php-vips/tree/1.x ) .
90
+
74
91
### Introduction to the API
75
92
76
93
Almost all methods return a new image as the result, so you can chain them.
@@ -130,19 +147,7 @@ And look in `docs/`.
130
147
There are around 300 operations in the library, see the vips docs for an
131
148
introduction:
132
149
133
- https://libvips.github.io/libvips/API/current
134
-
135
- ### TODO after merge
136
-
137
- - Support preloading, see https://www.php.net/manual/en/class.ffi.php
138
-
139
- - Rewrite the enum and doc generator in php.
140
-
141
- - Add source/target API
142
-
143
- - Add progress callbacks etc.
144
-
145
- - Add mutable.
150
+ https://libvips.org/API/current
146
151
147
152
### Test and install
148
153
0 commit comments