我有以下脚本将图像输出到浏览器,这很好。在Kohana 3.2视图中输出图像
$file_to_output=$_SERVER['DOCUMENT_ROOT'].'/static/imgs/uploads/20110318172207_16.jpg';
header('Content-Type: image/jpeg');
$raw=imagecreatefromjpeg($file_to_output);
// Output the image
imagejpeg($raw);
// Free up memory
imagedestroy($raw);
,当我在一个视图中把这个完全相同的代码它不工作了,给一串字符STANGE像这样: JFIF> CREATOR:GD-JPEG V1.0 (使用IJG JPEG v62),默认质量 C
要使其在视图中工作,我需要做些什么?
哪个版本的Kohana的是你使用? – Kemo
我使用Kohana 3.2 – waterschaats