-
Notifications
You must be signed in to change notification settings - Fork 195
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
Specifying a small canvas size doesn't work #12
Comments
use --scale=1 ;) |
Hmm, that didn't work. It might be a byproduct of the page being designed wrong, but that still yielded a screenshot at 800x864px. |
can you post the command line instruction? I would like to test it since I'm starting with webkit2png and solve this kind of stuff will help us all |
Here's the command I used: webkit2png --scale=1 -o foo "http://www.comcastoffers.com/?exp=mobile" The quotes are necessary because of the query string param. Like I mentioned above, I dropped in a dirty hack that allows --iphone to constrain the parameters to 320x365. In main():
|
would this command give you a foo-clipped.png file that works for you? python wk2png --scale=1 -o foo --width=320 --clipwidth=320 --clipheight=365 http://www.comcastoffers.com/?exp=mobile |
It looks like it, yeah. I'll have to try it with an unhacked webkit2png, though. I might have overloaded settings elsewhere; I'm not sure. Thanks! |
It looks to me like |
The webkit2png -Fs 1 -W 320 "http://mathiasbynens.be/" This creates But still this is quite painful. Why is |
This might have made sense when this code was first written 9 years ago (before the iPhone, when we were debating "Fixed", "Elastic" and "Fluid" designs) but it doesn't make any sense now. In particular there's no reason for this restriction to apply when no clipped image is requested, but it does. This should give a 320-wide image, but doesn't:
The challenge is how to fix this without breaking the behavior of the "clipped" images. As I mentioned in #32 I've been meaning to rethink the distinction between clipped, thumbnails and full size images for some time (most people need just one, generating all three by default is wasteful behavior) and I think this issue might be what tips me over into making that change. But until then, at least there's a crappy workaround. |
I just left a long comment on a related pull request (#66) that proposed a solution to some of the issues brought up here, and I'd love some feedback on it from the people that have been affected by this bug. |
Specify scale and clip width to force window to a particular width. See paulhammond/webkit2png#12 and paulhammond/webkit2png#66 for details of the underlying webkit2png issue.
Closing in favor of #109 |
When I set the h/w to, for example, 320x365 (for capturing the canvas of an iPhone-targeted site in portrait mode), the actual screengrab ends up being 8xx by 8xx anyway. I've worked around this locally by adding an -iphone option that overrides options.[height, width, initHeight, initWidth], but in an overtly hacky way.
The text was updated successfully, but these errors were encountered: