Creating an image file with only PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is it possible to create an image file from a string using only functions
from core PHP (in other words, without 3rd party libraries/applications)?

I'm interested in any image file that is displayable without plugins or
helper applications, like jpg, png, gif.


Re: Creating an image file with only PHP

Peter Jay Salzman wrote:
Quoted text here. Click to load it
"Note:  Since PHP 4.3 there is a bundled version of the GD lib. This  
bundled version has some additional features like alpha blending, and  
should be used in preference to the external library since its codebase  
is better maintained and more stable."

Therefore, if you are using php 4.3 or better, the functions are there.  
You'd need to test for supported types and such since I believe it does  
depend on what the server system supports. I usually use things like


to check if a certain type is supported on the server.


Justin Koivisto, ZCE -

Site Timeline