EN49

Page 383

* This returns the unencoded string representation of the image */ $imgBuff = $img->getimageblob(); /** * This clears the image.jpg resource from our $img object and destroys the * object. Thus, freeing the system resources allocated for doing our image * manipulation. */ $img->clear(); /** * This creates the base64 encoded version of our unencoded string from * earlier. It is then output as an image to the page. * * Note, that in the src attribute, the image/jpeg part may change based on * the image type you're using (i.e. png, jpg etc). */ $img = base64_encode($imgBuff); echo "<img alt='Embedded Image' src='data:image/jpeg;base64,$img' />";

GoalKicker.com – PHP Notes for Professionals

370


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.