Akira Posted April 5, 2006 Share Posted April 5, 2006 I have some code ( see under the code output) which I put in a seperate file, now i want to include the generated image on my main page. But somehow when i include the file, it gives only the pure text image instead of the jpg image :| First i thought it might be the Header("Content-Type: image/jpeg"); , but that wasn;t the problem.So how can i include this image in a normal way ? please adviseI have some code ( see under ) which I put in a seperate file, now i want to include the generated image on my main page. But somehow when i include the file, it gives only the pure text image instead of the jpg image :| First i thought it might be the Header("Content-Type: image/jpeg"); , but that wasn;t the problem.So how can i include this image in a normal way ? please adive[code]Imagejpeg($finalimage);Imagedestroy($finalimage);Imagedestroy($thermImage);Imagedestroy($thermbarImage);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/6647-including-gd-generated-image/ Share on other sites More sharing options...
redbullmarky Posted April 5, 2006 Share Posted April 5, 2006 [!--quoteo(post=361895:date=Apr 5 2006, 10:52 AM:name=Akira)--][div class=\'quotetop\']QUOTE(Akira @ Apr 5 2006, 10:52 AM) [snapback]361895[/snapback][/div][div class=\'quotemain\'][!--quotec--]I have some code ( see under the code output) which I put in a seperate file, now i want to include the generated image on my main page. But somehow when i include the file, it gives only the pure text image instead of the jpg image :| First i thought it might be the Header("Content-Type: image/jpeg"); , but that wasn;t the problem.So how can i include this image in a normal way ? please adviseI have some code ( see under ) which I put in a seperate file, now i want to include the generated image on my main page. But somehow when i include the file, it gives only the pure text image instead of the jpg image :| First i thought it might be the Header("Content-Type: image/jpeg"); , but that wasn;t the problem.So how can i include this image in a normal way ? please adive[code]Imagejpeg($finalimage);Imagedestroy($finalimage);Imagedestroy($thermImage);Imagedestroy($thermbarImage);[/code][/quote]if the seperate file is purely responsible for drawing/outputting the image, then you need to include the file using <img> tags (like a normal picture) and NOT via an 'include' statement. if you do the latter, the headers won't be sent properly/at all as you'll have already displayed content on your page.hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/6647-including-gd-generated-image/#findComment-24139 Share on other sites More sharing options...
Akira Posted April 5, 2006 Author Share Posted April 5, 2006 [!--quoteo(post=361896:date=Apr 5 2006, 11:59 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Apr 5 2006, 11:59 AM) [snapback]361896[/snapback][/div][div class=\'quotemain\'][!--quotec--]if the seperate file is purely responsible for drawing/outputting the image, then you need to include the file using <img> tags (like a normal picture) and NOT via an 'include' statement. if you do the latter, the headers won't be sent properly/at all as you'll have already displayed content on your page.hope that helps[/quote]mm stupid me :) i was alrdy trying it with the image tag, but didn;t imagine that you could inlcude a image like <img src='include/image.php'>, so with the .php extension :)Thnx heaps! Quote Link to comment https://forums.phpfreaks.com/topic/6647-including-gd-generated-image/#findComment-24141 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.