Jump to content


Photo

Is This Possible?


  • Please log in to reply
5 replies to this topic

#1 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 24 October 2006 - 09:01 PM

Is it possible to include PHP in an image file, like PNG, GIF, JPG, JPEG, BMP... etc...?

Like if I wanted to echo a number in an image, but keep the extension png, gif, jpg etc...

#2 brendandonhue

brendandonhue
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 24 October 2006 - 09:17 PM

Images aren't in text format so you can't echo the text. You can use imagettftext() or similar functions to write text into an image.

#3 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 24 October 2006 - 09:17 PM

Where could I find a tutorial on this?

#4 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 24 October 2006 - 09:18 PM

Um, google "imagettftext"
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net

#5 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 24 October 2006 - 09:24 PM

Well I wanted to know if it was possible to make a png file use php?

#6 Psycho

Psycho
  • Moderators
  • Move along, nothing to see here
  • 11,892 posts
  • LocationCanada

Posted 25 October 2006 - 04:11 PM

An image file doesn't use anything. As brendandonhue stated you can use imagettftext() or similar functions to use PHP to add text or manipulate an image.

http://us3.php.net/imagettftext
The quality of the responses received is directly proportional to the quality of the question asked.

I do not always test the code I provide, so there may be some syntax errors. In 99% of all cases I found the solution to your problem here: http://www.php.net




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users