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

add option for better render resolution ( code included) #26

Closed
giko45 opened this issue Aug 10, 2016 · 3 comments
Closed

add option for better render resolution ( code included) #26

giko45 opened this issue Aug 10, 2016 · 3 comments

Comments

@giko45
Copy link

giko45 commented Aug 10, 2016

Hi,
To get a better resolution in renderd images I usually change in the webshot.js file (system.file("webshot.js", package="webshot"))

the follwoing line
casper.start(url).viewport(opts.vwidth, opts.vheight);
to
casper.start(url).viewport(opts.vwidth, opts.vheight).zoom(2);

Could that be added as a option instead?

@wch
Copy link
Owner

wch commented Sep 22, 2016

Sounds like a good idea. It would also be nice to do HiDPI (Retina-resolution) screenshots (i.e. with a window.devicePixelRatio) which could differ from a zoomed screenshot because a page may load different, higher-res images when it thinks it's rendering on a HiDPI device.

@wch wch closed this as completed in a348503 Sep 22, 2016
@giko45
Copy link
Author

giko45 commented Sep 22, 2016

Hi,

I checked the code you checked and noticed that you also changed the viewport. I only did use casper.start(url).viewport(opts.vwidth, opts.vheight).zoom(2) without changeing the viewport.

Wy is the change in viewport needed. Does that not lead to changed fontsizes etc?

@wch
Copy link
Owner

wch commented Sep 22, 2016

Maybe we have a different understanding of what the zoom is supposed to do, but without changing the viewport, the "virtual" viewport size changes when you zoom, so the end result can have a very different layout.

For example, here's the R homepage taken with no zoom:
r-normal

Here it is with zoom=2, but no changing of the viewport. The pixel dimensions are the same but the layout changes:
r-small-zoomed-no-viewport

Here it is with zoom=2 and a doubling of the viewport (you may need to open this in a new window to see how it differs from the first image:
r-small-zoomed

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