XLI. Image Functions
Introduction
PHP is not limited to creating just HTML output. It can
also be used to create and manipulate image files in a variety
of different image formats, including gif, png, jpg, wbmp,
and xpm. Even more convenient, PHP can output image streams
directly to a browser. You will need to compile PHP with
the GD library of image functions for this to work. GD and
PHP may also require other libraries, depending on which
image formats you want to work with.
You can use the image functions in PHP to get the size
of JPEG, GIF, PNG, SWF, TIFF and JPEG2000 images.
Note: Read requirements section about how to expand image
capabilities to read, write and modify images and to read
meta data of pictures taken by digital cameras.
Requirements
If you have the GD library (available at http://www.boutell.com/gd/)
you will also be able to create and manipulate images.
The format of images you are able to manipulate depend
on the version of GD you install, and any other libraries
GD might need to access those image formats. Versions of
GD older than gd-1.6 support GIF format images, and do not
support PNG, where versions greater than gd-1.6 support
PNG, not GIF.
Note: Since PHP 4.3 there is a bundled version of the GD
lib. This bundled version has some additional features like
alpha blending, and should be used in preference to the
external library since its codebase is better maintained
and more stable.
You may wish to enhance GD to handle more image formats.
|