function getImgSrc($fileName)
{
$mime_type = getimagesize($fileName);
//print_r($mime_type);
switch($mime_type[‘mime’])
{
case ‘image/png’:
$src = imagecreatefrompng($fileName);
break;
case ‘image/gif’:
$src = imagecreatefromgif($fileName);
break;
case ‘image/jpeg’:
$src = imagecreatefromjpeg($fileName);
break;
case ‘image/wbmp’:
$src = imagecreatefromwbmp($fileName);
break;
}
return $src;
}
Last updated: March 19, 2014