Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/07/2005, 21:36
Avatar de The_Dark_Roy
The_Dark_Roy
 
Fecha de Ingreso: enero-2004
Mensajes: 218
Antigüedad: 20 años, 3 meses
Puntos: 0
thumnails: Problema resuelto (para interesados)

tengo un pequeño problema con este script me podrian decir que es lo que esta mal?
Código PHP:
<?php
function resize($origen){
$origen="galerias/holas/holas-03.jpg";
    
$ancho    =80;
    
$imgancho =imagesx($origen);
    if(
$imgancho<=$ancho){
        return 
$origen;
    }
    
$imgalto=imagesy($origen);
    
$alto=$ancho*($imgalto/$imgancho);
    
$imagen=imagecreate($ancho,$alto);
    
imagecopyresized($imagen,$origen,0,0,0,0,$ancho,$alto,$imgancho,$imgalto);

$ext=split("[.]",$origen);
$ext=$ext[1];
echo 
"$ext";
if(
$ext=='jpg' || $ext=='jpeg'){
    
$imagen resize(imagecreatefromjpeg($file));
    
header("Content-type: image/jpeg");
    
header("Content-Disposition: inline; filename=".basename($file));
    
imagejpeg($imagen);
}else if(
$ext=='png'){
    
$imagen resize(imagecreatefrompng($file));
    
header("Content-type: image/png");
    
header("Content-Disposition: inline; filename=".basename($file));
    
imagepng($imagen);
}else if(
$ext=='gif'){
    
$imagen resize(imagecreatefromgif($file));
    
header("Content-type: image/gif");
    
header("Content-Disposition: inline; filename=".basename($file));
    
imagegif($imagen);
}
    return 
$imagen;
}

?>
ojala alguien encuentre el error
__________________
ojala te hayas quitado la venda

http://www.surire.cl
http://www.uta.cl

Última edición por The_Dark_Roy; 11/07/2005 a las 16:25