Here is what I am doing:
Allow user to upload image.
I create a thumbnail of the image.
Want to save thumbnail to database.
A little code:
Code: Select all
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
So as you can see, dst_img is a truecolor gd image. How can I get the bytes from that to put into the database? I know I could save it as a temporary file, read the file bytes, save those, then delete the temporary file, but I would rather not do that.