fzaninotto / screenshot-as-a-service

Website screenshot service powered by node.js and phantomjs
1.1k stars 243 forks source link

Height param seems to be ignored #36

Closed gidsg closed 11 years ago

gidsg commented 11 years ago

I tried to use the height param to control the size of the window/screenshot but it seems to be being ignored e.g.

http://localhost:3000/?url=http://m.guardian.co.uk/&width=320&height=100 produces an image of 320x7200 I would expect an image off 320x100? As a workaround I am using clipRect Is this a bug or am I misunderstanding the behaviour of the height parameter?

fzaninotto commented 11 years ago

The height is the one of the viewport, but pages longer than that go beyond the viewport, and the screenshot takes entire pages. In other words, the height parameter is more like a min-height. To limit the height of a tall webpage, you should use clipRect.