diff --git a/coverage/coverage.json b/coverage/coverage.json index a4b1162..a5e1b57 100644 --- a/coverage/coverage.json +++ b/coverage/coverage.json @@ -1 +1 @@ -{"/Users/ifahrentholz/dev/lips/lib/server.js":{"path":"/Users/ifahrentholz/dev/lips/lib/server.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1},"b":{},"f":{"1":1,"2":1},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":35}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":36}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":15,"column":2}},"2":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}},"3":{"start":{"line":3,"column":2},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":2},"end":{"line":4,"column":44}},"5":{"start":{"line":5,"column":2},"end":{"line":5,"column":45}},"6":{"start":{"line":6,"column":2},"end":{"line":6,"column":37}},"7":{"start":{"line":8,"column":2},"end":{"line":14,"column":5}},"8":{"start":{"line":9,"column":4},"end":{"line":9,"column":100}},"9":{"start":{"line":10,"column":4},"end":{"line":10,"column":132}},"10":{"start":{"line":11,"column":4},"end":{"line":11,"column":100}},"11":{"start":{"line":12,"column":4},"end":{"line":12,"column":100}},"12":{"start":{"line":13,"column":4},"end":{"line":13,"column":100}}},"branchMap":{}},"/Users/ifahrentholz/dev/lips/lib/config/config.js":{"path":"/Users/ifahrentholz/dev/lips/lib/config/config.js","s":{"1":1,"2":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}},"2":{"start":{"line":3,"column":0},"end":{"line":16,"column":2}}},"branchMap":{}},"/Users/ifahrentholz/dev/lips/lib/services/image-service.js":{"path":"/Users/ifahrentholz/dev/lips/lib/services/image-service.js","s":{"1":1,"2":1,"3":6,"4":6,"5":3,"6":3,"7":6,"8":6,"9":4,"10":6},"b":{"1":[3,3],"2":[4,2]},"f":{"1":6,"2":6},"fnMap":{"1":{"name":"(anonymous_1)","line":10,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":43}}},"2":{"name":"(anonymous_2)","line":22,"loc":{"start":{"line":22,"column":37},"end":{"line":22,"column":59}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}},"2":{"start":{"line":3,"column":0},"end":{"line":29,"column":2}},"3":{"start":{"line":11,"column":4},"end":{"line":11,"column":13}},"4":{"start":{"line":12,"column":4},"end":{"line":16,"column":5}},"5":{"start":{"line":13,"column":6},"end":{"line":13,"column":50}},"6":{"start":{"line":15,"column":6},"end":{"line":15,"column":26}},"7":{"start":{"line":18,"column":4},"end":{"line":27,"column":9}},"8":{"start":{"line":23,"column":8},"end":{"line":25,"column":9}},"9":{"start":{"line":24,"column":10},"end":{"line":24,"column":30}},"10":{"start":{"line":26,"column":8},"end":{"line":26,"column":31}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":4}},{"start":{"line":12,"column":4},"end":{"line":12,"column":4}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]}}},"/Users/ifahrentholz/dev/lips/lib/app.js":{"path":"/Users/ifahrentholz/dev/lips/lib/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":4,"9":4,"10":4,"11":4,"12":8,"13":4,"14":4,"15":4,"16":4,"17":4,"18":4,"19":1,"20":1,"21":3,"22":1},"b":{"1":[4,4],"2":[1,3]},"f":{"1":1,"2":4,"3":8,"4":1},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":63},"end":{"line":8,"column":88}}},"3":{"name":"(anonymous_3)","line":24,"loc":{"start":{"line":24,"column":38},"end":{"line":24,"column":59}}},"4":{"name":"(anonymous_4)","line":35,"loc":{"start":{"line":35,"column":19},"end":{"line":35,"column":30}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":48,"column":2}},"2":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}},"3":{"start":{"line":3,"column":2},"end":{"line":3,"column":35}},"4":{"start":{"line":4,"column":2},"end":{"line":4,"column":39}},"5":{"start":{"line":5,"column":2},"end":{"line":5,"column":22}},"6":{"start":{"line":6,"column":2},"end":{"line":6,"column":57}},"7":{"start":{"line":8,"column":2},"end":{"line":45,"column":5}},"8":{"start":{"line":9,"column":4},"end":{"line":9,"column":23}},"9":{"start":{"line":10,"column":4},"end":{"line":10,"column":22}},"10":{"start":{"line":11,"column":4},"end":{"line":22,"column":7}},"11":{"start":{"line":24,"column":4},"end":{"line":43,"column":6}},"12":{"start":{"line":25,"column":6},"end":{"line":27,"column":7}},"13":{"start":{"line":26,"column":8},"end":{"line":26,"column":32}},"14":{"start":{"line":29,"column":6},"end":{"line":29,"column":68}},"15":{"start":{"line":30,"column":6},"end":{"line":30,"column":74}},"16":{"start":{"line":31,"column":6},"end":{"line":31,"column":51}},"17":{"start":{"line":32,"column":6},"end":{"line":32,"column":57}},"18":{"start":{"line":34,"column":6},"end":{"line":41,"column":7}},"19":{"start":{"line":35,"column":8},"end":{"line":37,"column":26}},"20":{"start":{"line":36,"column":10},"end":{"line":36,"column":26}},"21":{"start":{"line":40,"column":8},"end":{"line":40,"column":24}},"22":{"start":{"line":47,"column":2},"end":{"line":47,"column":13}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":6},"end":{"line":25,"column":6}},{"start":{"line":25,"column":6},"end":{"line":25,"column":6}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":6},"end":{"line":34,"column":6}},{"start":{"line":34,"column":6},"end":{"line":34,"column":6}}]}}}} \ No newline at end of file +{"/Users/ifahrentholz/dev/lips/lib/server.js":{"path":"/Users/ifahrentholz/dev/lips/lib/server.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1},"b":{},"f":{"1":1,"2":1},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":35}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":36}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":15,"column":2}},"2":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}},"3":{"start":{"line":3,"column":2},"end":{"line":3,"column":39}},"4":{"start":{"line":4,"column":2},"end":{"line":4,"column":44}},"5":{"start":{"line":5,"column":2},"end":{"line":5,"column":45}},"6":{"start":{"line":6,"column":2},"end":{"line":6,"column":37}},"7":{"start":{"line":8,"column":2},"end":{"line":14,"column":5}},"8":{"start":{"line":9,"column":4},"end":{"line":9,"column":100}},"9":{"start":{"line":10,"column":4},"end":{"line":10,"column":132}},"10":{"start":{"line":11,"column":4},"end":{"line":11,"column":100}},"11":{"start":{"line":12,"column":4},"end":{"line":12,"column":100}},"12":{"start":{"line":13,"column":4},"end":{"line":13,"column":100}}},"branchMap":{}},"/Users/ifahrentholz/dev/lips/lib/config/config.js":{"path":"/Users/ifahrentholz/dev/lips/lib/config/config.js","s":{"1":1,"2":1},"b":{},"f":{},"fnMap":{},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}},"2":{"start":{"line":3,"column":0},"end":{"line":17,"column":2}}},"branchMap":{}},"/Users/ifahrentholz/dev/lips/lib/services/image-service.js":{"path":"/Users/ifahrentholz/dev/lips/lib/services/image-service.js","s":{"1":1,"2":1,"3":6,"4":6,"5":3,"6":3,"7":6,"8":6,"9":0,"10":6},"b":{"1":[3,3],"2":[0,6]},"f":{"1":6,"2":6},"fnMap":{"1":{"name":"(anonymous_1)","line":10,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":43}}},"2":{"name":"(anonymous_2)","line":22,"loc":{"start":{"line":22,"column":37},"end":{"line":22,"column":59}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}},"2":{"start":{"line":3,"column":0},"end":{"line":29,"column":2}},"3":{"start":{"line":11,"column":4},"end":{"line":11,"column":13}},"4":{"start":{"line":12,"column":4},"end":{"line":16,"column":5}},"5":{"start":{"line":13,"column":6},"end":{"line":13,"column":49}},"6":{"start":{"line":15,"column":6},"end":{"line":15,"column":24}},"7":{"start":{"line":18,"column":4},"end":{"line":27,"column":9}},"8":{"start":{"line":23,"column":8},"end":{"line":25,"column":9}},"9":{"start":{"line":24,"column":10},"end":{"line":24,"column":30}},"10":{"start":{"line":26,"column":8},"end":{"line":26,"column":31}}},"branchMap":{"1":{"line":12,"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":4}},{"start":{"line":12,"column":4},"end":{"line":12,"column":4}}]},"2":{"line":23,"type":"if","locations":[{"start":{"line":23,"column":8},"end":{"line":23,"column":8}},{"start":{"line":23,"column":8},"end":{"line":23,"column":8}}]}}},"/Users/ifahrentholz/dev/lips/lib/app.js":{"path":"/Users/ifahrentholz/dev/lips/lib/app.js","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":4,"9":4,"10":4,"11":4,"12":4,"13":0,"14":4,"15":4,"16":4,"17":4,"18":4,"19":1,"20":1,"21":3,"22":1},"b":{"1":[0,4],"2":[1,3]},"f":{"1":1,"2":4,"3":4,"4":1},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}},"2":{"name":"(anonymous_2)","line":8,"loc":{"start":{"line":8,"column":63},"end":{"line":8,"column":88}}},"3":{"name":"(anonymous_3)","line":24,"loc":{"start":{"line":24,"column":38},"end":{"line":24,"column":59}}},"4":{"name":"(anonymous_4)","line":35,"loc":{"start":{"line":35,"column":19},"end":{"line":35,"column":30}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":48,"column":2}},"2":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}},"3":{"start":{"line":3,"column":2},"end":{"line":3,"column":35}},"4":{"start":{"line":4,"column":2},"end":{"line":4,"column":39}},"5":{"start":{"line":5,"column":2},"end":{"line":5,"column":22}},"6":{"start":{"line":6,"column":2},"end":{"line":6,"column":57}},"7":{"start":{"line":8,"column":2},"end":{"line":45,"column":5}},"8":{"start":{"line":9,"column":4},"end":{"line":9,"column":23}},"9":{"start":{"line":10,"column":4},"end":{"line":10,"column":22}},"10":{"start":{"line":11,"column":4},"end":{"line":22,"column":7}},"11":{"start":{"line":24,"column":4},"end":{"line":43,"column":6}},"12":{"start":{"line":25,"column":6},"end":{"line":27,"column":7}},"13":{"start":{"line":26,"column":8},"end":{"line":26,"column":32}},"14":{"start":{"line":29,"column":6},"end":{"line":29,"column":68}},"15":{"start":{"line":30,"column":6},"end":{"line":30,"column":74}},"16":{"start":{"line":31,"column":6},"end":{"line":31,"column":51}},"17":{"start":{"line":32,"column":6},"end":{"line":32,"column":57}},"18":{"start":{"line":34,"column":6},"end":{"line":41,"column":7}},"19":{"start":{"line":35,"column":8},"end":{"line":37,"column":26}},"20":{"start":{"line":36,"column":10},"end":{"line":36,"column":26}},"21":{"start":{"line":40,"column":8},"end":{"line":40,"column":24}},"22":{"start":{"line":47,"column":2},"end":{"line":47,"column":13}}},"branchMap":{"1":{"line":25,"type":"if","locations":[{"start":{"line":25,"column":6},"end":{"line":25,"column":6}},{"start":{"line":25,"column":6},"end":{"line":25,"column":6}}]},"2":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":6},"end":{"line":34,"column":6}},{"start":{"line":34,"column":6},"end":{"line":34,"column":6}}]}}}} \ No newline at end of file diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html index 1d1ce7b..f059c0d 100644 --- a/coverage/lcov-report/index.html +++ b/coverage/lcov-report/index.html @@ -20,14 +20,14 @@

- 100% + 95.65% Statements - 46/46 + 44/46
- 100% + 75% Branches - 8/8 + 6/8
100% @@ -35,9 +35,9 @@

8/8

- 100% + 95.65% Lines - 46/46 + 44/46
@@ -60,15 +60,15 @@

lib/ -
- 100% - 34/34 - 100% - 4/4 +
+ 97.06% + 33/34 + 75% + 3/4 100% 6/6 - 100% - 34/34 + 97.06% + 33/34 @@ -86,15 +86,15 @@

lib/services/ -
- 100% - 10/10 - 100% - 4/4 +
+ 90% + 9/10 + 75% + 3/4 100% 2/2 - 100% - 10/10 + 90% + 9/10 @@ -103,7 +103,7 @@

diff --git a/coverage/lcov-report/lib/app.js.html b/coverage/lcov-report/lib/app.js.html index 50c3126..1c75df2 100644 --- a/coverage/lcov-report/lib/app.js.html +++ b/coverage/lcov-report/lib/app.js.html @@ -20,14 +20,14 @@

- 100% + 95.45% Statements - 22/22 + 21/22
- 100% + 75% Branches - 4/4 + 3/4
100% @@ -35,9 +35,9 @@

4/4

- 100% + 95.45% Lines - 22/22 + 21/22
@@ -115,8 +115,8 @@

    - +      @@ -150,12 +150,12 @@

var p = req.params; var q = req.query; var _config = extend({}, config, { - fontSize: q.txtsize, - fontColor: q.txtclr, - fill: q.bg, + txtsize: q.txtsize, + txtclr: q.txtclr, + bg: q.bg, width: parseInt(p.dimension.split('x')[0], 10), height: parseInt(p.dimension.split('x')[1], 10), - text: q.txt, + txt: q.txt, delay: q.delay, contentType: p.contentType, maxAge: q.maxAge, @@ -163,8 +163,8 @@

});   imageService.createImage(_config, function(err, image) { - if(err) { - return console.log(err); + Iif(err) { + return console.log(err); }   res.setHeader('Content-Type', 'image/' + _config.contentType); @@ -193,7 +193,7 @@

diff --git a/coverage/lcov-report/lib/config/config.js.html b/coverage/lcov-report/lib/config/config.js.html index 6b65f7c..6005504 100644 --- a/coverage/lcov-report/lib/config/config.js.html +++ b/coverage/lcov-report/lib/config/config.js.html @@ -58,7 +58,8 @@

13 14 15 -16 +16 +17     @@ -73,6 +74,7 @@

      +   
var pkg = require('../../package.json');
  
 module.exports = {
@@ -80,21 +82,22 @@ 

namespace: 'lips', port: 3000, delay: 0, + bg: 'bada55', contentType: 'png', maxAge: 3153600, noLog: false, expiryDate: new Date(), env: "development", fontFamily: 'Arial.ttf', - fontSize: '24px', - fontColor: '000' + txtsize: '24px', + txtclr: '000' };

diff --git a/coverage/lcov-report/lib/config/index.html b/coverage/lcov-report/lib/config/index.html index 1fdaf25..59fbaa9 100644 --- a/coverage/lcov-report/lib/config/index.html +++ b/coverage/lcov-report/lib/config/index.html @@ -77,7 +77,7 @@

diff --git a/coverage/lcov-report/lib/index.html b/coverage/lcov-report/lib/index.html index a1716b7..7ba9ed3 100644 --- a/coverage/lcov-report/lib/index.html +++ b/coverage/lcov-report/lib/index.html @@ -20,14 +20,14 @@

- 100% + 97.06% Statements - 34/34 + 33/34
- 100% + 75% Branches - 4/4 + 3/4
100% @@ -35,9 +35,9 @@

6/6

- 100% + 97.06% Lines - 34/34 + 33/34
@@ -60,15 +60,15 @@

app.js -
- 100% - 22/22 - 100% - 4/4 +
+ 95.45% + 21/22 + 75% + 3/4 100% 4/4 - 100% - 22/22 + 95.45% + 21/22 @@ -90,7 +90,7 @@

diff --git a/coverage/lcov-report/lib/server.js.html b/coverage/lcov-report/lib/server.js.html index d257dd6..17a7a43 100644 --- a/coverage/lcov-report/lib/server.js.html +++ b/coverage/lcov-report/lib/server.js.html @@ -97,7 +97,7 @@

diff --git a/coverage/lcov-report/lib/services/image-service.js.html b/coverage/lcov-report/lib/services/image-service.js.html index 55941e7..732f20f 100644 --- a/coverage/lcov-report/lib/services/image-service.js.html +++ b/coverage/lcov-report/lib/services/image-service.js.html @@ -20,14 +20,14 @@

- 100% + 90% Statements - 10/10 + 9/10
- 100% + 75% Branches - 4/4 + 3/4
100% @@ -35,9 +35,9 @@

2/2

- 100% + 90% Lines - 10/10 + 9/10
@@ -95,7 +95,7 @@

    - +      @@ -112,19 +112,19 @@

*/ createImage: function(options, callback) { var text; - if(!options.text) { - text = options.width + "x" + options.height; + if(!options.txt) { + txt = options.width + "x" + options.height; } else { - text = options.text; + txt = options.txt; }   - gm(options.width, options.height, "#" + options.fill) - .fill("#" + options.fontColor) - .font(options.fontFamily, options.fontSize) - .drawText(0, 0, text, "center") + gm(options.width, options.height, "#" + options.bg) + .fill("#" + options.txtclr) + .font(options.fontFamily, options.txtsize) + .drawText(0, 0, txt, "center") .toBuffer(options.contentType, function(err, buffer) { - if (err) { - callback(err, null); + Iif (err) { + callback(err, null); } callback(null, buffer); }); @@ -136,7 +136,7 @@

diff --git a/coverage/lcov-report/lib/services/index.html b/coverage/lcov-report/lib/services/index.html index 0367875..a603515 100644 --- a/coverage/lcov-report/lib/services/index.html +++ b/coverage/lcov-report/lib/services/index.html @@ -20,14 +20,14 @@

- 100% + 90% Statements - 10/10 + 9/10
- 100% + 75% Branches - 4/4 + 3/4
100% @@ -35,9 +35,9 @@

2/2

- 100% + 90% Lines - 10/10 + 9/10
@@ -60,15 +60,15 @@

image-service.js -
- 100% - 10/10 - 100% - 4/4 +
+ 90% + 9/10 + 75% + 3/4 100% 2/2 - 100% - 10/10 + 90% + 9/10 @@ -77,7 +77,7 @@

diff --git a/coverage/lcov.info b/coverage/lcov.info index 4d88061..83ec941 100644 --- a/coverage/lcov.info +++ b/coverage/lcov.info @@ -50,16 +50,16 @@ DA:13,3 DA:15,3 DA:18,6 DA:23,6 -DA:24,4 +DA:24,0 DA:26,6 LF:10 -LH:10 +LH:9 BRDA:12,1,0,3 BRDA:12,1,1,3 -BRDA:23,2,0,4 -BRDA:23,2,1,2 +BRDA:23,2,0,0 +BRDA:23,2,1,6 BRF:4 -BRH:4 +BRH:3 end_of_record TN: SF:/Users/ifahrentholz/dev/lips/lib/app.js @@ -71,7 +71,7 @@ FNF:4 FNH:4 FNDA:1,(anonymous_1) FNDA:4,(anonymous_2) -FNDA:8,(anonymous_3) +FNDA:4,(anonymous_3) FNDA:1,(anonymous_4) DA:1,1 DA:2,1 @@ -84,8 +84,8 @@ DA:9,4 DA:10,4 DA:11,4 DA:24,4 -DA:25,8 -DA:26,4 +DA:25,4 +DA:26,0 DA:29,4 DA:30,4 DA:31,4 @@ -96,11 +96,11 @@ DA:36,1 DA:40,3 DA:47,1 LF:22 -LH:22 -BRDA:25,1,0,4 +LH:21 +BRDA:25,1,0,0 BRDA:25,1,1,4 BRDA:34,2,0,1 BRDA:34,2,1,3 BRF:4 -BRH:4 +BRH:3 end_of_record diff --git a/lib/app.js b/lib/app.js index 15d5a25..a920abe 100644 --- a/lib/app.js +++ b/lib/app.js @@ -9,12 +9,12 @@ module.exports = function(config) { var p = req.params; var q = req.query; var _config = extend({}, config, { - fontSize: q.txtsize, - fontColor: q.txtclr, - fill: q.bg, + txtsize: q.txtsize, + txtclr: q.txtclr, + bg: q.bg, width: parseInt(p.dimension.split('x')[0], 10), height: parseInt(p.dimension.split('x')[1], 10), - text: q.txt, + txt: q.txt, delay: q.delay, contentType: p.contentType, maxAge: q.maxAge, diff --git a/lib/config/config.js b/lib/config/config.js index c6acdf8..b3688ab 100644 --- a/lib/config/config.js +++ b/lib/config/config.js @@ -5,12 +5,13 @@ module.exports = { namespace: 'lips', port: 3000, delay: 0, + bg: 'bada55', contentType: 'png', maxAge: 3153600, noLog: false, expiryDate: new Date(), env: "development", fontFamily: 'Arial.ttf', - fontSize: '24px', - fontColor: '000' + txtsize: '24px', + txtclr: '000' }; \ No newline at end of file diff --git a/lib/services/image-service.js b/lib/services/image-service.js index 17e1bce..4122b27 100644 --- a/lib/services/image-service.js +++ b/lib/services/image-service.js @@ -9,16 +9,16 @@ module.exports = { */ createImage: function(options, callback) { var text; - if(!options.text) { - text = options.width + "x" + options.height; + if(!options.txt) { + txt = options.width + "x" + options.height; } else { - text = options.text; + txt = options.txt; } - gm(options.width, options.height, "#" + options.fill) - .fill("#" + options.fontColor) - .font(options.fontFamily, options.fontSize) - .drawText(0, 0, text, "center") + gm(options.width, options.height, "#" + options.bg) + .fill("#" + options.txtclr) + .font(options.fontFamily, options.txtsize) + .drawText(0, 0, txt, "center") .toBuffer(options.contentType, function(err, buffer) { if (err) { callback(err, null); diff --git a/tests/imageservice.test.js b/tests/imageservice.test.js index cf3279a..711e34a 100644 --- a/tests/imageservice.test.js +++ b/tests/imageservice.test.js @@ -6,12 +6,12 @@ describe("Imageservice", function() { var ror = false; var buf = false; var options = { - text: "test", + txt: "test", width: 200, height: 200, - fill: "bada55", - font: "Arial", - "fontSize": 12, + bg: "bada55", + fontFamily: "Arial", + txtsize: 12, contentType: "png" };