I have this function:
function imagethumb($imagename,$width,$height) {
// Content type
header('Content-type: image/jpeg');
// Get new dimensions
list($width_orig, $height_orig) = getimagesize($imagename);
if ($width && ($width_orig < $height_orig)) {
$width = ($height / $height_orig) * $width_orig;
} else {
$height = ($width / $width_orig) * $height_orig;
}
// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($imagename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
// Output
imagejpeg($image_p, null, 100);
}
which works fine, when called with nothing else on the page.... How can I bring in the resized image inside an html page, within an image tag, like:
<IMG SRC = "imagehere">
since the function is outputting headers, I'm getting the headers already outputted errors...
thanks!