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, $img, 0,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