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);
}
CreateThumbnail("images/wallpapers/Abstract_094.jpg");
pero me pone estos errores:
Cita:
ya he comprobado la directiva de mi php.ini y la librería GD2 está activada y funcionando correctamente.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
Warning: imagejpeg(): supplied argument is not a valid Image resource in c:\wamp\www\reynierpm\functions.inc.php on line 440
¿Qué es lo que hago mal?
Salu2
