Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@randomecho
Created February 20, 2013 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomecho/4999494 to your computer and use it in GitHub Desktop.
Save randomecho/4999494 to your computer and use it in GitHub Desktop.
Create and save image from Base 64 string
/**
* Create and save image from Base 64 string
*
*/
public function generate_image($base64_string, $save_location)
{
$gen_image = imagecreatefromstring(base64_decode($base64_string));
if ($gen_image !== false)
{
imagejpeg($gen_image, $save_location);
}
else
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment