The simplest way to do this is let php decide what is the file type:
$image = imagecreatefromstring(file_get_contents($src));
The simplest way to do this is let php decide what is the file type:
$image = imagecreatefromstring(file_get_contents($src));