yo tengo hecho esto, fijate si te sirve, igualmente lo tengo que mejorar
Código php:
Ver original<?php
$getFile = $_GET['f'];
//ROOT_PATH es una constante predefinida, en mi caso http://localhost/sitio
// Vemos si esta definido el ancho y el alto
//ancho
if(!isset($_GET['ancho'])){ $ancho = 175;
}else{
$ancho = $_GET['ancho'];
}
//alto
if(!isset($_GET['alto'])){ $alto = 175;
}else{
$alto = $_GET['alto'];
}
switch($datos[2]){
case 1:
$contType = 'Content-type: image/gif';
break;
case 2:
$contType = 'Content-type: image/jpeg';
header("Content-type: image/jpg"); break;
case 3:
$contType = 'Content-type: image/png';
break;
}
?>