如何使用php输出图像? [英] How to output images using php?
本文介绍了如何使用php输出图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?php
$f = new SaeFetchurl();
$img_data = $f->fetch( 'http://ss7.sinaimg.cn/bmiddle/488efcbbt7b5c4ae51ca6&690' );
$img = new SaeImage();
$img->setData( $img_data );
$img->resize(200);
$img->flipH();
$img->flipV();
$new_data = $img->exec();
$img->exec( 'jpg' , true );
if ($new_data === false)
var_dump($img->errno(), $img->errmsg());
?>
这是sina sae的代码.它提供图像服务.当我将代码粘贴到页面上时,我只能在浏览器中看到混乱情况.
Here is the code from sina sae. It offers images service. When I paste the code on my page, I just can see the mess in the browser.
这是什么意思"$ img-> exec('jpg',true);"是什么意思?
What does this "$img->exec( 'jpg' , true );" mean?
如何使用php输出图像?
How to output the images using php?
推荐答案
一团糟,您是说一堆字符吗?
With mess you mean a bunch of characters?
尝试设置标题信息
header('Content-type: image/jpeg');
这篇关于如何使用php输出图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文