Author Topic: Is there such a script?  (Read 215 times)

Newbie

  • Guest
Is there such a script?
« on: June 10, 2012, 06:38:13 PM »
I was wondering if there was a PHP script that would put custom text on an image, and then save the image. There would be a text field where text would be inserted. Then the text would appear on the image, and the image would be saved with the text on it.

Is this possible? I am very new when it comes to coding.

richei

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 1120
  • Karma: 22
    • View Profile
Re: Is there such a script?
« Reply #1 on: June 10, 2012, 11:54:14 PM »
Never had to do it, but you might look into using the gd library.

RaythXC

  • PHP Programmer & Web-Designer
  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 395
  • Karma: 10
  • Freelance PHP Programmer/Web-Designer
    • View Profile
    • Rayth.Info
Re: Is there such a script?
« Reply #2 on: June 11, 2012, 01:57:56 AM »
I do something similar for my captcha form where it generates the text randomly though I don't see why you couldn't use a form to decide the text. Idk how you would do it to an already existing image though.
RaythXC - My Home Site
Note: most answers I give come from the php manual located at PHP.Net

richei

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 1120
  • Karma: 22
    • View Profile
Re: Is there such a script?
« Reply #3 on: June 11, 2012, 04:27:59 AM »
Here's a basic watermark script - http://www.php.net/manual/en/image.examples.merged-watermark.php.  Change the text in

imagestring($stamp, 5, 20, 20, 'libGD', 0x0000FF);
imagestring($stamp, 3, 20, 40, '(c) 2007-9', 0x0000FF);

and that should work.