Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Binary Content from Image Resource
April 16, 2006, 5:13 pm
rate this thread
a function in the gd lib function list that would let me do this. Im
probably just slow today.
Im doing a scaling script which im pretty sure is working great except
one of my goals is to never have to write this stuff to a temporary
file. I store all of my images in the db so when i make this new scaled
image, id like to just add it as a new image to the db.
right now im doing a bunch of stuff and then these 2 lines
$scaledImage = imagecreatetruecolor($targetWidth,$targetHeight);
imagecopyresampled($scaledImage, $originalImage, 0, 0, 0, 0,
$targetWidth, $targetHeight, $originalWidth, $originalHeight);
That leaves me with $scaledImage as a php image resource containing
what i need. My question is this:
How do i get the binary data out of $scaledImage so that i can then
write that to the db. I already have scripts written to add binary data
to a database, its the actually pulling that information out of
$scaledImage that i cant figure out.