获取imagejpeg以正确显示 [英] Get imagejpeg to display properly

查看:145
本文介绍了获取imagejpeg以正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何我可以使用它来显示图像而不必保存吗?

Is there anyway I can use this to display an image without having to save it?

imagejpeg( $thumb, NULL, 100 );

这只会在网页上产生奇怪的字符。

This just produces strange characters on the webpage.

推荐答案

您需要正确设置Content-Type标头才能使其正常工作:

You need to set the Content-Type header properly for this to work:

header('Content-Type: image/jpg');

这篇关于获取imagejpeg以正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆