Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node-Canvas support #4494

Closed
ghost opened this issue Nov 24, 2017 · 7 comments · Fixed by #4497
Closed

Node-Canvas support #4494

ghost opened this issue Nov 24, 2017 · 7 comments · Fixed by #4497

Comments

@ghost
Copy link

ghost commented Nov 24, 2017

Hi,
I'm using (have to use) version 2.0.0 rc1
Can you please add node-canvas support again?

@asturur
Copy link
Member

asturur commented Nov 24, 2017

Hi,
node-canvas support is there.
Hasn't be removed.
You do not need anymore to us createCanvasForNode but just use standar code
var canvas = new fabric.StaticCanvas()

What is the problem actually?

@ghost
Copy link
Author

ghost commented Nov 24, 2017

If I try it

const fabric = require("fabric").fabric;
const fcanvas = new fabric.StaticCanvas();

const rect = new fabric.Rect({
  left: 50, top: 50, originX: "center", originY: "center", fill: "red", width: 50, "height": 50
});
fcanvas.add(rect);

console.log(fcanvas.createPNGStream());

I get this error
fcanvas.createPNGStream is not a function

@asturur
Copy link
Member

asturur commented Nov 24, 2017

ok maybe createPNGStream was a rush deletion. coming back.

@asturur
Copy link
Member

asturur commented Nov 24, 2017

trying to release rc2 today with those fixes.

@ghost
Copy link
Author

ghost commented Nov 24, 2017

Thank you very much

@asturur
Copy link
Member

asturur commented Nov 24, 2017

May not be possible to restore now.
I asked for support to JSDOM.
If you need to access the data as a buffer, can you use the toBlob method or is not possible?

@asturur
Copy link
Member

asturur commented Nov 24, 2017

Canvas.lowerCanvasEl.toBlob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant