How to chang the max height(current:16384) of screenshot?

2,584 views
Skip to first unread message

sm.o...@gmail.com

unread,
Apr 6, 2017, 2:21:22 AM4/6/17
to headless-dev
Hi,
I love this project and it really help me a lot, but there are some long pages I want to take a screenshot, but it seems that the max height is 16384. What can I do if I want to change the value to a bigger one?

Eric Seckler

unread,
Apr 6, 2017, 6:17:03 AM4/6/17
to sm.o...@gmail.com, headless-dev
The 16384px limit stems from the maximum texture size used by the compositor. For GL rendering, this is actually read from the GL context, so a limitation of the GL backend (GPU, software GL, etc.) that can't be changed. For the software GL backend we use with headless, this limit is 16384px.

If you're using pure software rendering (without GL support), chromium currently sets the max texture size to 16384px, too. You could change that constant in the implementation to something larger, and run with --disable-gpu to force software rending (I tried this, it does seem to work). But note that software rendering doesn't support WebGL content (and probably also any CSS that requires GL to render correctly).

Alternatively, you could grab multiple screenshots at different viewport offsets (using Emulation.forceViewport) and stitch them together yourself.

On Thu, Apr 6, 2017 at 7:21 AM <sm.o...@gmail.com> wrote:
Hi,
I love this project and it really help me a lot, but there are some long pages I want to take a screenshot, but it seems that the max height is 16384. What can I do if I want to change the value to a bigger one?

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/2de06b9a-efce-436d-82da-c4491a7d1812%40chromium.org.

sm.o...@gmail.com

unread,
Apr 7, 2017, 1:08:10 AM4/7/17
to headless-dev, sm.o...@gmail.com
Thanks Eric!

在 2017年4月6日星期四 UTC+8下午6:17:03,Eric Seckler写道:

dot...@gmail.com

unread,
Jul 25, 2017, 4:54:36 AM7/25/17
to headless-dev, sm.o...@gmail.com
Hi,

Emulation.forceViewport is recently obsoleted.
Is there way to take screenshot over the 16384px limit in latest chrome?
I've tried the clip parameter in captureScreenshot(), but it didn't works.


2017年4月6日木曜日 19時17分03秒 UTC+9 Eric Seckler:

Eric Seckler

unread,
Jul 25, 2017, 5:02:49 AM7/25/17
to dot...@gmail.com, headless-dev, sm.o...@gmail.com
I don't think anything changed regarding the maximum texture size, I'm afraid.

dot...@gmail.com

unread,
Jul 25, 2017, 10:41:19 PM7/25/17
to headless-dev, dot...@gmail.com, sm.o...@gmail.com
Thank you for replying.
I continuously search for way to achieve this.

2017年7月25日火曜日 18時02分49秒 UTC+9 Eric Seckler:

wood4...@gmail.com

unread,
Aug 23, 2017, 5:53:42 AM8/23/17
to headless-dev, dot...@gmail.com
Hi, do you find the way?I need your help.

在 2017年7月26日星期三 UTC+8上午10:41:19,dot...@gmail.com写道:

dot...@gmail.com

unread,
Aug 23, 2017, 7:07:48 AM8/23/17
to headless-dev, dot...@gmail.com, wood4...@gmail.com
Hi,

Possibly I had took a mistake.
clip parameter works well with current Chrome canary and beta.
So you can use clip parameter and scroll to capture the full screenshot that is higher than 16384px.


2017年8月23日水曜日 18時53分42秒 UTC+9 wood4...@gmail.com:

wood4...@gmail.com

unread,
Aug 24, 2017, 2:50:47 AM8/24/17
to headless-dev, dot...@gmail.com, wood4...@gmail.com

Thanks for your reply ,I have try clip parameter like this:
const Viewport = {
  x: 0,
  y: 0,
  width: 1280,
  height: 20000,
  scale: 1
}
const screenshot = await Page.captureScreenshot({format, clip: Viewport, fromSurface: true})

but still get a 2560 * 16384 image,I run it in chrome 60 and chrome cancary 62.Any clue?

Eric Seckler

unread,
Aug 24, 2017, 3:04:06 AM8/24/17
to wood4...@gmail.com, headless-dev, dot...@gmail.com

You'll have to capture two separate pictures and stitch them together yourself - one with y=0 and height=16384 and one with y=16384 and height=3626.

There's no way right now to increase the max texture size except by editing and recompiling as mentioned earlier in the thread.


--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.

wood4...@gmail.com

unread,
Aug 24, 2017, 3:09:35 AM8/24/17
to headless-dev, wood4...@gmail.com, dot...@gmail.com, esec...@google.com
I'm so sad to hear this, thanks anyway!

在 2017年8月24日星期四 UTC+8下午3:04:06,Eric Seckler写道:
Reply all
Reply to author
Forward
0 new messages