Appending text to an uploaded image

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Speakerguy
Forum Newbie
Posts: 3
Joined: Sat Apr 19, 2003 4:15 pm
Location: California
Contact:

Appending text to an uploaded image

Post by Speakerguy »

I am running an image upload script on my site, to allow people across the internet to host their sigs for free.

Is there a way that I can add some white space to the image at the bottom of it, and in that space add some text (something like "Hosted by cheesepie.com")

This would have to be done as soon as people upload the image. Since the images are stored in a user browsable apache directory listening, I cant tell people to call the image through a php script....

Thanks for any help
BTW, the image upload script is http://www.cheesepie.com/images/upload/
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you might get the image size with imagesx and imagesy, create a larger image with imagecreate, copy the source image with imagecopy and add text via imagettftext

Read more about the limitations of php_gd at http://www.php.net/manual/en/ref.image.php
Speakerguy
Forum Newbie
Posts: 3
Joined: Sat Apr 19, 2003 4:15 pm
Location: California
Contact:

Post by Speakerguy »

skillz...

thanks man :-P
Post Reply