PHP Imlib2 Extension (php_imlib)
================================

This extension, as one might expect, provides access to Rasterman's
excellent image library, Imlib2.  The extension is coming together fairly
well, with probably four fifths of the Imlib2 API ported which I've been
aiming for (There are parts of Imlib2 used specifically for X applications,
which of course, we don't need in a PHP extension).  See "About php_imlib"
below and the contents of the docs directory for more information on the
extension.


Requirements
------------
See INSTALL for where to get the required libraries.  Imlib2, freetype,
libjpeg, and libpng should work on most Unices, I don't know how portable
edb is.

Briefly, the requirements are:

A Unix or Linux OS
PHP >= 4.0.6
Imlib2 >= 1.0.3
edb >= 1.0
freetype >= 1.3.1
libjpeg
libpng


What's Wrong With GD?
---------------------
There's nothing wrong with GD, I just wanted an alternative.  Aside from
that, Imlib2 is a faster, more powerful library.


Caveats
-------
Imlib2 is not thread safe.  While this isn't a large concern at the
moment, it will become a more important issue as Apache 2 develops and
threaded httpd installations become more common.


About php_imlib
---------------
The general idea behind php_imlib is to mimick the function names and their
parameters as closely as possible at the extension level.  However since
Imlib2 uses a singleton context that I'd rather not duplicate in the
extension, most functions will require extra parameters to establish context.
As we've developed php_imlib, a few needs have also come up which Imlib2
doesn't address.  In those cases we've defined functions in php_imlib which
aren't present in Imlib2.  So far we've added three functions:
imlib_dump_image, for outputting an image to stdout (Comporable to GD's
ImagePng($im)), imlib_image_modify_alpha, and imlib_create_scaled_image, a
shortcut of imlib_create_cropped_scaled_image, which is ideal for creating a
scaled copy of the whole image quickly, such as for generating thumbnails.

To combat the need to have a large number parameters for some of the more
complex functions, I had written a single PHP class to wrap the extension in
version 0.1. However as I developed 0.2, that clearly became insufficent. So,
starting with 0.2 I've included a handful of more reasonably sized classes
that spread things out nicely. I'm fairly pleased with how they've turned
out, but as always, feedback is encouraged. More extensive documentation on
the classes is available in the phpdoc directory.

In the first release, I had also included an abstract image class that
allowed the use of GD and php_imlib with the same code.  At least for the
time being, that's been scrapped, since it was never implemented fully at
the time, and would've occupied far more time than it was worth this time
around.  So, I filed that one away under "bad idea".


Function Reference
------------------
The extension functions are covered in docs/api.txt, the class files are
covered in the phpdoc directory (html only).  Both are available online:

http://mmcc.cx/php_imlib/documentation.php
http://mmcc.cx/php_imlib/phpdoc/
