Ik slaag er niet in mijn foto in het midden van de pagina te plaatsen, de code <center> wordt steeds genegeerd en als ik het document type heel bovenaan de pagina zet, wordt de foto niet weergegeven..Ziet iemand hiervoor een oplossing?
<?php
$foto_src = 'uploads/' . $foto['foto_filename'];
list ($breedte, $hoogte) = getimagesize($foto_src);
$image_ratio = $breedte/$hoogte;
if ($image_ratio > 1){
$new_width = THUMB_SIZ;
$new_height = THUMB_SIZ/ $image_ratio;
}
else{
$new_height = THUMB_SIZ;
$new_width = THUMB_SIZ * $image_ratio;
}
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($foto_src);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $breedte, $hoogte);
imagejpeg($image_p, null);
header('Content-Type: image/jpeg');
$foto_size = filesize($foto_src);
$foto_size = round($foto_size/1024, 1);?>
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<center><img src="<?php echo $foto_src;?>" /></center>
</body>
</html>