Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/07/2008, 14:16
machoman112233
Invitado
 
Mensajes: n/a
Puntos:
Warning imagen redimensionada... [function.getimagesize]: failed to open str

Hola de nuevo... resulta que php que he echo para mostrar los thumbnails va mal... no se porque cuando pongo una rita del tipo "xxx/xxx/xxx.jpg" me da warnings y no me muestra nada y en cambio si pongo solo "xxx.jpg" no me da...

Código PHP:
Warninggetimagesize(NORMAL.JPG) [function.getimagesize]: failed to open streamNo such file or directory in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 24

Warning
Division by zero in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 43

Warning
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 51

Notice
Undefined variableimg in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 53

Warning
imagecopyresampled(): supplied argument is not a valid Image resource in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 53

Warning
imagedestroy(): supplied argument is not a valid Image resource in C:Archivos de programaEasyPHP 2.0b1wwwimg.php on line 70 
Bueno aqui pongo el codigo del php para redimensionar las imagenes

Código PHP:
<?php
if(isset($_GET['posicion'])==false)
{
    
$posicion="";
}
else
{
    
$posicion=$_GET['posicion'];
}

$ruta=basename($_GET['imagen']);

if(
$posicion==1)
{
    
$x_max=200
}
else
{
    
$x_max=500;
}


$foto=getimagesize($ruta); // [function.getimagesize]: failed to open stream: No such file or directory

if($foto[2]==1)
{
    
$img = @imagecreatefromgif($ruta);
}
if(
$foto[2]==2)
{
    
$img = @imagecreatefromjpeg($ruta);
}
if(
$foto[2]==3)
{
    
$img = @imagecreatefrompng($ruta);
}

$img_x=$foto[0]; 
$img_y=$foto[1]; 

$relxy=0
$relxy=$x_max/$img_x

if(
$relxy<1)
{
    
$img_x=$x_max;
    
$img_y=$img_y*$relxy;
}

$thumb imagecreatetruecolor($img_x,$img_y);

imagecopyresampled($thumb$img0000$img_x,$img_y$foto[0], $foto[1]);

if(
$foto[2]==1)
{
    
header("Content-type: image/gif");
    
imagegif($thumb);
}
if(
$foto[2]==2)
{
    
header("Content-type: image/jpeg");
    
imagejpeg($thumb);
}
if(
$foto[2]==3)
{
    
header("Content-type: image/png");
    
imagepng($thumb);
}
imagedestroy($thumb);
?>