Lūk kods no PHP manuāļa
<?php
// File and new size
$filename = 'F:/bilde.jpg';
$percent = 0.5;
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
?>
Itkā visam vajadzētu iet, bet met ārā to pašu -> Warning: Cannot modify header information - headers already sent by ... bla bla blā
Bet header jau ir pašā sākumā (nekas nemainās ja arī noliek pirms tiem mainīgajiem). Kāds zin, kas tā par vainu?