Add createJPEGStream support for fabric canvas

Node Canvas already has support for createJPEGStream. Create a route to
take advantage of that through fabric.js canvas.
This commit is contained in:
Cedric Wienold 2013-01-17 12:48:41 -08:00
parent 60af92a9c3
commit 958f37d8fb

View file

@ -121,6 +121,10 @@
return this.nodeCanvas.createPNGStream();
};
fabric.StaticCanvas.prototype.createJPEGStream = function(opts) {
return this.nodeCanvas.createJPEGStream(opts);
};
var origSetWidth = fabric.StaticCanvas.prototype.setWidth;
fabric.StaticCanvas.prototype.setWidth = function(width) {
origSetWidth.call(this);
@ -141,4 +145,4 @@
fabric.Canvas.prototype.setHeight = fabric.StaticCanvas.prototype.setHeight;
}
})();
})();