Hola amigos tengo el siguiente codigo, pero consigo redimensianar todas menos el formato bmp.
A ver si me podeis ayudar. Gracias
Código PHP:
function redimensionar($anchura,$hmax,$nombre)
{
$datos = getimagesize($nombre);
if($datos[2]==1){$img = @imagecreatefromgif($nombre);}
if($datos[2]==2){$img = @imagecreatefromjpeg($nombre);}
if($datos[2]==3){$img = @imagecreatefrompng($nombre);}
if($datos[2]==6){$img = @imagecreatefromwbmp($nombre);}
$ratio = ($datos[0] / $anchura);
$altura = ($datos[1] / $ratio);
if($altura>$hmax){$anchura2=$hmax*$anchura/$altura;$altura=$hmax;$anchura=$anchura2;}
$thumb = imagecreatetruecolor($anchura,$altura);
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);
if($datos[2]==1){header("Content-type: image/gif"); imagegif($thumb);}
if($datos[2]==2){header("Content-type: image/jpeg");imagejpeg($thumb);}
if($datos[2]==3){header("Content-type: image/png");imagepng($thumb); }
if($datos[2]==6){header("Content-type: image/vnd.wap.wbmp");imagewbmp($thumb); }
imagedestroy($thumb);
}
if(isset($_GET['ancho'])&&isset($_GET['alto'])&&isset($_GET['name']))
{
redimensionar($_GET['ancho'],$_GET['alto'],$_GET['name']);
exit;
}