[英]Can I use Sharp image processing library in React js?
I try to use Sharp image processing in my create react app.我尝试在我创建的 React 应用程序中使用Sharp图像处理。 But it sends a error但它发送错误
This is my code这是我的代码
import sharp from 'sharp';
const buffer = await sharp(req.file.buffer)
.resize({ width: 250, height: 250 })
.extend({
top: 10,
bottom: 10,
left: 10,
right: 10,
background: '#d7d8de'
})
.png()
Edit: I'm using Node.js version 12.18.0编辑:我正在使用 Node.js 版本 12.18.0
For client side processing, use Canvas API: https://www.w3schools.com/html/html5_canvas.asp对于客户端处理,使用 Canvas API: https://www.w3schools.com/html/html5_canvas.asp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.