diff --git a/README.md b/README.md index e187e65..ffe3545 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,77 @@ # Low-level PHP binding for libvips -This extension lets you use the libvips image processing library from PHP. It is -intentionally very low-level. Modules such as -https://github.com/jcupitt/php-vips try to layer a nice API on -top of this. - -libvips is fast and it can work without needing to have the -entire image loaded into memory. Programs that use libvips don't -manipulate images directly, instead they create pipelines of image processing -operations starting from a source image. When the end of the pipe is connected -to a destination, the whole pipeline executes at once, streaming the image -in parallel from source to destination in a set of small fragments. - -See the [benchmarks at the official libvips -website](http://www.vips.ecs.soton.ac.uk/index.php?title=Speed_and_Memory_Use). -There's a handy blog post explaining [how libvips opens -files](http://libvips.blogspot.co.uk/2012/06/how-libvips-opens-file.html) -which gives some more background. +This extension lets you use the libvips image processing library from PHP 7. It +is intentionally very low-level: modules such as +https://github.com/jcupitt/php-vips try to layer a nice API on top of this. + +libvips is fast and needs little memory. The [`vips-php-bench`]( +https://github.com/jcupitt/php-vips-bench) repository tests +`php-vips` against `imagick` and `gd`: on that test, and on my laptop, +`php-vips` is around four times faster than `imagick` and needs 10 times less +memory. ### Example ```php #!/usr/bin/env php ``` Almost all operations return an array of result values. Usually there is a single result called `"out"`. Use `vips_call()` to call any operation in the vips library. There are around -around 300 operations available, see the vips docs for an -introduction: +around 300 operations available, see the vips docs for an introduction: http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/ Arguments can be long, double, image, array of long, array of double or array of image. The final argument to `vips_call()` is an array of operation options. -### Preparation +`php-vips` layers a nice API, including full docs, on top of this extension, +see: -PHP is normally built for speed and is missing a lot of debugging support you -need for extension development. For testing and dev, build your own php. -I used 7.0.11 and configured with: +https://github.com/jcupitt/php-vips -``` -$ ./configure --prefix=/home/john/vips --enable-debug --enable-maintainer-zts \ - --enable-cgi --enable-cli --with-readline --with-openssl --with-zlib \ - --with-gd --with-jpeg-dir=/usr --with-libxml-dir=/usr -``` +### Installing -You'll need libvips 8.0 or later, including all the headers for -development. On linux, install with your package manager. On OS X, -install with `brew` or MacPorts. For Windows, download a zip from the -libvips website, or build your own. +On OS X, use `brew install php70-vips` to install the libvips library, php and +this php extension. -### Installing +On Linux, install this extension with: ``` -$ pear install vips-0.1.2.tgz +$ pear install vips-0.1.3.tgz ``` -to install. - -Add: +And add: ``` extension=vips.so ``` -to your `php.ini`, perhaps in `~/vips/lib/php.ini`, if you configured php as -above. - -### Using +to your `php.ini`. -Try: +### Development: preparation -```php -#!/usr/bin/env php - -``` - -And run with: +PHP is normally built for speed and is missing a lot of debugging support you +need for extension development. For testing and dev, build your own php. +I used 7.0.11 and configured with: ``` -$ ./try1.php ~/pics/k2.jpg x.tif +$ ./configure --prefix=/home/john/vips --enable-debug --enable-maintainer-zts \ + --enable-cgi --enable-cli --with-readline --with-openssl --with-zlib \ + --with-gd --with-jpeg-dir=/usr --with-libxml-dir=/usr ``` -See `examples/`. +You'll need libvips 8.0 or later, including all the headers for +development. On linux, install with your package manager. On OS X, +install with `brew` or MacPorts. For Windows, download a zip from the +libvips website, or build your own. ### Development: regenerate build system @@ -110,7 +79,7 @@ See `examples/`. $ pear package ``` -to make `vips-0.1.2.tgz`. +to make `vips-0.1.3.tgz`. To install by hand: @@ -159,6 +128,9 @@ Finally, install to your php extensions area with: $ make install ``` +Add `extension-vips.so` to `php.ini`, perhaps in `~/vips/lib/php.ini`, +if you configured php as above. + ### Links http://php.net/manual/en/internals2.php diff --git a/vips-0.1.3.tgz b/vips-0.1.3.tgz index e50fc4f..272e264 100644 Binary files a/vips-0.1.3.tgz and b/vips-0.1.3.tgz differ