Manipulate Images with PHP/GD
The insta-slideshow is a helpful little beast, but it doesn't demonstrate actual manipulation of the photos.
Before attempting to create or manipulate images using PHP, see what your hosting company has installed for your use, or if you are running the applications locally, install the necessary graphics libraries.
Figure 13-1. The drop-in insta-slideshow application
To explore what's installed, the following small PHP application page pulls up information about your PHP installation, including supported libraries:
<? php phpinfo(); ?>
Saving the file as info.php and accessing this page on my local Mac-based development machine, as well as my Linux-based hosted web account, I can see support for EXIF, GD, and IMagick PHP libraries, as shown in Figure 13-2. I'll cover metadata manipulation with EXIF in Chapter 15, and IMagick later in this chapter, but for now all I need is the GD Graphics Library support.
Tip
The GD library is an open source graphics library, with interfaces built into several programming languages, such as PHP. Beginning with version 4.3 of PHP, a GD library is implemented as part of the basic language package. This includes PHP for Windows, as well as the Unix and Mac-based installations. Most ISPs offering basic web hosting provide support for the GD functions, ready for you to use, right out of the box. For more on this package, see the ...
Get Painting the Web now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.