Page 1 of 1

display exif thumbnail and comment on one webpage

Posted: Fri Dec 31, 2004 6:46 am
by baf
hi,

i want to read the exif comment and thumbnail fields of an image and display them on a single website. however i don't have a clue how to do that. resetting the header probably wasn't more than a last desperate try..

with the code below the thumbnail gets displayed fine while the following text is not visible.

Code: Select all

<?php
   $thumb = exif_thumbnail ("testpic.jpg"); //thumb is a string
   header('Content-type: image/jpg');
   $thumb = imageCreateFromString($thumb);
   imagejpeg($thumb);
   imagedestroy($thumb);
   header('Content-type: text/html');
   echo "hallo";
?>
is there a way to display contents with different mime types?? could anyone give me a hint how to solve that problem?

thank you
baf

ps: and a happy new year 2005 :wink:


feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Fri Dec 31, 2004 8:34 am
by feyd
[php_man]imagejpeg[/php_man] wrote:The filename argument is optional, and if left off, the raw image stream will be output directly.

Posted: Fri Dec 31, 2004 10:20 am
by baf
sorry for not using the php-tags.

thanks for your answer, but it doesn't helb me solve my problem. i would just get the whole stream in textual form but cannot convert it to be displayed as an image.

baf

Posted: Fri Dec 31, 2004 10:22 am
by feyd
you need a seperate script (or a fiddled version of that script to call as the image, which can then output the image stream. Otherwise, you just send an image stream with a bunch of junk (your html and text) attached.