Jump to content

including GD generated image


Akira

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]
Link to comment
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
Link to comment
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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.