diff --git a/index.js b/index.js index 5253eff..9680f3c 100644 --- a/index.js +++ b/index.js @@ -143,8 +143,8 @@ Thumbor.prototype = { * @param {String} height */ resize: function(width, height) { - this.width = width; - this.height = height; + this.width = width || ''; + this.height = height || ''; return this; }, @@ -160,8 +160,8 @@ Thumbor.prototype = { * @param {String} height */ fitIn: function(width, height) { - this.width = width; - this.height = height; + this.width = width || ''; + this.height = height || ''; this.fitInFlag = true; return this; }, @@ -184,7 +184,6 @@ Thumbor.prototype = { * @param {String} halign 'left', 'center', 'right' */ halign: function(halign) { - console.log('halign: ', halign); if ( halign === this.LEFT || halign === this.RIGHT || @@ -226,7 +225,9 @@ Thumbor.prototype = { * @param {String} filterCall */ filter: function(filterCall) { - this.filtersCalls.push(filterCall); + if(this.filtersCalls.indexOf(filterCall) == -1) { + this.filtersCalls.push(filterCall); + } return this; }, /** @@ -274,4 +275,4 @@ Thumbor.prototype = { } }; -module.exports = Thumbor; \ No newline at end of file +module.exports = Thumbor;