MacOS / OSX screenshots can have the wrong DPI setting when moving between monitors
Reported by
cr...@craigfrancis.co.uk,
Dec 8 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Steps to reproduce the problem: 1) Open a browser window on a 72 dpi monitor 2) Run `screencapture -x -i screenshot.png`, press the [space] key, and screenshot the window. 3) Run `sips -g dpiWidth screenshot.png`. 4) Confirm the DPI is 72.000 (correct). 5) Drag the browser window over to a 144 DPI monitor. 6) Repeat steps 1 and 2 - the screenshot has the DPI set to 72.000 (wrong). 7) Open a new browser window on the 144 DPI monitor. 8) Repeat steps 1 and 2 - the screenshot has the DPI set to 144.000 (correct). 9) Drag this second browser window over to a 72 DPI monitor. 10) Repeat steps 1 and 2 - the screenshot has the DPI set to 144.000 (wrong). What is the expected behavior? What went wrong? The window should be updated when it's moved between monitors, so MacOS (OSX) knows the DPI for the screenshot. Did this work before? N/A Chrome version: 62.0.3202.94 Channel: n/a OS Version: OS X 10.13.2 Flash Version: Firefox updates itself when moving windows between monitors. Safari always sets the screenshots to 72 DPI, no matter which window it's on (not good). When the DPI setting is wrong, it makes it difficult to use the image - for example, when you use one of these screenshots in an email, the image size is either shown too big or too small.
,
Dec 12 2017
,
Jan 2 2018
[mac bug triage] +asvitkine@ from render_widget_host_view_mac.* OWNERS - could you help triage? Thanks!
,
Jan 2 2018
+ccameron
,
Jan 4 2018
[mac bug triage] craig@craigfrancis.co.uk - when you move the Chrome window from the 72 dpi screen to the 144 dpi screen, does the Chrome window look pixelated, or does it seem like it has the proper bit depth?
,
Jan 5 2018
A Chrome window starting on a 72 dpi screen does not appear to be pixelated on the 144 dpi screen. It correctly transitions from 72 dpi to 144 dpi, but the screenshots taken record the wrong dpi value. I'm assuming there is some meta data associated with the window that OSX uses, and this is not being updated (something that Firefox does). That said, when I move Firefox from one screen to the other, there is a more definitive switch over between resolutions... if there is a re-rendering done by Chrome, it's not noticeable. --- Just to confirm this further, and perhaps more so testing the web page part of the window... I created a 2 x 2 image (1 black pixel in the top left, 1 red pixel in the bottom right, and 2 white pixels), and loaded it on a web page using: <img src="4x4.gif" width="1" height "1" /> I then opened two browser windows, one starting on the 72dpi screen, the second stating on the 144 dpi screen, and used the OSX screen zooming feature to see what was being rendered as they were being moved between screens (enabled in Apple > System Preferences > Accessibility > Zoom). Both windows showed the 4 pixels on the 144 dpi screen, and a single pixel on the 72 dpi screen. Taking screenshots (screencapture) and checking the dpiWidth (sips), both windows continued to show the same DPI for the screen they were started on... I've attached these in a zip, so they don't get re-saved without the metadata (filename format is DPI of the screen opened on, followed by the DPI of the screen the screenshot was taken on).
,
Jan 5 2018
Thank you for providing more feedback. Adding requester "shrike@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 8 2018
[Mac triage] This looks like a bug in macOS, because the same thing happens if I screenshot Finder windows. I think Firefox is tickling the window in a way that causes its DPI to be recomputed by the window server — my guess based on a *very* quick look at their code is that it's nsCocoaWindow::SetWindowTransform() changing the window's transformation matrix. But, I don't think that's on purpose, and I don't think it's a good idea for Chrome to do something like that just to work around it. Definitely file a bug with Apple, if you haven't already, and let me know if I misunderstood!
,
Jan 8 2018
,
Jan 9 2018
Agreed, thanks SDY. Didn't realise Finder did the same. Intensely Safari does not record a DPI value, so all of their screenshots are seen as 72 DPI, and it's odd how FireFox managed to get their screenshots to work (but it is a bit quirky). Anyone from Apple, you need: rdar://27452205 - What I've been told is the original. rdar://35720475 - My complaint about High DPI screenshots. rdar://35955716 - Where Safari does not record the DPI value, so everything is 72 DPI. And confirmation from WebKit that they believe it's an Apple Safari issue. https://bugs.webkit.org/show_bug.cgi?id=180582 |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by cr...@craigfrancis.co.uk
, Dec 8 2017