Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large screenshot height and delay problems #4

Open
kerray opened this issue Oct 2, 2017 · 6 comments
Open

Large screenshot height and delay problems #4

kerray opened this issue Oct 2, 2017 · 6 comments

Comments

@kerray
Copy link

kerray commented Oct 2, 2017

Hi,
I'm trying to use Netshot (in a container on GCloud) to grab a screenshot of a complicated page with 10k px height and 60s delay - lot's of processing after load. The resulting PNG has about 2-3 MB.

Netshot either completes successfully and returns image url (which then throws 404, while other images work), or says Electron returned null.

When trying in Electroshot on command line, it works fine. I'm unable to test Netshot, since it just tells me "unable to start electroshot" when running it in Windows.

I'd be glad for any pointers to what I can try...

@handcraftedbits
Copy link
Owner

Are you using the netshot Docker container?

@kerray
Copy link
Author

kerray commented Oct 2, 2017

There's a single instance of "handcraftedbits/netshot" started through Kubernetes - I hope that's the same thing

@kerray
Copy link
Author

kerray commented Oct 12, 2017

it seems to me after playing with this some more that there is some kind of internal timeout on some of the executed functions - the browser is waiting to read the page, but the function waiting on it times out, which is why standalone Electroshot doesn't have this problem - is that possible?

EDIT: could it be https://stackoverflow.com/questions/23874954/is-there-a-default-timeout-in-nodejs-for-http-request ?

@kerray
Copy link
Author

kerray commented Oct 17, 2017

I've solved the timeout problem and made some changes in order to correctly run Netshot under Windows - https://github.com/kerray/netshot/commit/aa51354e1d10c7bbec457b7dff96b8b96d1fc596, https://github.com/kerray/netshot/commit/e09ab5ad5753f745b6496901cd0eb141d603c80f and https://github.com/kerray/netshot/commit/2c7bdc88dfbf483e0efe998d78e980dac0f80cca

There's another problem however, when the page screenshot is large, once the PNG filesize is slightly over 1 MB, the screenshot doesn't get saved. But only in container - directly it works just fine, on the same set of parameters.

I've connected to the container and ran Electroshot manually with the same url and params that cause problems, and it gets saved correctly - however I have no idea what to look for, when it's Electroshot itself that does the saving (unless I'm mistaken?)

@handcraftedbits
Copy link
Owner

Hi @kerray, thanks for looking into these issues. Can you make pull requests?

I'll see what's happening with the 1MB image.

@kerray
Copy link
Author

kerray commented Oct 18, 2017

There you go, and thanks for looking into these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants