Skip to content

Commit

Permalink
Extend README
Browse files Browse the repository at this point in the history
  • Loading branch information
chregu committed Nov 19, 2017
1 parent f8666e7 commit 6a92746
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
49 changes: 37 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
# 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
* setColorspace
* 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

Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions lib/Imagine/Vips/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6a92746

Please sign in to comment.