Resize billede med gdlib
Hej eksperter.Jeg har fået lavet følgende.
if (type($konfiguration["filtyper"], $filnavn) == "jpg") {
$percent = 0.5;
header('Content-type: image/jpeg');
list($width, $height) = getimagesize($filnavn);
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filnavn);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, null, 100);
};
Dette giver mig dog et output: The image “http://localhost/kpunktet/resize.php” cannot be displayed, because it contains errors.
Hvad går der lige galt ?
