版本
fabricjs 2.0.0-beta.6 节点画布 1.6.6 nodejs 6.11.0
重现步骤
nodejs 上的 fabricjs,1.7.16 与图像过滤器一起工作正常,当更新到 2.0.0 时,无法正常工作
var jsonStr = '{"objects":[{"type":"circle","originX":"left","originY":"top","left":119,"top":64,"width":100,"height":100,"fill":"#6dcdd0","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeLineJoin":"miter","strokeMiterLimit":10,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":0.8,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"radius":50,"startAngle":0,"endAngle":6.283185307179586}]}';
var canvas = fabric.createCanvasForNode(600, 600);
canvas.loadFromJSON(jsonStr, function() {
canvas.renderAll();
var dataUrl = canvas.toDataURL();
fabric.Image.fromURL(dataUrl, function(img) {
var filter = new fabric.Image.filters.Sepia();
img.filters.push(filter);
img.applyFilters();
canvas.add(img);
var dataUrl = canvas.toDataURL();
});
预期行为
canvas.toDataURL()
返回数据地址
实际行为
returnReply (/data/web/websites/adamlv/node_workspace/monet/node_modules/redis/index.js:192:18)", "在 JavascriptRedisParser.execute (/data/web/websites/adamlv/node_workspace/monet/node_modules/ redis-parser/lib/parser.js:553:10)", "在套接字。(/data/web/websites/adamlv/node_workspace/monet/node_modules/redis/index.js:274:27)", "在 emitOne (events.js:96:13)"