Permalink
Browse files

dimensions

  • Loading branch information...
1 parent b687cd0 commit e03cc8176ce7c927b1480955ad8193f7292d090d @tj tj committed Dec 18, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 scripts/rasterize.js
View
9 scripts/rasterize.js
@@ -1,13 +1,16 @@
var page = require('webpage').create()
, url = phantom.args[0]
- , path = phantom.args[1];
+ , path = phantom.args[1]
+ , size = phantom.args[2] || '';
if (!url) throw new Error('url required');
if (!path) throw new Error('output path required');
+size = size.split('x');
+
page.viewportSize = {
- width: 600
- , height: 600
+ width: ~~size[0] || 1024
+ , height: ~~size[1] || 600
};
page.open(url, function (status) {

0 comments on commit e03cc81

Please sign in to comment.