Skip to content

Commit 3a74231

Browse files
committed
revise README for 2.x
1 parent fc7516c commit 3a74231

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

README.md

+21-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.org/libvips/php-vips.svg?branch=master)](https://travis-ci.org/libvips/php-vips)
44

55
`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.
77

88
libvips is fast and needs little memory. The
99
[`vips-php-bench`](https://github.com/jcupitt/php-vips-bench) repository
@@ -20,7 +20,7 @@ destination in a set of small fragments.
2020
### Install
2121

2222
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
2424
package managers, homebrew and MacPorts, and there are Windows binaries on
2525
the vips website. For example, on Debian:
2626

@@ -34,7 +34,9 @@ Or macOS:
3434
brew install vips
3535
```
3636

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`:
3840

3941
```
4042
"require": {
@@ -71,6 +73,21 @@ $ ./try1.php ~/pics/k2.jpg x.tif
7173
See `examples/`. We have a [complete set of formatted API
7274
docs](https://libvips.github.io/php-vips/docs/classes/Jcupitt-Vips-Image.html).
7375

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+
7491
### Introduction to the API
7592

7693
Almost all methods return a new image as the result, so you can chain them.
@@ -130,19 +147,7 @@ And look in `docs/`.
130147
There are around 300 operations in the library, see the vips docs for an
131148
introduction:
132149

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
146151

147152
### Test and install
148153

0 commit comments

Comments
 (0)