Issue metadata
Sign in to add a comment
|
Headless chrome renders screenshot using 2x resolution with retina display
Reported by
v04...@gmail.com,
Oct 2 2017
|
||||||||||||||||||||||
Issue descriptionChrome Version : 61.0.3163.100 (Official Build) (64-bit) What steps will reproduce the problem? (1) create the following SVG-file (circle.svg): <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'> <circle fill='red' cx='50' cy='50' r='50'/> </svg> (2) Capture a screenshot using headless mode, expecting a png with a specified dimensions: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --screenshot --window-size=256,256 file://$PWD/circle.svg (3) Check screenshot.png What is the expected result? screenshot.png should be of size 256x256, as requested What happens instead? screenshot.png is of a double size 512x512 OS: macOS Sierra 10.12.6 (16G29), MacBook Pro (Retina, Mid 2012) This isn't about SVG, any screenshot will be the same, I'm using SVG as an example. If I'm connecting second display and close a laptop lid, so the only display is non-retina display, Chrome renders screenshot with correct size. I don't think that headless behaviour should depend on a currently active display. The only workaround is to check for presence of Retina display using /usr/sbin/system_profiler SPDisplaysDataType | grep 'Resolution.*Retina' and request a chrome a half-size image, but it doesn't work if I need a image with odd size.
,
Oct 3 2017
,
Oct 3 2017
,
Oct 8 2017
This is a known limitation of Headless on Mac. I'm merging this issue with crbug/755095. In your case forcing the scale factor as einbinder@ suggested in #1 should work.
,
Oct 11 2017
Yes, it works, thanks for suggestion. Might be surprising for new users. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by einbinder@chromium.org
, Oct 2 2017