We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
图片处理之后,我不想保存到文件,而是想获取一段base64数据。
The text was updated successfully, but these errors were encountered:
Just seen your question, Nodejs has built-in function to do this.
var toBase64 = imgbuffer.toString('base64');
Sorry, something went wrong.
@hungchai Thanks a lot. I found this. So I do not need to save the img file first.
.encode(type[, config]) eg:images("input.png").encode("jpg", {operation:50}) Encode image to buffer, config is image setting. 以指定格式编码当前图像到Buffer,config为图片设置,目前支持设置JPG图像质量 Return buffer 返回填充好的Buffer
And code .encode("jpg", {operation:50}).toString('base64'))
.encode("jpg", {operation:50}).toString('base64'))
No branches or pull requests
图片处理之后,我不想保存到文件,而是想获取一段base64数据。
The text was updated successfully, but these errors were encountered: