[PySide] QWebEngineView resize error

Tim Roberts timr at probo.com
Tue Sep 8 18:44:57 CEST 2020

Dennis Pielken wrote:
> ...
> I want to use QWebEngineView to create a screenshot of a complete web 
> page. This is mostly working for “shorter pages”, but it is not 
> working for longer pages.
> The only solution to take a screenshot of a complete webpage is to 
> resize the QWebEngineView to the contentSize of QWebEnginePage. The 
> following code is working for shorter pages (self inherits 
> QWebEngineView):
> ...
> generates the following errors:
>    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
> ...
>    QOpenGLFramebufferObject: Framebuffer incomplete attachment.
>    QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
>    [13092:9676:0908/151509.277:ERROR:gles2_cmd_decoder.cc(5678)]
>    GLES2DecoderImpl::ResizeOffscreenFramebuffer failed to allocate
>    storage due to excessive dimensions.
> ...
> This error can be reproduced with longer Facebook timelines as well.
> The gles2 errors (the last three lines) are repeated indefinitely. I 
> have not found a way to fix this. I have checked that the page is not 
> bigger than the maximum size of the widget.

What do you mean by that?  Facebook pages can be infinitely long; they 
generate new data as you scroll toward the bottom of what was already 
sent.  There are limits to the size of bitmaps, and of course there are 
limits to your memory.  Even the browsers don't store the whole page in 
memory as a bitmap.

> I am running Windows 10, Python 3.8.1, PySide2
> Is this a bug in PySide2 / Qt or how can I take a screenshot of a 
> longer page? I have tried this example with PyQt as well and ran into 
> the same errors…

You can't.  Web pages don't have a maximum size.  You'll need to deal 
with subsets.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20200908/ee53fd37/attachment.bin>

More information about the PySide mailing list