With the GD library functions, it seems one can only output an image resource's binary data directly, or to a file:
PHP Code:
imagejpeg($imgresource);
imagejpeg($imgresource, $filename);
But the data stream can't simply be stored as a variable:
PHP Code:
$datastream = imagejpeg($imgresource);
The above does not work, because imagejpeg() doesn't return a stream, it outputs it.
Why do I want to store the stream itself? Because rather than output the data directly or write a new image file, I want to store it in a database! I've used the GD functions to manipulate an image, and now I want to store the binary data of the resulting image in a database. That is, the same kind of data I would get by running fread() on an existing image.
You know... You're not so smart. Do you need me to educate you?
If you say, "please," (and do so, nicely) then I will show you where you're dead wrong.
Interesting. I've never worked with output buffering; I looked up the documentation after seeing your reply, and it seems pretty straightforward. I'll give it a try!
You know... You're not so smart. Do you need me to educate you?
If you say, "please," (and do so, nicely) then I will show you where you're dead wrong.
Bookmarks