Created
July 30, 2013 01:50
-
-
Save t-cyrill/6109550 to your computer and use it in GitHub Desktop.
Define getimagesizefromstring to use in PHP 5.3
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
<?php | |
if (!function_exists('getimagesizefromstring')) { | |
function getimagesizefromstring($data) | |
{ | |
$uri = 'data://application/octet-stream;base64,' . base64_encode($data); | |
return getimagesize($uri); | |
} | |
} |
WOW
Thank you, this works well!
Slightly improved to restore the $imageinfo parameter.
if (!function_exists('getimagesizefromstring')) {
function getimagesizefromstring($data, &$imageinfo = array())
{
$uri = 'data://application/octet-stream;base64,' . base64_encode($data);
return getimagesize($uri, $imageinfo);
}
}
thanks!!!
Awesome! It works! Thanks!
Thank you for that <3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great!11