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

Using non data urls when running in node #108

Open
kierans opened this issue Jul 11, 2021 · 0 comments
Open

Using non data urls when running in node #108

kierans opened this issue Jul 11, 2021 · 0 comments

Comments

@kierans
Copy link

kierans commented Jul 11, 2021

Thanks for this handy little library.

When running in node using node-canvas I'm wanting the result of the merge to be a buffer or a stream rather than a base64 encoded string. I think it would be possible to do this with an outputType option? The rules would be

  • If not provided defaults to dataURL
  • If running in browser, only dataURL is a permitted output type
  • Options include: dataURL, buffer, stream
  • If stream then based the canvas stream method is used based on mime type
    • image/png -> createPNGStream
    • image/jpeg -> createJPEGStream
    • application/pdf -> createPDFStream
    • else error

I'm happy to help with this feature, if it will be accepted/merged. 😄

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

No branches or pull requests

1 participant