Suchy Posted April 29, 2007 Share Posted April 29, 2007 I have a simple script which adds a watermark to images: $my_text = 'www.mywebsite.com'; $img = imagecreatefromjpeg ('image5.jpg'); $white = imagecolorallocate($img, 255, 255, 255); imagestring($img, 4, 6, 3, $my_text, $white); header("Content-type: image/jpeg"); imagejpeg($img); imagedestroy($img); This works great, however when I put it inside a foreach loop and change the $img variable to: $img = imagecreatefromjpeg($temp_var['url']); Instead of the image with thw watermark I get Warning: Cannot modify header information - headers already sent by (output started at /home/suchygn/public_html/photos/show.php:88) in /home/suchygn/public_html/photos/show.php on line 159 ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC $.' ",#(7),01444'9=82<.342ÿÛC 2!!22222222222222 222222222222222222222222222222222222ÿÀxx"ÿÄ ÿĵ }!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEF How can this be fixed ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.