用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1688|回复: 0
收起左侧

[版本 3.x] header('Content-type: image/jpeg')输出图片无法显示

[复制链接]
发表于 2015-9-9 01:57:30 | 显示全部楼层 |阅读模式
如题
我在CI里用了几三种方法都不行,图片始终无法正常显示出来,不知道什么原因,请各位熟悉CI的朋友帮我看下是怎么回事。
失败的三种方法如下:
一:
$pic_url = file_get_contents('D:/123.jpg');(图片路途没有问题)
header('Content-type: image/jpeg');
echo $pic_url;


二:
ob_start();
$this->ImageResizeNew('D:/123.jpg', 240, 180, '', false);(这个输出图象函数没问题)
$imagevariable = ob_get_contents();
ob_end_clean();
header('Content-type: image/jpeg');
echo $imagevariable;


三:
$this->output
    ->set_content_type('image/jpeg')
    ->set_output(file_get_contents('D:/123.jpg'));


本版积分规则