fzaninotto/screenshot-as-a-service

Height param seems to be ignored

Closed this issue · 1 comments

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?

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.