The code below watermarks an image with php. To so this the header needs to be set to: header('content-type: image/png');
But after the script has done its stuff with the image i then want it to header me to another page but it cant as the header is already sent, what can i do to get around this? or is it impossible?
header('content-type: image/png');
$watermark = imagecreatefrompng('watermark.png');
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);
$image = imagecreatetruecolor($watermark_width, $watermark_height);
$image = imagecreatefrompng($_GET['src']);
$size = getimagesize($_GET['src']);
$dest_x = $size[0] - $watermark_width - 2;
$dest_y = $size[1] - $watermark_height - 25;
imagecopymerge($image, $watermark, $dest_x, $dest_y, 50, 0, $watermark_width, $watermark_height, 100);
imagepng($image);
imagepng($image, 'lightwaves.png');
?>
2007-10-27
06:52:59
·
3 answers
·
asked by
peter s
1
in
Computers & Internet
➔ Programming & Design