I have a GD image resource created using imagecreatefromstring . After some image operations, I want to convert it back to binary data. How can I do it? Unable to see any features in the manual ...
imagecreatefromstring
Use imagejpeg , imagepng , or similar. Use output buffering if you want to output the result to a string rather than a file:
ob_start(); imagejpeg($im); $image_string = ob_get_contents(); ob_end_flush();
function image_data($gdimage) { ob_start(); imagejpeg($gdimage); return(ob_get_clean()); }
Source: https://habr.com/ru/post/1300428/More articles:missing elements from two arrays in java - javaStudent Project Ideas: Parallel Computing - parallel-processingIs there a common base for Apple's drawing apps? - javaIs there a difference between setting a property with a period or bracket syntax? - syntaxIs it possible to call matlab functions from Silverlight / C #? - matlabJavascript: prototype method error? - javascriptUpdateList SharePoint Method: Newly Created Columns Not Displayed - c #GWT application - deployment on Tomcat or any other servlet container - javacolumn that will be hidden when creating a list item, but visible when editing a list item in sharepoint 2007 - sharepointIs Cast required for void **? - cAll Articles