function load_base64($base64string)
{
if (!extension_loaded('gd')) {
throw new Exception('Required extension GD is not loaded.');
}
//remove data URI scheme and spaces from base64 string then decode it
$this->imagestring = base64_decode(str_replace(' ', '+', preg_replace('#^data:image/[^;]+;base64,#', '', $base64string)));
$this->image = imagecreatefromstring($this->imagestring);
return $this->get_meta_data();
}