imagecreatefromany
GD, PHP
Читаем изображение, формат которого неизвестен.
function imagecreatefromany($filename) {
foreach (array('png', 'jpeg', 'gif', 'bmp', 'ico') as $type) {
$func = 'imagecreatefrom' . $type;
if (is_callable($func)) {
$image = @call_user_func($func, $filename);
if ($image) return $image;
}
}
return false;
}
