Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2004, 22:11
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 4 meses
Puntos: 1
Duda con PHP 5 y GD?

Hola tengo instalado el PHP 5 RC2 en mi PC y todo me está funcionando de maravilla. La cosa es que estoy desarrollando una función para generar thumbnails de imagenes que están guardadadas en un directorio y cuyo nombre se haya guardado en la BD. El código es este:
Código PHP:
function CreateThumbnail($filename){
  
$img imagecreatefromjpeg($filename);
  
$width imagesx($img);
  
$height imagesy($img);

  if(((
$width==1024) || ($width==800) || ($width==640))&&(($height==768)||($height==600)||($height==480))){
   
$new_width 144;
   
$new_height 108;
  }

  
$new_img imagecopyresized($thumbnail$img0,0,0,0$new_width$new_height$width$height);

  
header("Content-type: image/jpeg");
  
imagejpeg($new_img);
 } 
y lo llamo de esta forma:
CreateThumbnail("images/wallpapers/Abstract_094.jpg");

pero me pone estos errores:
Cita:
Warning: imagecopyresized(): supplied argument is not a valid Image resource in c:\wamp\www\reynierpm\functions.inc.php on line 437

Warning: imagejpeg(): supplied argument is not a valid Image resource in c:\wamp\www\reynierpm\functions.inc.php on line 440
ya he comprobado la directiva de mi php.ini y la librería GD2 está activada y funcionando correctamente.
¿Qué es lo que hago mal?

Salu2
__________________
Ing. Reynier Pérez Mira