Jump to content

Archived

This topic is now archived and is closed to further replies.

Akira

including GD generated image

Recommended Posts

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 advise

I 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]

Share this post


Link to post
Share on other sites
[!--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 advise

I 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

Share this post


Link to post
Share on other sites
[!--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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.