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

Value of clip.scale is always reset to 1 for page.screenshot #5329

Closed
whimboo opened this issue Jan 21, 2020 · 4 comments · Fixed by #8908 or #8904
Closed

Value of clip.scale is always reset to 1 for page.screenshot #5329

whimboo opened this issue Jan 21, 2020 · 4 comments · Fixed by #8908 or #8904
Assignees

Comments

@whimboo
Copy link
Collaborator

whimboo commented Jan 21, 2020

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 2.0
  • Platform / OS version: MacOS 10.14
  • URLs (if applicable):
  • Node.js version: 12.1.0

What steps will reproduce the problem?
Using the clip option for page.screenshot with a scale of non 1 like:

Please include code that reproduces the issue.

  await page.screenshot({path: 'screenshot.png', clip: { x: 100, y: 100, width: 400, height: 400, scale: 2 }});

What is the expected result?
Scaling factor gets correctly forwarded to Chrome.

What happens instead?
Value is reset to 1 here:

return {x, y, width, height, scale: 1};

@kawie
Copy link

kawie commented Feb 10, 2020

Same issue! Would love if this was possible.

I think this also breaks the suggested workaround in #4419, as soon as you want to take a screenshot

@stale
Copy link

stale bot commented Jun 26, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 26, 2022
@whimboo
Copy link
Collaborator Author

whimboo commented Jun 27, 2022

This is still not working with latest Puppeteer:

  puppeteer:protocol:SEND ►   '{"sessionId":"89053ED5BCD73984AC73A4E423112F08","method":"Page.captureScreenshot","params":{"format":"png","clip":{"x":100,"y":100,"width":400,"height":400,"scale":1},"captureBeyondViewport":true},"id":18}'

@OrKoN maybe it's not too hard to fix?

@stale stale bot removed the unconfirmed label Jun 27, 2022
@OrKoN OrKoN self-assigned this Jun 28, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Jun 28, 2022

Let me take a look at this later.

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