mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-21 14:34:43 +00:00
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:
parent
60af92a9c3
commit
958f37d8fb
1 changed files with 5 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue