Basándome en lo que habéis dicho, he escrito lo siguiente:
Código PHP:
$parts=explode(".",$ruta);
$ext=$parts[count($parts)-1];
$func = 'createimagefrom' . $ext;
$fuente = @$func($ruta);
$imgAncho = imagesx ($fuente);
$imgAlto =imagesy($fuente);
$imagen = ImageCreate($ancho,$alto);
ImageCopyResized($imagen,$fuente,0,0,0,0,$ancho,$alto,$imgAncho,$imgAlto);
Header("Content-type: image/jpeg");
imagen($imagen, imagenPequena.jpeg);
Pero algo funciona mal porque no me guarda el archivo. ¿Sabéis que puede ser?
EDIT: Creo que el problema esta en $fuente = @$func($ruta);