Introduction to Image Manipulation in php + GD

Written By: Nathan Baker

- 24 Jul 2006 -
















Description: We all know that php is very useful for generating dynamic webpages. However, fewer people know that it is also useful for generating dynamic images! In this tutorial, I will guide you through generating image thumbnails on the fly.

  1. Introduction
  2. php: HTML++
  3. OK, I'm excited! Let's write the getImage function!
  4. That's it!

That's it!

What, you thought there was something else coming? Well, nope, this one was pretty easy. What, you want to know how to use this script? Man, do I have to do everything for you? Well, in this case it's pretty easy.

 src='/display.php?img=/img/myimage.jpg&scale=.5' />

And there you go. If you want to know why the & instead of just a straight-up ampersand, well, ask the W3C. Apparently they like that kind of thing.

As always, feel free to e-mail me with questions, comments, errata, observations, remarks, marriage proposals, or compliments: I'm at []. Code to live!

<< Previous