I have a GD image resource created from imagecreatefromstring
. After some image operations, I want to convert it back to binary data. How would I do this? Can't see any functions in the manual...
views:
73answers:
1
+1
A:
Use imagejpeg, imagepng, or similar. Use output buffering if you want to dump the result to a string, rather than a file:
ob_start();
imagejpeg($im);
$image_string = ob_get_contents();
ob_end_flush();
Adam Backstrom
2010-02-05 14:41:56