getimagesizefromstring function for < 5.4
<?php
if (!function_exists('getimagesizefromstring')) {
function getimagesizefromstring($string_data)
{
$uri = 'data://application/octet-stream;base64,' . base64_encode($string_data);
return getimagesize($uri);
}
}
?>