Chapter 18. Creating and Managing Images


If God created us in his image we have certainly returned the compliment.

”Voltaire (1694-1778)

The purpose of a Web site is to interact with your users, whomever they might be. An extremely effective way of interacting with users is through the use of visuals. As the saying goes, "A picture is worth a thousand words." However, with the Web more than any other medium, pictures have become vital , mainly because your customers don't always speak the same language that you do and visuals might be your only means of communication. Also the careful use of images can inspire trust in both a product and a company, despite any language barriers.

PHP offers an interface to the GD module by Thomas Boutell, which in turn currently supports the creation and management of JPEGs and PNGs. By using the functions provided, you can create, add text to, draw pictures on, and modify preexisting PNG and JPEG images.

Perhaps the observant reader has noticed that there is no mention of GD supporting the creation of probably the most popular format on the Web: GIF. As of GD 1.4, GD no longer supports the creation and management of GIF images because of the licensing restrictions placed on the LZW algorithm by Unisys. More information about this matter can be found in Lincoln Stein's excellent article for Webtechniques, "Fugitive from Justice." You can view arguments online at http://www.webtechniques.com/archives/1999/12/webm/index.shtml.

In this chapter, we cover how to create and manipulate PNG, JPEG, and GIF images. (You can use GIFs, illegally, if you compile with GD 1.3 or earlier.)



PHP Developer's Cookbook
PHP Developers Cookbook (2nd Edition)
ISBN: 0672323257
EAN: 2147483647
Year: 2000
Pages: 351

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net