Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
08582e2
Improved logging, enumerations and more
kleisauke Oct 20, 2016
593c24a
Merge pull request #15 from kleisauke/logging-enumerations
jcupitt Oct 22, 2016
ef0d885
pass PSR2, README updates
jcupitt Oct 22, 2016
a1e2e6e
remove Enum from enum names, version bump
jcupitt Oct 22, 2016
d1727aa
Override __toString() + remove enums import
kleisauke Oct 22, 2016
cc2a01d
add notes on scope to the README
jcupitt Oct 25, 2016
22d2277
add formatted docs to repro
jcupitt Oct 25, 2016
d582081
make tests run in less RAM
jcupitt Oct 25, 2016
02d3c39
better write to file exception test
jcupitt Oct 26, 2016
d91b499
add sig.php example
jcupitt Oct 26, 2016
ff4e79f
move logger
jcupitt Oct 26, 2016
95888ac
all seems to work
jcupitt Oct 26, 2016
e9bee8f
fix sig.php
jcupitt Oct 26, 2016
efd538f
fix some phpcs warnings
jcupitt Oct 26, 2016
706072b
make a separate Logger class
jcupitt Oct 27, 2016
1b44116
move debug/error logging convenience into Main
jcupitt Oct 27, 2016
d0efc5f
fix Logger image->string conversion
jcupitt Oct 27, 2016
a1ad5e3
Merge branch 'add-default-logger' of github.com:jcupitt/php-vips into…
jcupitt Oct 27, 2016
cb42841
remove @version tags
jcupitt Oct 27, 2016
eeb8483
update docs
jcupitt Oct 27, 2016
f4d4fb5
avoid AND/OR member names
jcupitt Oct 27, 2016
6e99cdd
regen docs, again
jcupitt Oct 27, 2016
44c805e
incorporate review comments
jcupitt Oct 27, 2016
e6bd0e5
Merge branch 'dev' into add-default-logger
jcupitt Oct 28, 2016
2e5cc1b
ready to merge to dev
jcupitt Oct 28, 2016
c3ac43d
rename error() and debug()
jcupitt Nov 2, 2016
d63c9da
remove :void return
jcupitt Nov 2, 2016
420b9f4
regen docs
jcupitt Nov 2, 2016
e79da93
update docs without cache files
jcupitt Nov 2, 2016
c00f6af
remove left-over debugLog() etc.
jcupitt Nov 2, 2016
2d7fb28
update docs
jcupitt Nov 2, 2016
d80e827
remove formatted docs, bump to 1.0.0
jcupitt Nov 3, 2016
e0c521b
fixes for review comments
jcupitt Nov 4, 2016
7fd21be
revise README for 1.0
jcupitt Nov 4, 2016
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/vendor
/docs
*.swp
docs
File renamed without changes.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
# Changelog
All notable changes to `:vips` will be documented in this file.

## 1.0.0 - 2016-11-03

### Added
- logging with PSR-3 Logger Interface [Kleis Auke Wolthuizen]
- switch to PSR2 formatting [Kleis Auke Wolthuizen]
- add sig.php example [John Cupitt]
- add Vips\Image::debugLogger() sample logger [John Cupitt]
- added Vips\Config and Vips\Utils

### Deprecated
- removed `\Enum` from enum names

### Fixed
- Nothing

### Remove
- Nothing

### Security
- Nothing

## 0.1.2 - 2016-10-02

### Added
Expand Down
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# High-level PHP binding for libvips

A high-level interface to the libvips image processing library. This
module builds upon the `vips` extension, see:

https://github.com/jcupitt/php-vips-ext

You'll need to install that first. It's tested on Linux, OS X should work,
Windows would need some work, but should be possible.
`php-vips` is a binding for [libvips](https://github.com/jcupitt/libvips), in
line with [ruby-vips](https://github.com/jcupitt/ruby-vips),
[pyvips](https://github.com/jcupitt/libvips/tree/master/python), the [libvips
C++ API](https://github.com/jcupitt/libvips/tree/master/cplusplus) and the
[libvips C API](https://github.com/jcupitt/libvips/tree/master/libvips).
It aims to be small and simple, and to provide a stable, well-documented
platform that conforms to [PHP standards
recommendations](http://www.php-fig.org/psr/).

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
operations starting from a source image. When 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.

Expand All @@ -24,11 +25,27 @@ 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.

Extra functionality, such as an image thumbnailer, for example, is
implemented in repositories which build on this one, and not incorporated
directly in this code (though see `examples/`).
As much of the binding as possible is auto-generated. This reduces
maintenance effort, increases reliability, and makes it possible to
reuse core libvips documentation.

This
module builds upon the `vips` binary extension, see:

https://github.com/jcupitt/php-vips-ext

You'll need to install that first. It's tested on Linux; OS X should work;
Windows would need some work, but should be possible.

### Example

```php
#!/usr/bin/env php
<?php
require __DIR__ . '/vendor/autoload.php';
use Jcupitt\Vips;

$image = Vips\Image::newFromFile($argv[1]);
Expand Down Expand Up @@ -94,7 +111,7 @@ $image = $image->add([[1, 2, 3], [4, 5, 6]]);

To make a 2 x 3 image from the array, then add that image to the original.

Almost all methods can take an optional final argument, an array of options.
Almost all methods can take an extra final argument: an array of options.
For example:

```
Expand All @@ -121,8 +138,8 @@ libvips properties as properties of the PHP `Vips\Image` class.
### Test and install

```
$ phpcs src
$ php ~/vips/php/composer.phar install
$ phpcs --standard=PSR2 src
$ php ~/packages/php/composer.phar install
$ vendor/bin/phpunit
$ vendor/bin/phpdoc
```
Expand Down
File renamed without changes.
19 changes: 15 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
}
],
"require": {
"php" : ">=7.0.11",
"ext-vips" : ">=0.1.1"
"php": ">=7.0.11",
"ext-vips": ">=0.1.1",
"psr/log": "^1.0.1"
},
"require-dev": {
"phpunit/phpunit": "~5.0",
"phpdocumentor/phpdocumentor" : "2.*"
"phpunit/phpunit": "^5.5",
"phpdocumentor/phpdocumentor" : "2.*",
"jakub-onderka/php-parallel-lint": "^0.9"
},
"autoload": {
"psr-4": {
Expand All @@ -34,9 +36,18 @@
"Jcupitt\\Vips\\Test\\": "tests"
}
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor",
"phpunit"
]
}
}
168 changes: 108 additions & 60 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions examples/vips_addconst.php → examples/addconst.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env php
<?php
<?php

include '../src/Image.php';
require __DIR__ . '/../vendor/autoload.php';

use Jcupitt\Vips;

$image = Vips\Image::newFromArray([[1, 2, 3], [4, 5, 6]]);
$image = $image->linear(1, 1);

?>
Loading