0
4

3 回答 3

0

不知道你的问题是什么,似乎它输出一个png图像,一个字节一个字节,如果你添加会发生什么

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=image.png');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');

?

于 2012-02-24T17:38:50.413 回答
0

您可以参考 pImage.class.php Line.171 中函数 autoOutput() 的实现。

该函数执行的操作将根据 Web 服务器和 PHP 之间的接口类型而有所不同。

因此,乱码输出是 png 文件的内容。如果您评论页面中的所有其他 html 输出,您将在浏览器中看到图表的完整图像。

于 2012-08-05T10:25:22.760 回答
0

Somehow the header information is not being properly set for rendering the image to the browser directly.

Long story chort. Use $Image->Render("test.png") instead of $Image->Stroke() and make a reference in your page like so:

<img src="test.png" />
于 2012-07-15T18:23:23.843 回答