Google it! / Yahoo it! / Bing it! / Ask it!
I’m helping a friend build a CMS for a site and I needed some automatic image resizing. The only possibility was GD so I decided to use it. There are many tutorials out there teaching you how to do it, but I wrote my own function from several GD functions available and some php.net help.
Here is the function: [download]
And here is the caller. Remember to set the path right, both in the function and in the caller.
<?php echo '<a href="image.jpg"><img src="thumbnail.inc.php?img=image.jpg" alt="" /></a>'; ?>
That’s all.
I was looking something like this. I going to give it a try but I don’t know if I will be able to implement it by myself.
Thank you.