PHP gevorderde |
|
beste sitemasters,
ik heb het volgende gevonden:
<?php $size = getimagesize($image);
$maxsize = 450;
$nul = $maxsize / $size[0];
$one = $maxsize / $size[1];
if ($nul < $one){
$width = $size[0] * $nul;
$height = $size[1] * $nul;
}
elseif ($size[1] > 450){
$width = $size[0] * $one;
$height = $size[1] * $one;
}
?>
$maxsize = 450; $nul = $maxsize / $size[0]; $one = $maxsize / $size[1]; if ($nul < $one){ $width = $size[0] * $nul; $height = $size[1] * $nul; } elseif ($size[1] > 450){ $width = $size[0] * $one; $height = $size[1] * $one; } ?>
Nu is de vraag hoe ik dit moet doen alvorens ik het plaatje upload.
|