Thursday, January 08, 2009
PHP Image manipulation with GD2
welcome to infomix.blogspot.com
One of the more surprising things you can learn about PHP is that it’s actually very useful when it comes to manipulating images of varying filetypes and formats. And a good thing too, since a lot of the internet is made up of pictures!
The functionality of PHP in terms of image manipulation ranges from very simple resizing of images through to more complex effects and functions using image libraries such as ImageMagick
In this tutorial, I’ll take you through some of the more common uses for PHP when manipulating images, and then introduce you to some of the cooler aspects of this powerful little tool, which could help you to really add a bit of jazz and sparkle to your website!
Let’s start with something simple. We’ll take a particular image, how about, let’s say, an image of a cute puppy and then run some functions on it to determine a few facts about it.
getimagesize()
We’ll start here by determining the image type (is it a jpeg, gif, png?), dimensions (height and width) and a few other things by using the getimagesize() function. Note that for this example, the image we’re using - puppy.jpg - must be in the same directory as the PHP script we’re calling this function from
0 Responses to "PHP Image manipulation with GD2"
Post a Comment