有没有什么方法我可以用它来显示一个图像而不需要保存它?
imagejpeg( $thumb, NULL, 100 );这只会在网页上产生奇怪的字符。
发布于 2012-02-17 19:56:38
您需要正确设置Content-Type标头才能正常工作:
header('Content-Type: image/jpg');发布于 2012-02-17 19:56:27
您需要为它设置头部
header('Content-Type: image/jpeg');
imagejpeg( $thumb, NULL, 100 );(假设您知道imagejpeg的所有参数)
发布于 2012-02-17 19:58:19
$thumb = imagecreatefromjpeg($url);
header('Content-type: image/jpeg');
imagejpeg($thumb);
imagedestroy($thumb);上面的方法应该是可行的。如果你在框架中这样做,你应该禁用布局。
https://stackoverflow.com/questions/9327734
复制相似问题