Jump to content


Photo

including GD generated image


  • Please log in to reply
2 replies to this topic

#1 Akira

Akira
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 05 April 2006 - 09:52 AM

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



Imagejpeg($finalimage);
Imagedestroy($finalimage);
Imagedestroy($thermImage);
Imagedestroy($thermbarImage);

Greetz Akira


#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 05 April 2006 - 09:59 AM

[!--quoteo(post=361895:date=Apr 5 2006, 10:52 AM:name=Akira)--][div class=\'quotetop\']QUOTE(Akira @ Apr 5 2006, 10:52 AM) View Post[/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
Imagejpeg($finalimage);
Imagedestroy($finalimage);
Imagedestroy($thermImage);
Imagedestroy($thermbarImage);
[/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
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 Akira

Akira
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 05 April 2006 - 10:05 AM

[!--quoteo(post=361896:date=Apr 5 2006, 11:59 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Apr 5 2006, 11:59 AM) View Post[/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!

Greetz Akira





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users