Closed kiwilili closed 5 years ago
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
Thanks a lot for the PR, but right now I'd opt not to pull it as is. Please see my comment at https://github.com/ETCDEVTeam/hashicon/issues/23
Setting node-canvas as dependency will bloat this library for browser-only users, that's why I suggested we allow an alternative createCanvas function
rather then type
as input. This would also allow further flexibility for people with other custom canvas requirements.
hashicon returns a canvas, that should be consistent. so I wouldn't return base64 for node and canvas for browser. If one wants base64, they should toDataURL()
, but maybe they'd want to hashicon(hash).createPNGStream()
or any other output node-canvas provides.
So, I think it's better changing the renderer
function to something like: function renderer(hashValues, params, createCanvasFn)
(and the relevant changes for the wrapping main.js). I can do it in the next week (lack of time now).
Thanks again for your PR!
Thank you for your reply, I think your suggestion will be more suitable for the purpose of using this project.
Hey, I really need to generate these images on the server also. Any word on this?
Closing PR. has been resolve in v0.3.0
The default browser, passing the {type: 'node'} parameter, will base64 format url