Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/05/2005, 01:04
Avatar de santidc
santidc
 
Fecha de Ingreso: enero-2005
Mensajes: 88
Antigüedad: 19 años, 3 meses
Puntos: 1
Problemas generando thumbnails

Hola gente tengo un drama que quisiera si me pueden dar una mano tengo el siguiente codigo:


<?php
header('Content-type: image/jpeg');
$myimage = resizeImage('01.jpg', '150', '120');
print $myimage;

function resizeImage($filename, $newwidth, $newheight){
list($width, $height) = getimagesize($filename);
if($width > $height && $newheight < $height){
$newheight = $height / ($width / $newwidth);
} else if ($width < $height && $newwidth < $width) {
$newwidth = $width / ($height / $newheight);
} else {
$newwidth = $width;
$newheight = $height;
}
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
return imagejpeg($thumb);
}
?>


Bueno este codigo anda de 10 el tema es que anda bien cuando esta solo, osea cuando le pongo un por ejemplo:

print("hola"); o un echo"hola"; me tira error en el "headers already sent by..."

como puedo solucionar esto para tener obvio foto con texto, saludos a todos y gracias
__________________
SantiDC
-------------------------------------
www.pedilo.com
un mundo de publicaciones gratis