Reputation: 3
I am using following code to render a JPEG file, which is on disk, through the imagejpeg function:
//.... some headers....
$image = imagecreatefromjpeg($the_file);
imagejpeg($image);
Now, problem is, imagejpeg compresses the image (reduces the quality in my case) and does not output the same file. I know I can control the quality through a parameter, but it seems that imagejpeg does jpeg encoding/decoding. I don't want that (seems a waste, as the file is already a jpeg file). I want a simple function that will just "RENDER" the image (which is what I thought imagejpeg did till now). Can someone tell what to use?
Upvotes: 0
Views: 237
Reputation: 401142
You could use the readfile()
function, to read the file from the disk, and output its content -- without doing any manipulation / transformation on it.
Upvotes: 1