Closed giko45 closed 7 years ago
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.
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?
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:
Here it is with zoom=2, but no changing of the viewport. The pixel dimensions are the same but the layout changes:
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:
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);
tocasper.start(url).viewport(opts.vwidth, opts.vheight).zoom(2);
Could that be added as a option instead?