better pyvips8 notes

This commit is contained in:
John Cupitt 2014-12-18 10:25:42 +00:00
parent abdd98409d
commit 6e6cabb6e0
2 changed files with 24 additions and 5 deletions

2
TODO
View File

@ -1,5 +1,3 @@
- tests have stopped working with python2?
- use vips_resize() in vipsthumbnail? - use vips_resize() in vipsthumbnail?
should the sharpening filter be selectable? should the sharpening filter be selectable?

View File

@ -1,8 +1,10 @@
# vips8 binding for Python # vips8 binding for Python
This overrides file adds a few small helper functions to the This overrides file adds a few small helper functions to the
gobject-introspection binding for libvips. It works with python2.7 and gobject-introspection binding for libvips. It has been tested with python2.7
python3.4. and python3.4 and may work for other versions.
## Documentation
There's a chapter in the libvips API docs on these overrides, see "Using There's a chapter in the libvips API docs on these overrides, see "Using
libvips from Python". libvips from Python".
@ -10,7 +12,18 @@ libvips from Python".
vips-x.y.z/test has a test suite. Again, the test suite works with python2.7 vips-x.y.z/test has a test suite. Again, the test suite works with python2.7
and python3.4. and python3.4.
Vips.py needs to be in the overrides directory of your gobject-introspection ## Install
`libvips` need to be built and installed.
The libvips typelib, `Vips-8.0.typelib`, needs to be on your `GI_TYPELIB_PATH`. It is typically installed somewhere like `/usr/local/lib/girepository-1.0`
You need `pygobject-3.0`. To confirm that it's installed, check that your
Python `dist-packages` area has a directory called `gi`. For example:
ls /usr/lib/python2.7/dist-packages/gi
`Vips.py` needs to be in the overrides directory of your gobject-introspection
pygobject area, for example: pygobject area, for example:
sudo cp Vips.py /usr/lib/python2.7/dist-packages/gi/overrides sudo cp Vips.py /usr/lib/python2.7/dist-packages/gi/overrides
@ -19,3 +32,11 @@ or
sudo cp Vips.py /usr/lib/python3/dist-packages/gi/overrides sudo cp Vips.py /usr/lib/python3/dist-packages/gi/overrides
You can optionally pre-compile this file for a small speedup.
For python2.7, you need to install the "future" package. In Ubuntu, for
example, you can do something like:
sudo apt-get install python-pip
sudo pip install future