Images cropped incorrectly on retina displays #64

herrstucki opened this Issue Feb 10, 2014 · 1 comment

2 participants


When using the --selector option, the results are great when I run webkit2png on a "normal" display (non-retina). However, when it's run on a retina display (I guess the main display setting is relevant), the image is scaled up but cropped with the wrong dimensions.

Captured on a non-retina display:


Captured on a retina display:


Possibly related to #38.


I think the problem here is the code (which landed in #42) assumes that element.offsetWidth() and element.offsetHeight() give the width and height that we want to crop to. But on a retina display you need to multiply by a scaling factor to get the right dimensions - we probably need to use one of the Cocoa High Resolution APIs to do this conversion. But, I don't have a retina display so this is really hard for me to experiment on or test. If anyone else wants to step up to write the code I'll do what I can to help out...

@paulhammond paulhammond closed this in #65 Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment