Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/11/2005, 04:14
Avatar de tralara
tralara
 
Fecha de Ingreso: diciembre-2003
Mensajes: 230
Antigüedad: 22 años, 10 meses
Puntos: 0
Problema con thumbnails.

Hola a todos, a ver si me podeis echar un cable. Porque solo imprime un registro este script? Al cargar la pagina parece que los lee todos pero solo muestra uno!!

Código PHP:
<?

$query_art 
= "SELECT * FROM arte WHERE tipo LIKE '%imagen%'";


$art = mysql_query($query_art);
$ancho = 60;
$alto = 40;

while(
$row = mysql_fetch_assoc($art)){

$img = $row['file'];

if(
ereg("jpg",$img)){
        
$img_temp = imagecreatefromjpeg($img);
        
$type = "image/jpeg";
        
$func = "imagejpeg";
    }elseif(
ereg("gif",$file)){
        
$img_temp = imagecreatefromgif($img);
        
$type = "image/gif";
        
$func = "imageGif";
        }elseif(
ereg("png")){
            
$img_temp = imagecreatefrompng($img);
            
$type = "image/png";
            
$func = "imagepng";
        }


 
$imgAncho = imagesx ($img_temp); 
$imgAlto =imagesy($img_temp); 
$imagen = imagecreate($ancho,$alto);

imagecopyresized($imagen,$img_temp,0,0,0,0,$ancho,$alto,$imgAncho,$imgAlto);

Header("Content-type: ".$type); 
imagejpeg($imagen,"",70);
imagedestroy($imagen);
}
?>
Saludos