Created
June 24, 2014 17:09
-
-
Save pedrokoblitz/fbf59c3e0f7c67b39dca to your computer and use it in GitHub Desktop.
image manipulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function show() { | |
// Begin capturing the byte stream | |
ob_start(); | |
// generate the byte stream | |
imagejpeg($this->image, NULL, 100); | |
// and finally retrieve the byte stream | |
$rawImageBytes = ob_get_clean(); | |
echo "<img src='data:image/jpeg;base64," . base64_encode( $rawImageBytes ) . "' />"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment