Skip to Main Content
Painting the Web
book

Painting the Web

by Shelley Powers
May 2008
Beginner content levelBeginner
656 pages
17h 41m
English
O'Reilly Media, Inc.
Content preview from Painting the Web

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.

The drop-in insta-slideshow application

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick
Mastering PHP 7

Mastering PHP 7

Branko Ajzele

Publisher Resources

ISBN: 9780596515096Supplemental ContentErrata Page