Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to create an image on the fly?
- Gunnar G
January 30, 2007, 3:13 pm
rate this thread
I've created an image with this code
$image = ImageCreate($W,$H);
$white = ImageColorAllocate($image,255,255,255);
$black = ImageColorAllocate($image,0,0,0);
but now I wish to add a line
before the image code, then I only get garbage, the header command is
probably invalid now. So how do I create the image without having to save
the image to a file?
Re: How to create an image on the fly?
Your code should return html OR an image.
It cannot return both because they have different mimetypes.
So you need a script that returns html OR an image, not both.
A trick to debug your imagecreationscript is changing you
so you can see errors in your PHP-code.
Of course you'll have to put it back to the original when you think the
imagecreationscript runs fine.