Hi,
I am pulling images from my webserver.
I have tried two alternatives for sending them to the browser, fpassthru and ImageJPEG (using GD).
Here is my problem:
- fpassthru always gives me BMPs (when trying to save them, the browser claims they are, at least)
- ImageJPEG creates images where the quality differs from the original, or the images are much bigger in size...
Here is the code I used for fpassthru:
header( "Content-type: image/jpeg\nContent-Disposition: inline;filename=\"mypic.jpg\"\nContent-length:".(string)(filesize($filename)) );
$fp=fopen($filename, "rb");
fpassthru($fp);
flush();
And: no, I can't simply do an "echo <img src="pathtothefile"> sort of thing, as I need to restrict access to the images..
Any ideas? Does fpassthru always put out bmps or am I doing something wrong?
I appreciate your help.
Toby