diff --git a/README.md b/README.md index f8bd949..f0e8a4a 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,47 @@ -# libvips adapter for imagine +# libvips adapter for Imagine - This package provides a [libvips](https://jcupitt.github.io/libvips/) integration for [imagine](https://imagine.readthedocs.io/en/latest/). The as of mid november 2017 not yet released version 8.6 is recommended for some functions. But 8.5 works for most too. +This package provides a [libvips](https://jcupitt.github.io/libvips/) integration for [Imagine](https://imagine.readthedocs.io/en/latest/). The [VIPS image processing system](https://jcupitt.github.io/libvips/) is a very fast, multi-threaded image processing library with low memory needs. + +The as of mid november 2017 not yet released version 8.6 of libvips is recommended for some functions. But 8.5 works for most too. + +You also need the [php-vips-ext](https://github.com/jcupitt/php-vips-ext) extension (you need to install that) and the [php-vips](https://github.com/jcupitt/php-vips) classes (automatically installed by composer) + +The most (to us at least) important stuff is implemented. There may be edge cases, which are not covered yet, but those will be hopefully fixed soon. Report them, if you encounter one. + +## Installation - You also need the [php-vips-ext](https://github.com/jcupitt/php-vips-ext) extension and the [php-vips](https://github.com/jcupitt/php-vips) classes, add them to your composer.json with - ``` - composer require jcupitt/vips - ``` +Just run the following - Most (to me at least) important stuff is implemented, they may be edge cases, which are not covered yet. +``` +composer require rokka/imagine-vips +``` -## Missing stuff + and then you can use it like any other Imagine implementation with eg. + +``` +$imagine = new \Imagine\Vips\Imagine(); + +$size = new Imagine\Image\Box(40, 40); +$mode = Imagine\Image\ImageInterface::THUMBNAIL_INSET; + +$imagine->open('/path/to/large_image.jpg') + ->thumbnail($size, $mode) + ->save('/path/to/thumbnail.png') +``` - Not implemented yet +## Missing stuff + +Needs upcoming 8.6: + +* paste +* rotate + +Not implemented yet * Layers - Just the first layer is loaded (see below for more info) * Font * Drawer - * methods: + * Methods: * fill * histogram * profile @@ -24,7 +49,7 @@ * Filters: * colorize - Most of them are not that important to us, so any contribution is welcome +Most of them are not that important to us, so any contributions are welcome. Drawer for example may be a low hanging fruit, if you want to get into it. ### Layers @@ -34,7 +59,7 @@ Layers can theoretically be supported, BUT there's no save support in vips for l ## Saving files -Natively supported by vips are jpg, png and webp. For the rest this adapter falls back to the Imagick or GD implementation. +Natively supported by libvips for saving are jpg, png and webp. For the rest this adapter falls back to the Imagick or GD implementation. ## Contribution diff --git a/lib/Imagine/Vips/Image.php b/lib/Imagine/Vips/Image.php index 9ad021f..e4ede32 100644 --- a/lib/Imagine/Vips/Image.php +++ b/lib/Imagine/Vips/Image.php @@ -214,6 +214,8 @@ public function paste(ImageInterface $image, PointInterface $start) } } $image = $image->extendImage($this->getSize(), $start)->getVips(); + + //needs upcoming vips 8.6 $this->vips = $this->vips->composite([$this->vips, $image], [2]); return $this;