phantomjs 截图网页高度超过 30,000px 输出的图片显示不全,有人知道怎么解决么?

2014-05-22 16:06:42 +08:00
 ksc010
https://github.com/ariya/phantomjs
这个应该是phantomjs的bug 具体情况是 超过3万多像素 截图输出jpg 超过部分是黑色的
若是png超过部分是透明的

@larryzhao 也提交issue了 (今天给你发了封邮件不知道看到没)
https://github.com/ariya/phantomjs/issues/11934

这个问题貌似是fix了 但是不知道为什么还是出现 1049
https://github.com/ariya/phantomjs/blob/master/src/webpage.cpp
// We use tiling approach to work-around Qt software rasterizer bug
// when dealing with very large paint device.
// See http://code.google.com/p/phantomjs/issues/detail?id=54.
const int tileSize = 4096;
int htiles = (buffer.width() + tileSize - 1) / tileSize;
int vtiles = (buffer.height() + tileSize - 1) / tileSize;
for (int x = 0; x < htiles; ++x) {
for (int y = 0; y < vtiles; ++y) {

**Rendering PNGs hangs on some sites while PDF works great.**
http://code.google.com/p/phantomjs/issues/detail?id=54

https://github.com/ariya/phantomjs/commit/e7ca6c0a
5035 次点击
所在节点    问与答
1 条回复
ksc010
2014-05-22 16:23:54 +08:00
phantomjs 这个是c++写的
!-- 目前不想在研究一门新语言了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/113776

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX