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

Loading…
Cancel
Save