Browse Source

fixed createJPEGStream() "options" global

v1.x
Tj Holowaychuk 13 years ago
parent
commit
1f60f0ad3b
  1. 26
      lib/canvas.js

26
lib/canvas.js

@ -118,35 +118,29 @@ Canvas.prototype.createSyncPNGStream = function(){
/**
* Create a `JPEGStream` for `this` canvas.
*
* @param {Object} [opts] Can optionally contain bufsize or quality settings
* @param {Object} options
* @return {JPEGStream}
* @api public
*/
Canvas.prototype.createJPEGStream = function(opts){
opts = opts || {};
options = {
bufsize : opts.bufsize || 4096,
quality : opts.quality || 60,
};
return new JPEGStream(this, options);
Canvas.prototype.createJPEGStream = function(options){
return this.createSyncJPEGStream(options);
};
/**
* Create a synchronous `JPEGStream` for `this` canvas.
*
* @param {Object} [opts] Can optionally contain bufsize or quality settings
* @param {Object} options
* @return {JPEGStream}
* @api public
*/
Canvas.prototype.createSyncJPEGStream = function(opts){
opts = opts || {};
options = {
bufsize : opts.bufsize || 4096,
quality : opts.quality || 60,
};
return new JPEGStream(this, options, true);
Canvas.prototype.createSyncJPEGStream = function(options){
options = options || {};
return new JPEGStream(this, {
bufsize: options.bufsize || 4096
, quality: options.quality || 75
}, true);
};
/**

Loading…
Cancel
Save