I was trying to print on screen an image within a div by doing this in my layout php file:
[code=php]
<?php header(“Content-type: image/jpeg”); ?>
…
<img src=”index.php?var=<?php echo $value; ?>” />
but something isn’t going as expected.
the invoked code does this at the end:
[code=php]
$success = imagejpeg($image, ‘images/postcards/postcard.jpg’);
$success = imagejpeg($image);
imagedestroy($image);
As you can see, I’m trying to do two different things with the image:
1- To dump it and save it in a jpeg file, which is working right
2- To directly output the data as a jpg image on the browser. This is not working right. Despite the second line returns true as well as the first line does, the image is not displayed.
Why could the first choice be wrong and not display the image?